Nicolas Buduroi | 1 Apr 2012 01:13
Picon
Gravatar

A simple (and naive) online whiteboard using Aleph & ClojureScript

Hi everyone, I've been experimenting with ClojureScript and Aleph lately and made this sample application. It's a naive implementation of an online whiteboard. It's under a hundred line of code so it's a quick read:

https://github.com/budu/board

The Clojure web development story is getting better and better everyday, bit thanks to everyone involved!

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
Picon
Gravatar

Re: A simple (and naive) online whiteboard using Aleph & ClojureScript

Maybe you can create an online demo site?

On Sun, Apr 1, 2012 at 7:13 AM, Nicolas Buduroi <nbuduroi <at> gmail.com> wrote:
Hi everyone, I've been experimenting with ClojureScript and Aleph lately and made this sample application. It's a naive implementation of an online whiteboard. It's under a hundred line of code so it's a quick read:

https://github.com/budu/board

The Clojure web development story is getting better and better everyday, bit thanks to everyone involved!

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en



--
GuruDigger- We help internet products find technical partners who share the same dream!

- http://gurudigger.com

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
Nicolas Buduroi | 1 Apr 2012 02:07
Picon
Gravatar

Re: A simple (and naive) online whiteboard using Aleph & ClojureScript

On Saturday, March 31, 2012 7:35:03 PM UTC-4, jun lin wrote:

Maybe you can create an online demo site?
 
Yes good idea, I'll try to get it running on Heroku tomorrow.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
Jeff Weiss | 1 Apr 2012 02:25
Picon

Re: Source code as metadata

I believe the latest code does capture closures properly.  I haven't tested all kinds of crazy corner cases, but it does work for all my closures.


From browsing git, it looks like the project.clj version hasn't been incremented in 7 months, and the fix for closures came in after that.  If you're using serializable.fn from a maven repo, it is out of date, AFAICT.

-jeff

On Friday, March 30, 2012 3:07:53 PM UTC-4, Phil Hagelberg wrote:
Nathan Matthews <nathan.r.matthews <at> gmail.com> writes:

> I wanted to serialise functions and send them over the network. The
> problem with serializable-fn is that it doesn't capture closures.

It's designed to capture closures; if it doesn't that would be an
(unsurprising) bug.

-Phil

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
Jim Blomo | 1 Apr 2012 07:02
Picon

Re: Is it possible to extend a parameterized type using gen-class?

I have this feature implemented in my 1.3.x branch in github.  I'll be
sending in the contributor agreement Monday and hopefully getting some
developer feedback thereafter.

The solution was to add a class signature when parameterized generics
are used.  Signatures are stored along with the bytecode in .class
files and used by Java's reflection capabilities, though not strictly
used by the JVM.  Parameters are specified by adding metadata
information to the :extends and :implements arguments to gen-class.

sim's use case should be solved with

(ns ExampleCollection
  (:gen-class :extends ^{:parameters [SomeItemType]}
java.util.AbstractCollect))

Note that neither the types nor constraints are checked when writing
the signature.

https://github.com/jblomo/clojure/commit/15ff4f96840788253c5af66a2265387d880bad80

Jim

On Wed, Mar 28, 2012 at 10:27 PM, Jim Blomo <jim.blomo <at> gmail.com> wrote:
> sim, I don't think it is possible right now.  I am not an expert, but...
>
> On Fri, Mar 2, 2012 at 5:04 AM, Daniel Solano Gomez <clojure <at> sattvik.com> wrote:
>> Yes, it is possible.  At the byte-code level there is (at least at
>> run-time) no difference between a generic and a non-generic class.  All
>> methods take/return the generic type just use Object.
>
> This is mostly true, but for the use case needed, deriving from a
> parameterized superclass, the JVM does track the parameterized
> generic.  Class.getGenericSuperclass returns a ParameterizedType for
> Classes extending a parameterized generic.
>
> I would like this functionality as well for writing a Dropwizard
> service in Clojure.  The Dropwizard framework relies on reflecting on
> the parameter of a parent, and this doesn't seem possible in Clojure
> right now.  Writing a Java shim to do the inheritance also won't work
> with the current version of Dropwizard (though perhaps that is a
> design bug in the framework).
>
> I've taken a look at how annotations are done in generate-class, and
> would like input on the best way to add this functionality.  My rough
> plan is:
>
> - Create an implementation of ParameterizedType for Clojure
> - Add a metadata argument to the symbol passed to gen-class :extends
> or :implements
> - when that metadata is present, override getGenericSuperclass in the
> generated class to return the ParameterizedType
>
> Is this reasonable?  Are there other areas that need to expose generic
> parameters?
>
> Jim
>
> http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html#getGenericSuperclass()
> https://github.com/codahale/dropwizard/blob/master/dropwizard-core/src/main/java/com/yammer/dropwizard/AbstractService.java#L75

--

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

zoka | 1 Apr 2012 08:22
Picon

Re: A simple (and naive) online whiteboard using Aleph & ClojureScript

Unfortunately  I do not think that Heroku supports Websockets, just
HTTP. When your web application is started as Heroku dyno, its
webserver (either Aleph or Jetty) starts on a randomly
assigned port and then Heroku  routing infrastructure presents it to
the world as yourapp.herokuapp.com:80. The routing infrastructure at
this stage does not support Websockets, so you app is unreachable by
Websocket cllients.

There is work being done on NGINX module  to address this see:
http://www.letseehere.com/reverse-proxy-web-sockets
https://github.com/yaoweibin/nginx_tcp_proxy_module

Zoka

On Apr 1, 10:07 am, Nicolas Buduroi <nbudu... <at> gmail.com> wrote:
> On Saturday, March 31, 2012 7:35:03 PM UTC-4, jun lin wrote:
>
> > Maybe you can create an online demo site?
>
> Yes good idea, I'll try to get it running on Heroku tomorrow.

--

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Jonas | 1 Apr 2012 20:29
Picon
Gravatar

[ANN] kibit 0.0.3

I'm happy to announce the release of kibit[1] version 0.0.3. New in this release include:

* much better reporting
* a more advanced rule system
* more rules
* bug fixes

Thanks to all who have contributed!

Jonas

[1] https://github.com/jonase/kibit

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
Marshall T. Vandegrift | 1 Apr 2012 22:16
Picon
Gravatar

Initializers for AOTed deftype classes

Hi,

I'm trying to define some bits of Hadoop glue using `deftype` from
Clojure.  I'm using Leiningen to produce an AOT-complied JAR of the
generated classes.  At runtime, Hadoop uses reflection to load classes
specified by name in (non-code) configuration.  Hadoop is able to locate
and instantiate instances of the class without issue, but then:

  java.lang.IllegalStateException: 
    Attempting to call unbound fn: #'byteable.api/byteable?

That particular example is for a var in a different namespace, but vars
in the same namespace as that which `deftype`s the class cause the same
problem.  If I modify the type's entry-point methods to first `(require
'deytping.namespace)`, then everything works fine.

So, is this entirely expected behavior?  Or am I missing something which
would make initializing the defining namespace happen as part of a
static initializer for the AOTed `deftype` class?

Thanks!

-Marshall

--

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Phil Hagelberg | 2 Apr 2012 06:12
Gravatar

Re: Source code as metadata

Jeff Weiss <jeffrey.m.weiss <at> gmail.com> writes:

> From browsing git, it looks like the project.clj version hasn't been
> incremented in 7 months, and the fix for closures came in after that.
> If you're using serializable.fn from a maven repo, it is out of
> date, AFAICT.

Sorry about that; just pushed a new 1.1.2 version with the latest code
from Github.

-Phil

--

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Robert Levy | 2 Apr 2012 07:33
Picon
Gravatar

ANN: Swiss Arrows

Swiss arrows is a library I wrote today, providing a number of useful arrow macros.
  • The Diamond Wand: a generalized arrow macro for threading into any position.
  • The Back Arrow: ->> with its arguments reversed, convenient in some cases.
  • The Furcula / Parallel Furcula: branch the result of an operation in multiple directions, sequentially or in parallel. 
  • The Double Furcula / Parallel Furcula, Double-style: the above, using ->> instead of ->
  • The Diamond Fishing Rod / Parallel Diamond Fishing Rod: the above, using -<>
Swiss Arrows is available to try out right now at https://github.com/rplevy/swiss-arrows

Feedback, ideas, and pull requests are of course very welcome.

Rob

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Gmane