Re: 1.5 alpha 5 - performance issues relating to hashing and equals

2013-01-25 Thread Christophe Grand
Hi Mark,

The hasheq chaching patch got applied between beta1 and beta2 so it's not
in alpha5.
The answer to your problem is to compute hahses incrementally.
There's a very old ticket for that
http://dev.clojure.org/jira/browse/CLJ-15at the time it was a bullet
point on one of Rich's todo list on Assembla.
If there is still interest in incremental hashes and hasheqs I'm willing to
put a patch together. (I cc this reply to clojure-dev)

Christophe


On Sat, Jan 26, 2013 at 7:47 AM, Mark Engelberg wrote:

> I'm working on a program that involves deeply nested data structures.  I'm
> running into numerous problems working with such structures in Clojure.  It
> appears that many of Clojure's core functions involving hashing and
> equality produce stack overflows with deeply nested data structures, making
> it nearly impossible to do anything useful with the large data structures.
> I'd like to have a larger discussion about that, but in this post, I want
> to start out by focusing on a very specific example that seems like an
> easily solvable performance bug.
>
> My understanding is that in the latest version of Clojure, hashes, once
> computed, are cached.  It is also clear that if two objects have different
> hashes, they can't be equal.  So I consider the following exchange to be a
> bug, because it is clear the differing hashes are being ignored:
>
> ; Function to produce deeply nested data structure
> (defn make-list
>   ([n] (make-list n (list "a" "a")))
>   ([n a]
> (if (zero? n) a
>   (recur (dec n) (list "a" a)
>
> (def a (doall (make-list 7000)))
>
> (def b (doall (make-list 8000)))
>
> => (hash a)
> 27780065
> => (hash b)
> 31748065
> => (= a b)
> StackOverflowError   clojure.lang.ASeq.equiv (ASeq.java:39)
> => (pst)
> StackOverflowError
> clojure.lang.ASeq.equiv (ASeq.java:39)
> clojure.lang.Util.pcequiv (Util.java:79)
> clojure.lang.Util.equiv (Util.java:31)
> clojure.lang.ASeq.equiv (ASeq.java:42)
> clojure.lang.Util.pcequiv (Util.java:79)
> clojure.lang.Util.equiv (Util.java:31)
> clojure.lang.ASeq.equiv (ASeq.java:42)
> clojure.lang.Util.pcequiv (Util.java:79)
> clojure.lang.Util.equiv (Util.java:31)
> clojure.lang.ASeq.equiv (ASeq.java:42)
> clojure.lang.Util.pcequiv (Util.java:79)
> clojure.lang.Util.equiv (Util.java:31)
> nil
>
>
> Some thoughts about this:
>
> My guess is that the current behavior is a design decision based on the
> fact that sequences might be infinite, and therefore it isn't necessarily
> safe to call hash on them before comparing the sequences for equality.
> However, if the hash has already been cached, why not use it?
>
> Of course, solving this particular issue won't really solve the overall
> problem:
> (= (make-list 7000) (make-list 7000)) will still cause a stack overflow.
> (hash (make-list 1)) will also cause a stack overflow.
>
> I think to solve the overall problem, both hashing and equality testing
> will need to be rewritten in a way that doesn't grow the stack.
>
> Even though it doesn't solve the overall problem, I still think that
> looking at the cached hash for collection equality would yield meaningful
> performance improvements.
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
>
>



-- 
On Clojure http://clj-me.cgrand.net/
Clojure Programming http://clojurebook.com
Training, Consulting & Contracting http://lambdanext.eu/

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Natively Compiled Clojure

2013-01-25 Thread John Gabriele
On Friday, January 25, 2013 11:28:32 AM UTC-5, tbc++ wrote:
>
> The important question to ask yourself (and I'll cover this in my talk), 
> is why do you want native Clojure?
>
>

  * easy direct access to C libs
  * fast startup time
  * minimal footprint

Well, that's what would attract *me* to a native Clojure, anyway.

---John

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Looking for testimonials and feedback on ClojureWerkz projects

2013-01-25 Thread Jozef Wagner
Guys at Nokia Entertainment use Monger and Elastisch. 
http://skillsmatter.com/podcast/home/clojure-at-nokia-entertainment/te-6422

On Saturday, January 26, 2013 2:55:01 AM UTC+1, Michael Klishin wrote:
>
> We are looking for testimonials and general feedback about
> ClojureWerkz (http://clojurewerkz.org) projects. So if you use
> one of our libraries (Monger, Elastisch, Langohr, Welle, Neocons, 
> anything), please consider telling us a bit about what you use
> it for, what is great and what sucks.
>
> More information on our blog:
>
> http://blog.clojurewerkz.org/blog/2013/01/26/how-do-you-use-clojurewerkz-projects/
>
> Thank you!
> -- 
> MK
>
> http://github.com/michaelklishin
> http://twitter.com/michaelklishin
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




1.5 alpha 5 - performance issues relating to hashing and equals

2013-01-25 Thread Mark Engelberg
I'm working on a program that involves deeply nested data structures.  I'm
running into numerous problems working with such structures in Clojure.  It
appears that many of Clojure's core functions involving hashing and
equality produce stack overflows with deeply nested data structures, making
it nearly impossible to do anything useful with the large data structures.
I'd like to have a larger discussion about that, but in this post, I want
to start out by focusing on a very specific example that seems like an
easily solvable performance bug.

My understanding is that in the latest version of Clojure, hashes, once
computed, are cached.  It is also clear that if two objects have different
hashes, they can't be equal.  So I consider the following exchange to be a
bug, because it is clear the differing hashes are being ignored:

; Function to produce deeply nested data structure
(defn make-list
  ([n] (make-list n (list "a" "a")))
  ([n a]
(if (zero? n) a
  (recur (dec n) (list "a" a)

(def a (doall (make-list 7000)))

(def b (doall (make-list 8000)))

=> (hash a)
27780065
=> (hash b)
31748065
=> (= a b)
StackOverflowError   clojure.lang.ASeq.equiv (ASeq.java:39)
=> (pst)
StackOverflowError
clojure.lang.ASeq.equiv (ASeq.java:39)
clojure.lang.Util.pcequiv (Util.java:79)
clojure.lang.Util.equiv (Util.java:31)
clojure.lang.ASeq.equiv (ASeq.java:42)
clojure.lang.Util.pcequiv (Util.java:79)
clojure.lang.Util.equiv (Util.java:31)
clojure.lang.ASeq.equiv (ASeq.java:42)
clojure.lang.Util.pcequiv (Util.java:79)
clojure.lang.Util.equiv (Util.java:31)
clojure.lang.ASeq.equiv (ASeq.java:42)
clojure.lang.Util.pcequiv (Util.java:79)
clojure.lang.Util.equiv (Util.java:31)
nil


Some thoughts about this:

My guess is that the current behavior is a design decision based on the
fact that sequences might be infinite, and therefore it isn't necessarily
safe to call hash on them before comparing the sequences for equality.
However, if the hash has already been cached, why not use it?

Of course, solving this particular issue won't really solve the overall
problem:
(= (make-list 7000) (make-list 7000)) will still cause a stack overflow.
(hash (make-list 1)) will also cause a stack overflow.

I think to solve the overall problem, both hashing and equality testing
will need to be rewritten in a way that doesn't grow the stack.

Even though it doesn't solve the overall problem, I still think that
looking at the cached hash for collection equality would yield meaningful
performance improvements.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Looking for testimonials and feedback on ClojureWerkz projects

2013-01-25 Thread Devin Walters
Without a doubt the best documented effort in the Clojure community to-date. 
Specifically, my experience with elastisch. Thanks for your work. It's a huge 
step in the right direction.

'(Devin Walters)

On Jan 25, 2013, at 7:55 PM, Michael Klishin  
wrote:

> We are looking for testimonials and general feedback about
> ClojureWerkz (http://clojurewerkz.org) projects. So if you use
> one of our libraries (Monger, Elastisch, Langohr, Welle, Neocons, anything), 
> please consider telling us a bit about what you use
> it for, what is great and what sucks.
> 
> More information on our blog:
> http://blog.clojurewerkz.org/blog/2013/01/26/how-do-you-use-clojurewerkz-projects/
> 
> Thank you!
> -- 
> MK
> 
> http://github.com/michaelklishin
> http://twitter.com/michaelklishin
> -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>  
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: special case in binding vector syntax for function definitions?

2013-01-25 Thread Ben Wolfson
On Fri, Jan 25, 2013 at 5:38 PM, Alan Malloy  wrote:
> In (let [[x :as y] [1 2]]), there is already an object to make y "point to":
> the vector [1 2]. in ((fn [x :as y]) 1 2), there is no such object.

There's no such object for y to be the tail of in ((fn [x & y] y) 1 2
3), either, but the remaining arguments get accumulated in y
regardless. They even get accumulated in a map in ((fn [& {:as m}] m)
:x 1 :y 2).

-- 
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks,
which may be sweet, aromatic, fermented or spirit-based. ... Family
and social life also offer numerous other occasions to consume drinks
for pleasure." [Larousse, "Drink" entry]

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: special case in binding vector syntax for function definitions?

2013-01-25 Thread Alan Malloy
In (let [[x :as y] [1 2]]), there is already an object to make y "point 
to": the vector [1 2]. in ((fn [x :as y]) 1 2), there is no such object.

On Friday, January 25, 2013 2:18:39 PM UTC-8, Ben wrote:
>
> Both of these work: 
>
> user> (let [[x & y] [1 2]] [x y]) 
> [1 (2)] 
> user> (let [[x :as y] [1 2]] [x y]) 
> [1 [1 2]] 
>
> And this works: 
>
> user> ((fn [x & y] [x y]) 1 2) 
> [1 (2)] 
>
> But this gives an exception (unsupported binding form): 
>
> user> ((fn [x :as y] [x y]) 1 2) 
> ; Evaluation aborted. 
>
> I would have expected this to work and return [1 [1 2]], with y bound 
> to the whole vector implicitly passed to the function (just as it's 
> bound to the tail of the whole vector implicitly passed in the third 
> case). 
>
> This seems to happen because (apparently) the internals of fn* handle 
> rest parameters already, so that clojure.core/maybe-destructured 
> doesn't actually need to do anything to top-level elements of the 
> binding vector: 
>
> clojure.core> (maybe-destructured '[a b] ()) 
> ([a b]) 
> clojure.core> (maybe-destructured '[a & b] ()) 
> ([a & b]) 
> clojure.core> (maybe-destructured '[a [b & c]] ()) 
> ([a p__8059] (clojure.core/let [[b & c] p__8059])) 
>
> Since & is a symbol, it's just passed right through and left to fn* to 
> deal with. But :as is not a symbol, so we end up with this: 
>
> clojure.core> (maybe-destructured '[a :as b] ()) 
> ([a p__8064 b] (clojure.core/let [:as p__8064])) 
>
> Is there a reason for this apparent irregularity? 
>
> -- 
> Ben Wolfson 
> "Human kind has used its intelligence to vary the flavour of drinks, 
> which may be sweet, aromatic, fermented or spirit-based. ... Family 
> and social life also offer numerous other occasions to consume drinks 
> for pleasure." [Larousse, "Drink" entry] 
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Building a jdbc WHERE IN clause

2013-01-25 Thread Sean Corfield
On Fri, Jan 25, 2013 at 2:27 PM, Jonathon McKitrick
 wrote:
> (defn get-by-ids-test
>   [ids]
>   (let [qs (string/join "," (repeat (count ids) "?"))
> sql (str "select * from survey where survey_id in (" qs ")")]
> (println "SQL " sql)
> (println "ids" ids)
> (sql/with-connection (get-db-spec)
>   (sql/with-query-results results
> [sql ids]

Try:
(into [sql] ids)

> (into [] results)

The vector should be a SQL string followed by the various parameter
values. You have a SQL string followed by a single item - a sequence
of parameter values.

In the next version of java.jdbc (currently 0.2.4-SNAPSHOT but it will
become 0.3.0), you'll be able to simplify your code to this:

(sql/query (get-db-spec) (into [sql] ids))

and get back a fully realized sequence of maps. If you want a vector instead:

(sql/query (get-db-spec) (into [sql] ids) :resultset-fn vec)

;; the current code has :result-set-fn but that will change since it's
not consistent with the resultset type or resultset-seq function!

Since the question of `where in` comes in fairly often, I will
probably extend the minimal DSL that 0.3.0 will add (in a separate
optional ns) to support that, e.g.,

(sql/query (get-db-spec) (dsl/select * :survey (dsl/where
{:survey_id ids})))

perhaps with dsl/in to make it read better... although I expect you'd
:refer in the symbols you needed to get this:

(query (get-db-spec) (select * :survey (where {:survey_id (in ids)})))

The current thinking is to keep the DSL deliberately small (and
optional) so that other folks can develop richer DSLs that are
compatible with java.jdbc directly (i.e., this is explicitly not
intended to "compete" with Korma - just to make Korma's job easier).
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Java annotations on functions, in conjunction with gen-class?

2013-01-25 Thread Ryan Cole
Yea, I've seen that. It does the plugins a little differently. I did not 
see any examples of function annotations in his Clojure code, though.

Ryan

On Friday, January 25, 2013 5:08:49 PM UTC-6, AtKaaZ wrote:
>
> Hi. Check this out: https://github.com/CmdrDats/clj-minecraft
>
>
> On Fri, Jan 25, 2013 at 11:14 PM, Ryan Cole 
> > wrote:
>
>> Hi all, beginner here,
>>
>> I'm trying to write a Minecraft plugin in Clojure, and use AOT so that 
>> the Minecraft server can load it right up. I've got this much going, and 
>> all as well. The server expect some of my functions in a class that I'm 
>> extending to use an appropriate annotation on the function.
>>
>> How do I add these annotations? I've Googled around and see that it looks 
>> like support for this was added back in 2010, so I'm sure it's possible. 
>> Maybe I've seen the solution but didn't realize that it was a solution. 
>> Clojure still looks pretty alien to me, so crazy things like this are rough 
>> to search for and realize when the answer is in front of me.
>>
>> For example, the Java document for the Minecraft server says that my 
>> function should conform to the following definition:
>>
>> ```
>>
>> @EventHandlerpublic void onPlayerLogin(PlayerLoginEvent event) {
>> // Your code here...}
>>
>> ```
>>
>>
>> I've got the following Clojure code that the server will actually load and 
>> it will call the `onEnable` and `onDisable` function here, but the one that 
>> requires the annotation does not get called.
>>
>>
>> ```
>>
>> (ns com.github.ryancole.bukkit.hello-world
>>   (:import [org.bukkit Bukkit])
>>   (:gen-class :extends org.bukkit.plugin.java.JavaPlugin
>>   :name com.github.ryancole.bukkit.hello-world.Hello
>>   :prefix hello-))
>>
>> (defn hello-onEnable [this]
>>   (.info (.getLogger this) "hello world has been enabled"))
>>
>> (defn hello-onDisable [this]
>>   (.info (.getLogger this) "hello world has been disabled"))
>>
>> (defn hello-onPlayerLogin [this evnt]
>>   (.info (.getLogger this) "player logged in"))
>>
>> ```
>>
>>
>> Any ideas?
>>
>>  -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@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+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>>  
>>  
>>
>
>
>
> -- 
> I may be wrong or incomplete.
> Please express any corrections / additions,
> they are encouraged and appreciated.
> At least one entity is bound to be transformed if you do ;)
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Java annotations on functions, in conjunction with gen-class?

2013-01-25 Thread AtKaaZ
Hi. Check this out: https://github.com/CmdrDats/clj-minecraft


On Fri, Jan 25, 2013 at 11:14 PM, Ryan Cole  wrote:

> Hi all, beginner here,
>
> I'm trying to write a Minecraft plugin in Clojure, and use AOT so that the
> Minecraft server can load it right up. I've got this much going, and all as
> well. The server expect some of my functions in a class that I'm extending
> to use an appropriate annotation on the function.
>
> How do I add these annotations? I've Googled around and see that it looks
> like support for this was added back in 2010, so I'm sure it's possible.
> Maybe I've seen the solution but didn't realize that it was a solution.
> Clojure still looks pretty alien to me, so crazy things like this are rough
> to search for and realize when the answer is in front of me.
>
> For example, the Java document for the Minecraft server says that my
> function should conform to the following definition:
>
> ```
>
> @EventHandlerpublic void onPlayerLogin(PlayerLoginEvent event) {
> // Your code here...}
>
> ```
>
>
> I've got the following Clojure code that the server will actually load and it 
> will call the `onEnable` and `onDisable` function here, but the one that 
> requires the annotation does not get called.
>
>
> ```
>
> (ns com.github.ryancole.bukkit.hello-world
>   (:import [org.bukkit Bukkit])
>   (:gen-class :extends org.bukkit.plugin.java.JavaPlugin
>   :name com.github.ryancole.bukkit.hello-world.Hello
>   :prefix hello-))
>
> (defn hello-onEnable [this]
>   (.info (.getLogger this) "hello world has been enabled"))
>
> (defn hello-onDisable [this]
>   (.info (.getLogger this) "hello world has been disabled"))
>
> (defn hello-onPlayerLogin [this evnt]
>   (.info (.getLogger this) "player logged in"))
>
> ```
>
>
> Any ideas?
>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
>
>



-- 
I may be wrong or incomplete.
Please express any corrections / additions,
they are encouraged and appreciated.
At least one entity is bound to be transformed if you do ;)

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Java annotations on functions, in conjunction with gen-class?

2013-01-25 Thread Ryan Cole
Hi all, beginner here,

I'm trying to write a Minecraft plugin in Clojure, and use AOT so that the 
Minecraft server can load it right up. I've got this much going, and all as 
well. The server expect some of my functions in a class that I'm extending 
to use an appropriate annotation on the function.

How do I add these annotations? I've Googled around and see that it looks 
like support for this was added back in 2010, so I'm sure it's possible. 
Maybe I've seen the solution but didn't realize that it was a solution. 
Clojure still looks pretty alien to me, so crazy things like this are rough 
to search for and realize when the answer is in front of me.

For example, the Java document for the Minecraft server says that my 
function should conform to the following definition:

```

@EventHandlerpublic void onPlayerLogin(PlayerLoginEvent event) {
// Your code here...}

```


I've got the following Clojure code that the server will actually load and it 
will call the `onEnable` and `onDisable` function here, but the one that 
requires the annotation does not get called.


```

(ns com.github.ryancole.bukkit.hello-world
  (:import [org.bukkit Bukkit])
  (:gen-class :extends org.bukkit.plugin.java.JavaPlugin
  :name com.github.ryancole.bukkit.hello-world.Hello
  :prefix hello-))

(defn hello-onEnable [this]
  (.info (.getLogger this) "hello world has been enabled"))

(defn hello-onDisable [this]
  (.info (.getLogger this) "hello world has been disabled"))

(defn hello-onPlayerLogin [this evnt]
  (.info (.getLogger this) "player logged in"))

```


Any ideas?

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




[ANN] Liverpool Clojure talk on LiveStream: Deploying apps on OpenShift

2013-01-25 Thread Simon Holgate
I wouldn't normally announce this on the main list but it may be of 
interest to some since I haven't seen much about Clojure on OpenShift.

We're having short talk from Steven Citron-Pousty 
(@TheSteve0), 
a Developer Advocate for RedHat about deploying Clojure apps on OpenShift (
https://openshift.redhat.com/app/) prior to the Clojure Dojo on 29th 
January at DoES Liverpool (http://doesliverpool.com/).

Steve's talk will be on LiveStream. You can watch it here: 
http://
bit.ly/Vnd4QS 

If you're local there are more Dojo details and sign up at:
http://lanyrd.com/2013/geekup/

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Building a jdbc WHERE IN clause

2013-01-25 Thread Jonathon McKitrick
I saw a post some time ago answering this question, and here are three 
solutions.  I thought the first would be the most elegant.  But for some 
reason, the first does not work, and returns an empty set.  I'm trying to 
understand what's wrong with it.

(defn get-by-ids-test
  [ids]
  (let [qs (string/join "," (repeat (count ids) "?"))
sql (str "select * from survey where survey_id in (" qs ")")]
(println "SQL " sql)
(println "ids" ids)
(sql/with-connection (get-db-spec)
  (sql/with-query-results results
[sql ids]
(into [] results)

(defn get-by-ids-test-2
  [ids]
  (sql/with-connection (get-db-spec)
(sql/with-query-results results
  [(str "select * from survey where survey_id in (" (apply str 
(interpose \, ids)) ")")]
  (into [] results

(defn get-by-ids-test-3
  [ids]
  (sql/with-connection (get-db-spec)
(sql/with-query-results results
  [(str "select * from survey where survey_id in (" (string/join "," 
ids)  ")")]
  (into [] results

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




special case in binding vector syntax for function definitions?

2013-01-25 Thread Ben Wolfson
Both of these work:

user> (let [[x & y] [1 2]] [x y])
[1 (2)]
user> (let [[x :as y] [1 2]] [x y])
[1 [1 2]]

And this works:

user> ((fn [x & y] [x y]) 1 2)
[1 (2)]

But this gives an exception (unsupported binding form):

user> ((fn [x :as y] [x y]) 1 2)
; Evaluation aborted.

I would have expected this to work and return [1 [1 2]], with y bound
to the whole vector implicitly passed to the function (just as it's
bound to the tail of the whole vector implicitly passed in the third
case).

This seems to happen because (apparently) the internals of fn* handle
rest parameters already, so that clojure.core/maybe-destructured
doesn't actually need to do anything to top-level elements of the
binding vector:

clojure.core> (maybe-destructured '[a b] ())
([a b])
clojure.core> (maybe-destructured '[a & b] ())
([a & b])
clojure.core> (maybe-destructured '[a [b & c]] ())
([a p__8059] (clojure.core/let [[b & c] p__8059]))

Since & is a symbol, it's just passed right through and left to fn* to
deal with. But :as is not a symbol, so we end up with this:

clojure.core> (maybe-destructured '[a :as b] ())
([a p__8064 b] (clojure.core/let [:as p__8064]))

Is there a reason for this apparent irregularity?

-- 
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks,
which may be sweet, aromatic, fermented or spirit-based. ... Family
and social life also offer numerous other occasions to consume drinks
for pleasure." [Larousse, "Drink" entry]

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: fressian

2013-01-25 Thread Brent Millare
Ok, well I bit the bullet and figured out how to add vectors myself.

See the results here:

https://github.com/bmillare/dj.fressian

On Monday, January 21, 2013 6:26:48 PM UTC-5, Brent Millare wrote:
>
> Has anyone checked out fressian, the binary serialization/deserialization 
> used by datomic?
>
> https://github.com/Datomic/fressian
>
> I want to use it for clojure data but I don't think the handler list is 
> complete at the moment. Anyone have more fleshed out handlers, such as 
> vectors? Currently they get normalized to arraylists.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: what does "is" expect in tests?

2013-01-25 Thread Sean Corfield
I tested code very similar to yours and the only way I could get it to
fail like that was if first-question was nil.

Change (println (apply str first-question)) to (println
"first-question" first-question) to see what value it really has. I
think you'll see nil there...

Sean

On Fri, Jan 25, 2013 at 12:01 PM, larry google groups
 wrote:
> I thought this test would assure me that my test data contains at least one
> question:
>
> (deftest is-there-at-least-one-question
>   (testing "We want to see if there is at least one question in memory.]"
> (let [first-question  (get-in @um/interactions [:questions])]
>   (println (apply str first-question))
>   (is (not (nil? first-question))
>
> but I run "lein test" and I get:
>
>
> FAIL in (is-there-at-least-one-question) (core_test.clj:16)
> We want to see if there is at least one question in memory.]
> expected: (not (nil? first-question))
>   actual: (not (not true))
>
> I know there is a map full of questions at interactions[:questions], so why
> does the test fail, and why is first-question rendered as true, when I know
> it is a map?

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




what does "is" expect in tests?

2013-01-25 Thread larry google groups
I thought this test would assure me that my test data contains at least one 
question:

(deftest is-there-at-least-one-question
  (testing "We want to see if there is at least one question in memory.]"
(let [first-question  (get-in @um/interactions [:questions])]
  (println (apply str first-question))
  (is (not (nil? first-question))

but I run "lein test" and I get: 


FAIL in (is-there-at-least-one-question) (core_test.clj:16)
We want to see if there is at least one question in memory.]
expected: (not (nil? first-question))
  actual: (not (not true))

I know there is a map full of questions at interactions[:questions], so why 
does the test fail, and why is first-question rendered as true, when I know 
it is a map?


-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: CollReduce and IKVReduce for nil?

2013-01-25 Thread Andy Fingerhut
CLJ-1098 fix committed to Clojure master today as part of 1.5.0-RC3:

http://build.clojure.org/job/clojure/changes

Andy

On Jan 14, 2013, at 4:24 AM, Wolodja Wentland wrote:

> On Sat, Jan 12, 2013 at 08:15 -0800, Andy Fingerhut wrote:
>> The CLJ-1098 ticket was categorized as a minor enhancement when it was
>> created.  Defects (i.e. bugs) are considered with higher priority.
> 
> I can see that this categorisation caused this bug to be prioritised lower
> than actual bugs that break documented (or previous) behaviour. I also think
> that the categorisation is correct as the proposed change does, in fact,
> constitute an enhancement of the /current/ behaviour.
> 
> The fact that this bug is an enhancement of the current behaviour as found
> for IKVReduce in the current stable releases and for CollFold in the current
> release candidates does, however, not mean that fixing it is not important, as
> the current behaviour is just unintuitive and not in line with the behaviour
> of nil in the context of other functions such as reduce.
> 
> I consider the "decision" to special case nil for reduce-kv and, soon, for
> the reducers library a poor one. Fixing this oversight is very easy right now
> and should be done as soon as possible and in particular before we find
> libraries littered with (nil? coll).
> 
>> Also Clojure 1.5.0 is nearing release [1], and pretty much any software must
>> reduce its rate of changes near release so more testing can be done on a
>> single version (or at most a few versions with minimal changes between them,
>> if problems are found).
> 
> Introducing reduce-kv was an important part of the 1.4 release and the
> reducers library will be even more important for 1.5 and it should be a
> priority that these two integrate well into the Clojure ecosystem and behave
> in line with our expectations. The reducers library is even advertised as a
> drop-in for existing codebases, but the implementation right now does not live
> up to that and requires authors to special case nil, which is simply ugly.
> 
>> If your concern is that it isn't being committed as fast as you would like
>> it to, you have joined a new club.   Welcome. :-)  Until that ticket is
>> considered and applied or rejected, you may create your own patched version
>> of Clojure, and if you wish even distribute it under the Eclipse Public
>> License, but those approaches might not suit your purposes.
> 
> Well, I am sure that many people have their particular bug they would like to
> see fixed, but I think it is a bad idea to /not/ fix this bug in 1.5 as the
> reducers library violates expectations as it is now. One also does not /have/
> to see the patch as an atomic one and I guess implementing only CollFold for
> nil is an improvement over the status quo if doing so for IKVReduce is not
> wanted (for whatever reason).
> 
> I was simply curious about why this has not been done in the first place and I
> still do not see a good reason for doing so. I guess the main point I am
> trying to make here is: Better fix it now before maintaining historic
> behaviour/naming (such as the contains?-wart) becomes the only argument for
> not applying the (very simple) patch.
> 
> If it is too late, then it is too late … but then I still don't understand
> this design decision.
> -- 
> Wolodja 
> 
> 4096R/CAF14EFC
> 081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




AW: When using gradle with the clojuresque plugin I'm getting a"Plugin with id 'clojure' not found." error

2013-01-25 Thread Meikel Brandmeyer
Hi,

quick guess: Pull buildscript out of the subproject.

Meikel

Durch MOTOBLUR™ verbunden

-Ursprüngliche Nachricht-
Von: john 
An: clojure@googlegroups.com
Gesendet: Fr, 25 Jan 2013, 14:20:14 MEZ
Betreff: When using gradle with the clojuresque plugin I'm getting a"Plugin 
with id 'clojure' not found." error

Hi,
this is my first day with gradle. 

I'm running :
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.4 comiled on May 22 2012
Ivy: 2.2.0
JVM: 1.7.0_11 (Oracle Corporation 23.6-b04)
OS: Mac OS X 10.7.5 x86_6

I have the following project layout

project/server
project/client
project/domain

project/settings.gradle looks like:
include 'domain', 'server', 'client'

project/build.gradle looks like:

project(':domain') {

   buildscript {
repositories {
mavenRepo name: 'clojars', url: 'http://clojars.org/repo'
}
dependencies {
classpath 'clojuresque:clojuresque:1.5.5'
}
  }

  apply plugin: 'clojure'
}
project(':server') {
apply plugin: 'groovy'
}
project(':client') {
apply plugin: 'groovy'
}

So I have a multiproject with one clojure and 2 groovy projects:

When I run gradle build I get the error : Plugin with id 'clojure' not 
found.

I have guess my build.gradle is faulty. Can somebody help?

Many Greetings
John




-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en



-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Clojure runtime fails to initialize in some contexts

2013-01-25 Thread AtKaaZ
I've also seen a case of that(context classloader changing so that calling
clojure will work) here [1], if anyone's into Minecraft bukkit server tests
this would be somewhat easy to understand if you can test it:

[1] -
https://github.com/CmdrDats/clj-minecraft/blob/master/javasrc/cljminecraft/ClojurePlugin.java
and the sister file:
https://github.com/CmdrDats/clj-minecraft/blob/master/javasrc/cljminecraft/BasePlugin.java




On Fri, Jan 25, 2013 at 3:37 PM, Francesco Bellomi <
francesco.bell...@gmail.com> wrote:

> I've solved my specific instance of this problem, I post here the details
> in the hope that the solution has a more general validity.
>
> It seems that clojure.lang.RT gets confused when it is initialized (ie.
>  is called) and the classloader used to load the class itself is
> different from the current thread's context classloader.
>
> If I do:
>
> Thread.currentThread().**setContextClassLoader(this.**
> getClass.getClassLoader)
>
> just before making the call that cause Clojure runtime to be loaded and
> initialized, the error disappears.
>
> Francesco
>
>
>
>
> On Thursday, January 24, 2013 2:44:21 PM UTC+1, Francesco Bellomi wrote:
>>
>> (I repost this message because the original post I made yesterday seems
>> to have been rejected by googlegroups -- I have not received it and it is
>> not available online.
>> Sorry if this will result in a double post for some users.)
>>
>> Hi all,
>>
>> I'm writing a Scala library (currently alpha) to simplify the use of
>> Datomic (http://www.datomic.com) from Scala:
>> https://github.com/fbellomi/**da**tomic-scala
>>
>> I would like to make use of Scala compile-time macros in order to
>> statically type-check Datomic queries against a live database schema.
>> I need to call Datomic API from within the Scala compiler's macro
>> expansion stage, but it turns out that Clojure runtime fails to initialize
>> within that stage.
>>
>> A simple evaluation such as:
>>
>> clojure.lang.RT.T
>>
>> works fine from Scala's REPL, but fails from within Scala compiler, with
>> the following exception
>>
>> error: exception during macro expansion:
>> java.lang.**IllegalStateExceptio**n: Attempting to call unbound fn:
>> #'clojure.core/refer
>> at clojure.lang.Var$Unbound.**throw**Arity(Var.java:43)
>> at clojure.lang.AFn.invoke(AFn.**ja**va:39)
>> at clojure.lang.Var.invoke(Var.**ja**va:415)
>> at clojure.lang.RT.doInit(RT.**java**:449)
>> at clojure.lang.RT.(RT.**ja**va:318)
>> at .foo_impl(:8)
>>
>> Not only the classpath, but also the thread context ClassLoader is the
>> same in both cases.
>>
>> I posted the details here:
>> https://groups.google.com/**forum/?hl=en&fromgroups=#!**
>> topic/scala-user/Bh_YmI6e-wY
>>
>> One could argue that this seems to be more of a Scala issue, but I did a
>> search and it turns out that there are other similar situations where the
>> Clojure runtime fails to initialize with the same error:
>>
>> - from within a Nutch plugin:
>> https://groups.google.com/**forum/?hl=en&fromgroups=#!**
>> searchin/clojure/nutch$**20plugin/clojure/Fbqrk1T8SRg/**CbQDd1yBvjYJ
>>
>> - trying to deploy an EJB
>> https://groups.google.com/**forum/?hl=en&fromgroups=#!**
>> searchin/clojure/ejb/clojure/**FFe7Pf9TfXc/rxmYq6IoIjMJ
>>
>> - naming your project "clojure" in lein
>> http://osdir.com/ml/java-**clojure-user/2012-04/msg00913.**html
>>
>>
>> To further investigate my case, I tried to force the startup from
>> core.clj rather than from the precompiled classes.
>> Also in this case, the same call from the Scala repl works fine, whereas
>> the call from within the Scala macro expansion fails, with this:
>>
>> ava.lang.ClassCastException: clojure.core$fn cannot be cast to
>> clojure.lang.IFn, compiling:(clojure/core.clj:**55)
>> at clojure.lang.Compiler.**analyzeSeq(Compiler.java:6462)
>> at clojure.lang.Compiler.analyze(**Compiler.java:6262)
>> at clojure.lang.Compiler.access$**100(Compiler.java:37)
>> at clojure.lang.Compiler$DefExpr$**Parser.parse(Compiler.java:**518)
>> at clojure.lang.Compiler.**analyzeSeq(Compiler.java:6455)
>> at clojure.lang.Compiler.analyze(**Compiler.java:6262)
>> at clojure.lang.Compiler.analyze(**Compiler.java:6223)
>> at clojure.lang.Compiler.eval(**Compiler.java:6515)
>> at clojure.lang.Compiler.load(**Compiler.java:6952)
>> at clojure.lang.RT.**loadResourceScript(RT.java:**359)
>> at clojure.lang.RT.**loadResourceScript(RT.java:**350)
>> at clojure.lang.RT.load(RT.java:**429)
>> at clojure.lang.RT.load(RT.java:**400)
>> at clojure.lang.RT.doInit(RT.**java:436)
>> at clojure.lang.RT.(RT.**java:318)
>> at .foo_impl(:8)
>

Re: Help with Clojurescript + DOM Manipulation

2013-01-25 Thread Jordan Berg
You use this-as:

(this-as thisname
  (whatever thisname))

where you name this what you want with thisname

Cheers


On Fri, Jan 25, 2013 at 1:46 PM, Ari  wrote:

> Additionally, ".each()" is another option --
>
> (defn listen-to-links
>   [links]
>   (.each links
>  (fn [idx, el]
>(.log js/console el
>
> However, how does one reference "this" within the anonymous (or defined)
> function?
>
> On Wednesday, January 23, 2013 11:45:13 PM UTC-5, Evan Mezeske wrote:
>>
>> Oops, I should never type code straight into an email window, without
>> REPLing it first...  X_X
>>
>> I left in the "links" argument to map.  This is probably closer to what I
>> meant:
>>
>> (defn listen-to
>>   [links]
>>   (doseq [link links]
>> (.log js/console link)))
>>
>> On Wednesday, January 23, 2013 8:39:51 PM UTC-8, Evan Mezeske wrote:
>>>
>>> When you want to iterate over things and perform a side-effecty action
>>> for each one (logging is a side effect, as would be adding event listeners
>>> to DOM nodes, changing CSS classes, etc), doseq is usually the clearest
>>> thing to do:
>>>
>>> (defn listen-to
>>>   [links]
>>>   (doseq [link links]
>>> (.log js/console link) links))
>>>
>>> You almost never want to use map for side effects.  A good rule of thumb
>>> is that if you don't use the return value from map, you probably want doseq
>>> instead.
>>>
>>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Help with Clojurescript + DOM Manipulation

2013-01-25 Thread Ari
Additionally, ".each()" is another option --

(defn listen-to-links
  [links]
  (.each links
 (fn [idx, el]
   (.log js/console el

However, how does one reference "this" within the anonymous (or defined) 
function?

On Wednesday, January 23, 2013 11:45:13 PM UTC-5, Evan Mezeske wrote:
>
> Oops, I should never type code straight into an email window, without 
> REPLing it first...  X_X
>
> I left in the "links" argument to map.  This is probably closer to what I 
> meant:
>
> (defn listen-to
>   [links]
>   (doseq [link links]
> (.log js/console link)))
>
> On Wednesday, January 23, 2013 8:39:51 PM UTC-8, Evan Mezeske wrote:
>>
>> When you want to iterate over things and perform a side-effecty action 
>> for each one (logging is a side effect, as would be adding event listeners 
>> to DOM nodes, changing CSS classes, etc), doseq is usually the clearest 
>> thing to do:
>>
>> (defn listen-to
>>   [links]
>>   (doseq [link links]
>> (.log js/console link) links))
>>
>> You almost never want to use map for side effects.  A good rule of thumb 
>> is that if you don't use the return value from map, you probably want doseq 
>> instead.
>>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Installing Clojure on Windows 7

2013-01-25 Thread Phil Hagelberg

sampson.jo...@googlemail.com writes:

> I have tried clojure-mode, creating .emacs.d in Emacs-24.2 - it complained 
> that there is no emacs_24.2/.emacs.d (note the underscore) and proceeded to 
> create one. However, the material I pasted from blogs had fatal errors in 
> it.

Most of what you read on blogs is either wrong from the beginning or
wrong by the time you actually read it; the official documentation
should always be your starting point. However, in this case
clojure-doc.org has an overview that is wider in scope than the
documentation for any individual package:

http://clojure-doc.org/articles/tutorials/emacs.html

However, very few contributors are familiar with Windows. If you find
the fix for the problem you encountered, please consider improving the
documentation.

-Phil

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Clojure on heroku throws exception today

2013-01-25 Thread Phil Hagelberg

Jonathon McKitrick writes:

> I just tried again, with and without trampoline, and now I'm getting this:

Sorry about this; there was a bug that was affected by the networking
limitations on dynos. I've pushed out a fix now.

-Phil

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Call for volunteers to help moderate a ClojureScript Google group

2013-01-25 Thread Wes Freeman
Thanks for educating me about tags--didn't know it would work like that.

On Fri, Jan 25, 2013 at 8:40 AM, Michael Wood  wrote:

> On 25 January 2013 13:47, Wes Freeman  wrote:
>
>> I don't tend to filter emails, but just like to go through my inbox and
>> judge based on topic and subject whether I'd like to take a closer look
>> before archiving. I'm in too many groups to want to go through filters one
>> at a time, and currently there a handful that don't have subject markers,
>> so unless something obviously Clojure-related is in the subject, I have to
>> dig deeper to know that it's actually about Clojure. If you guys don't want
>> to do it, I'm fine with continued suffering (I guess I'm a minority)--just
>> throwing the idea out there.
>>
>> Thanks for doing it in the ClojureScript group, by the way. :)
>>
>
> You have a gmail account.  You can set up filters to tag the e-mails.  It
> does not mean you have to "go through filters one at a time".  Your mail
> can still all be in your inbox and the tags will be to the left of the
> subject.
>
> Anybody who wants to separate the mail into separate folders (virtual or
> otherwise) can do so without cluttering the subject.  People who read mail
> on devices with small screens can get a bit extra space for the actual
> subject instead of having "[Clojurescript] " taking up large chunk of it.
>
> Anyway, I don't feel strongly enough about it to try to get the
> Clojurescript list changed.
>
>
>>  Wes
>>
>> On Thu, Jan 24, 2013 at 8:59 AM, Wolodja Wentland wrote:
>>
>>> On Thu, Jan 24, 2013 at 01:50 -0500, Wes Freeman wrote:
>>> > This is great. Can you guys put [ClojureScript] in the email subject
>>> like most
>>> > google groups do? Wouldn't mind if they put [Clojure] in the clojure
>>> emails,
>>> > either.
>>>
>>> Just curious: But why would you want that? I would happily live without
>>> that
>>> as it reduces line-noise and leaves more room for important information
>>> such
>>> as the actual subject. It is not necessary to filter mails (just filter
>>> on
>>> List-I[dD]) either, so I'd be curious why you would prefer it :)
>>> --
>>> Wolodja 
>>>
>>
> --
> Michael Wood 
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Clojure web server benchmarks

2013-01-25 Thread Feng Shen
Hey, thanks for point out latency, I haven't look at them deeply.  Here is 
how http-kit compare to Nginx when concurrency is 96:  

Server Software:http-kit
Server Hostname:127.0.0.1
Server Port:8087

Document Path:  /
Document Length:1163 bytes

Concurrency Level:  96
Time taken for tests:   2.858 seconds
Complete requests:  12
Failed requests:0
Write errors:   0
Keep-Alive requests:12
Total transferred:  15696 bytes
HTML transferred:   13956 bytes
Requests per second:41981.59 [#/sec] (mean)
Time per request:   2.287 [ms] (mean)
Time per request:   0.024 [ms] (mean, across all concurrent requests)
Transfer rate:  53624.92 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.1  0   4
Processing: 12   0.7  2   7
Waiting:12   0.7  2   7
Total:  12   0.7  2   7

*Percentage of the requests served within a certain time (ms)*
*  50%  2*
*  66%  2*
*  75%  2*
*  80%  2*
*  90%  3*
*  95%  4*
*  98%  5*
*  99%  5*

* 100% 7 (longest request) *


Server Software:nginx
Server Hostname:127.0.0.1
Server Port:8081

Document Path:  /
Document Length:1163 bytes

Concurrency Level:  96
Time taken for tests:   3.492 seconds
Complete requests:  12
Failed requests:0
Write errors:   0
Keep-Alive requests:118844
Total transferred:  164754220 bytes
HTML transferred:   13956 bytes
Requests per second:34365.55 [#/sec] (mean)
Time per request:   2.793 [ms] (mean)
Time per request:   0.029 [ms] (mean, across all concurrent requests)
Transfer rate:  46076.41 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.1  0   4
Processing: 03   2.2  2  23
Waiting:03   2.2  2  23
Total:  03   2.2  2  23

*Percentage of the requests served within a certain time (ms)*
*  50%  2*
*  66%  3*
*  75%  4*
*  80%  5*
*  90%  6*
*  95%  7*
*  98%  9*
*  99%  9*
* 100% 23 (longest request)*


btw, I am the author of http-kit :  
https://github.com/shenfeng/http-kit . http-kit was written from scratch 
for performance.  Clojure web application can be very fast, as fast as 
Nginx can do. Clojure web application can handle high concurrency as Nginx 
can do too.


On Friday, January 25, 2013 8:14:07 PM UTC+8, hutch wrote:
>
>
> On 2013-01-25, at 6:24 AM, Peter Taoussanis > 
> wrote:
>
> I'd consider adding a graph if folks think these numbers are sufficiently 
> interesting?
>
>
> That would be great! This is very important information for me. And, 
> unless things have improved markedly over that last year or so (I hope so), 
> I think you'll be 'amused' by what you see.
>
> Cheers,
> Bob
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Natively Compiled Clojure

2013-01-25 Thread Timothy Baldridge
The important question to ask yourself (and I'll cover this in my talk), is
why do you want native Clojure?

A native implementation of Clojure will fail to deliver on several fronts:

Interop with systems - Java has one of the biggest ecosystems on the planet

Performance - The JVM JIT and GC are really the best that the world has to
offer. Beating them in the general use case is very, very hard.

However, a native clojure implementation could succeed on a few other
fronts:

Deterministic behavior - The JVM JIT/GC are not very deterministic, and are
hard to reason about. In this area they trade off simplicity for
performance. 99% of the time that is what you want. But perhaps in some
cases you would like different behavior.

Embedding in applications - Python is used very often as a scripting
language in 3d apps, games, mapping software, etc. I've yet to hear of the
JVM ever being used for this.

Systems where the JVM isn't available/allowed - think iOS

So while I think there is a use for a non JVM/JS implementation of Clojure,
the use cases are much smaller than many think.

I've gotten a bit sidetracked on the more general topic of generating
native code via Clojure and LLVM lately, so while my talk will show some
basic Clojure code running in the Python VM via LLVM, it will also cover
the more broad concept of leveraging LLVM directly from Clojure on the JVM.

The latter is a prerequisite to the former, so the library I'll be
showcasing can be used for generating code for either situation. Should be
fun times for all!

Timothy





On Fri, Jan 25, 2013 at 9:08 AM, Tony Pitluga wrote:

> There are a couple projects that might be worth looking at although it
> seems both have not been updated in a few months.
>
> ClojureC: https://github.com/schani/clojurec
> Clojure-Scheme: https://github.com/takeoutweight/clojure-scheme
>
>
> On Fri, Jan 25, 2013 at 10:35 AM, Nahuel Greco  wrote:
>
>> Check the clojure-py2 project, they plan to use LLVM to generate native
>> modules (as C compiled) for Python. When that objective is reached probably
>> you will have almost all the machinery to compile python-less native
>> binaries:
>>
>> http://lanyrd.com/2013/clojurewest/sccgmm/
>>
>>
>> Saludos,
>> Nahuel Greco.
>>
>>
>> On Fri, Jan 25, 2013 at 12:18 PM, Marko Kocić  wrote:
>>
>>>
>>>
>>> On Friday, January 25, 2013 6:12:07 AM UTC+1, Mikera wrote:

 A natively compiled Clojure would be very very interesting (perhaps
 targeting LLVM?)

 However it would also be very hard to implement. Clojure depends on a
 lot of features provided by the JVM (JIT compilation, interop with Java
 libraries, garbage collection being the most significant ones). It would be
 very hard to reimplement all of these from the ground up. The JVM is
 already a very good host platform, why fix something that isn't broken?

>>>
>>> What about native ClojuresScript? It doesn't have to implement
>>> everything Clojure have already, and many people could consider it good
>>> enough alternative to Clojure. I could personally live without runtime
>>> macros and eval if it would gain me small and performant native executable.
>>>
>>>
 Arguably the effort would be better spend improving the JVM with extra
 features that would help Clojure (e.g. TCO).

 On Tuesday, 22 January 2013 00:29:54 UTC+8, octopusgrabbus wrote:
>
> I use Clojure primarily as a very reliable tool to aid in data
> transformations, that is taking data in one application's database and
> transforming it into the format needed for another applications' database.
>
> So, my question is would a natively compiled Clojure make sense or
> turn the language into something that was not intended? In almost all
> instances I have not found a problem with Clojure's execution speed so my
> question is not about pro or anti Java.
>
> Thanks.
>
 --
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>>
>>>
>>>
>>
>>  --
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>>
>>
>>
>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send ema

Re: Natively Compiled Clojure

2013-01-25 Thread Tony Pitluga
There are a couple projects that might be worth looking at although it
seems both have not been updated in a few months.

ClojureC: https://github.com/schani/clojurec
Clojure-Scheme: https://github.com/takeoutweight/clojure-scheme


On Fri, Jan 25, 2013 at 10:35 AM, Nahuel Greco  wrote:

> Check the clojure-py2 project, they plan to use LLVM to generate native
> modules (as C compiled) for Python. When that objective is reached probably
> you will have almost all the machinery to compile python-less native
> binaries:
>
> http://lanyrd.com/2013/clojurewest/sccgmm/
>
>
> Saludos,
> Nahuel Greco.
>
>
> On Fri, Jan 25, 2013 at 12:18 PM, Marko Kocić  wrote:
>
>>
>>
>> On Friday, January 25, 2013 6:12:07 AM UTC+1, Mikera wrote:
>>>
>>> A natively compiled Clojure would be very very interesting (perhaps
>>> targeting LLVM?)
>>>
>>> However it would also be very hard to implement. Clojure depends on a
>>> lot of features provided by the JVM (JIT compilation, interop with Java
>>> libraries, garbage collection being the most significant ones). It would be
>>> very hard to reimplement all of these from the ground up. The JVM is
>>> already a very good host platform, why fix something that isn't broken?
>>>
>>
>> What about native ClojuresScript? It doesn't have to implement everything
>> Clojure have already, and many people could consider it good enough
>> alternative to Clojure. I could personally live without runtime macros and
>> eval if it would gain me small and performant native executable.
>>
>>
>>> Arguably the effort would be better spend improving the JVM with extra
>>> features that would help Clojure (e.g. TCO).
>>>
>>> On Tuesday, 22 January 2013 00:29:54 UTC+8, octopusgrabbus wrote:

 I use Clojure primarily as a very reliable tool to aid in data
 transformations, that is taking data in one application's database and
 transforming it into the format needed for another applications' database.

 So, my question is would a natively compiled Clojure make sense or turn
 the language into something that was not intended? In almost all instances
 I have not found a problem with Clojure's execution speed so my question is
 not about pro or anti Java.

 Thanks.

>>> --
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>>
>>
>>
>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: [ANN] Finger trees in Clojurescript

2013-01-25 Thread Jozef Wagner
New version of finger trees is released at 
https://github.com/wagjo/data.cljs . It is much faster and uses transients 
internally, where appropriate.

Moreover, this release provides functions for all kinds of data structures. 
Notable 
functionalities include:

   - fast eager variants of map and map-indexed
   - fast variants of reduce and reduce-kv
   - reduce-reverse and reduce-kv-reverse

This library is not very idiomatic though, as it provides more than a 
minimal set of functions and there may be redundancies  The choice of 
naming stuff departs from the style used in clojure.core. However, I've 
tried to put some order into the naming things, as IMO clojure.core is 
becoming a bit messy with specialized functions for individual data 
structures (alength, subvec, )

JW

On Friday, April 20, 2012 12:17:31 PM UTC+2, Jozef Wagner wrote:
>
> I've ported finger trees from Chouser's 
> https://github.com/clojure/data.finger-tree to the Clojurescript
>
> You can find them at https://github.com/wagjo/ftree
>
> With finger tree, one can make a persistent collection with amortized 
> constant time access to elements and O(log n) append and split 
> (insert/remove).
>
> Jozef Wagner
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Natively Compiled Clojure

2013-01-25 Thread Nahuel Greco
Check the clojure-py2 project, they plan to use LLVM to generate native
modules (as C compiled) for Python. When that objective is reached probably
you will have almost all the machinery to compile python-less native
binaries:

http://lanyrd.com/2013/clojurewest/sccgmm/


Saludos,
Nahuel Greco.


On Fri, Jan 25, 2013 at 12:18 PM, Marko Kocić  wrote:

>
>
> On Friday, January 25, 2013 6:12:07 AM UTC+1, Mikera wrote:
>>
>> A natively compiled Clojure would be very very interesting (perhaps
>> targeting LLVM?)
>>
>> However it would also be very hard to implement. Clojure depends on a lot
>> of features provided by the JVM (JIT compilation, interop with Java
>> libraries, garbage collection being the most significant ones). It would be
>> very hard to reimplement all of these from the ground up. The JVM is
>> already a very good host platform, why fix something that isn't broken?
>>
>
> What about native ClojuresScript? It doesn't have to implement everything
> Clojure have already, and many people could consider it good enough
> alternative to Clojure. I could personally live without runtime macros and
> eval if it would gain me small and performant native executable.
>
>
>> Arguably the effort would be better spend improving the JVM with extra
>> features that would help Clojure (e.g. TCO).
>>
>> On Tuesday, 22 January 2013 00:29:54 UTC+8, octopusgrabbus wrote:
>>>
>>> I use Clojure primarily as a very reliable tool to aid in data
>>> transformations, that is taking data in one application's database and
>>> transforming it into the format needed for another applications' database.
>>>
>>> So, my question is would a natively compiled Clojure make sense or turn
>>> the language into something that was not intended? In almost all instances
>>> I have not found a problem with Clojure's execution speed so my question is
>>> not about pro or anti Java.
>>>
>>> Thanks.
>>>
>> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Natively Compiled Clojure

2013-01-25 Thread Marko Kocić


On Friday, January 25, 2013 6:12:07 AM UTC+1, Mikera wrote:
>
> A natively compiled Clojure would be very very interesting (perhaps 
> targeting LLVM?)
>
> However it would also be very hard to implement. Clojure depends on a lot 
> of features provided by the JVM (JIT compilation, interop with Java 
> libraries, garbage collection being the most significant ones). It would be 
> very hard to reimplement all of these from the ground up. The JVM is 
> already a very good host platform, why fix something that isn't broken?
>

What about native ClojuresScript? It doesn't have to implement everything 
Clojure have already, and many people could consider it good enough 
alternative to Clojure. I could personally live without runtime macros and 
eval if it would gain me small and performant native executable. 
 

> Arguably the effort would be better spend improving the JVM with extra 
> features that would help Clojure (e.g. TCO). 
>
> On Tuesday, 22 January 2013 00:29:54 UTC+8, octopusgrabbus wrote:
>>
>> I use Clojure primarily as a very reliable tool to aid in data 
>> transformations, that is taking data in one application's database and 
>> transforming it into the format needed for another applications' database.
>>
>> So, my question is would a natively compiled Clojure make sense or turn 
>> the language into something that was not intended? In almost all instances 
>> I have not found a problem with Clojure's execution speed so my question is 
>> not about pro or anti Java.
>>
>> Thanks.
>>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Clojure runtime fails to initialize in some contexts

2013-01-25 Thread Francesco Bellomi
I've solved my specific instance of this problem, I post here the details 
in the hope that the solution has a more general validity.

It seems that clojure.lang.RT gets confused when it is initialized (ie. 
 is called) and the classloader used to load the class itself is 
different from the current thread's context classloader.

If I do:

Thread.currentThread().setContextClassLoader(this.getClass.getClassLoader)

just before making the call that cause Clojure runtime to be loaded and 
initialized, the error disappears.

Francesco




On Thursday, January 24, 2013 2:44:21 PM UTC+1, Francesco Bellomi wrote:
>
> (I repost this message because the original post I made yesterday seems to 
> have been rejected by googlegroups -- I have not received it and it is not 
> available online.
> Sorry if this will result in a double post for some users.)
>
> Hi all,
>
> I'm writing a Scala library (currently alpha) to simplify the use of 
> Datomic (http://www.datomic.com) from Scala:
> https://github.com/fbellomi/**datomic-scala
>
> I would like to make use of Scala compile-time macros in order to 
> statically type-check Datomic queries against a live database schema.
> I need to call Datomic API from within the Scala compiler's macro 
> expansion stage, but it turns out that Clojure runtime fails to initialize 
> within that stage.
>
> A simple evaluation such as:
>
> clojure.lang.RT.T
>
> works fine from Scala's REPL, but fails from within Scala compiler, with 
> the following exception
>
> error: exception during macro expansion: 
> java.lang.**IllegalStateException: Attempting to call unbound fn: 
> #'clojure.core/refer
> at clojure.lang.Var$Unbound.**throwArity(Var.java:43)
> at clojure.lang.AFn.invoke(AFn.**java:39)
> at clojure.lang.Var.invoke(Var.**java:415)
> at clojure.lang.RT.doInit(RT.**java:449)
> at clojure.lang.RT.(RT.**java:318)
> at .foo_impl(:8)
>
> Not only the classpath, but also the thread context ClassLoader is the 
> same in both cases.
>
> I posted the details here:
>
> https://groups.google.com/forum/?hl=en&fromgroups=#!topic/scala-user/Bh_YmI6e-wY
>
> One could argue that this seems to be more of a Scala issue, but I did a 
> search and it turns out that there are other similar situations where the 
> Clojure runtime fails to initialize with the same error:
>
> - from within a Nutch plugin:
>
> https://groups.google.com/forum/?hl=en&fromgroups=#!searchin/clojure/nutch$20plugin/clojure/Fbqrk1T8SRg/CbQDd1yBvjYJ
>
> - trying to deploy an EJB
>
> https://groups.google.com/forum/?hl=en&fromgroups=#!searchin/clojure/ejb/clojure/FFe7Pf9TfXc/rxmYq6IoIjMJ
>
> - naming your project "clojure" in lein
> http://osdir.com/ml/java-clojure-user/2012-04/msg00913.html
>
>
> To further investigate my case, I tried to force the startup from core.clj 
> rather than from the precompiled classes.
> Also in this case, the same call from the Scala repl works fine, whereas 
> the call from within the Scala macro expansion fails, with this:
>
> ava.lang.ClassCastException: clojure.core$fn cannot be cast to 
> clojure.lang.IFn, compiling:(clojure/core.clj:55)
> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6462)
> at clojure.lang.Compiler.analyze(Compiler.java:6262)
> at clojure.lang.Compiler.access$100(Compiler.java:37)
> at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:518)
> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6455)
> at clojure.lang.Compiler.analyze(Compiler.java:6262)
> at clojure.lang.Compiler.analyze(Compiler.java:6223)
> at clojure.lang.Compiler.eval(Compiler.java:6515)
> at clojure.lang.Compiler.load(Compiler.java:6952)
> at clojure.lang.RT.loadResourceScript(RT.java:359)
> at clojure.lang.RT.loadResourceScript(RT.java:350)
> at clojure.lang.RT.load(RT.java:429)
> at clojure.lang.RT.load(RT.java:400)
> at clojure.lang.RT.doInit(RT.java:436)
> at clojure.lang.RT.(RT.java:318)
> at .foo_impl(:8)
> Caused by: java.lang.ClassCastException: clojure.core$fn cannot be cast to 
> clojure.lang.IFn
> at clojure.lang.Var.fn(Var.java:392)
> at clojure.lang.Var.invoke(Var.java:431)
> at clojure.lang.AFn.applyToHelper(AFn.java:178)
> at clojure.lang.Var.applyTo(Var.java:532)
> at clojure.lang.Compiler.macroexpand1(Compiler.java:6366)
> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6441)
> at clojure.lang.Compiler.analyze(Compiler.java:6262)
> at clojure.lang.Compiler.access$100(Compiler.java:37)
> at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:518)
> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6455)
> at clojure.lang.Compiler.analyze(Compiler.java:6262)
> at clojure.lang.Compiler.analyze(Compiler.java:6223)
> at clojure.lang.Compiler.eval(Compiler.java:6515)
> at clojure.lang.Compiler.load(Compiler.java:6952)
> at clojure.lang.RT.loadResourceScript(RT.java:359)
> at clojure.lang.RT.loadResourceScript(RT.java:350)
> at clojure.lang.RT.load(RT.java:429)
> at clojure.lang.RT.load(RT.java:400)
> at clojure.lang.RT.doInit(RT.java:436)

Re: Call for volunteers to help moderate a ClojureScript Google group

2013-01-25 Thread Michael Wood
On 25 January 2013 13:47, Wes Freeman  wrote:

> I don't tend to filter emails, but just like to go through my inbox and
> judge based on topic and subject whether I'd like to take a closer look
> before archiving. I'm in too many groups to want to go through filters one
> at a time, and currently there a handful that don't have subject markers,
> so unless something obviously Clojure-related is in the subject, I have to
> dig deeper to know that it's actually about Clojure. If you guys don't want
> to do it, I'm fine with continued suffering (I guess I'm a minority)--just
> throwing the idea out there.
>
> Thanks for doing it in the ClojureScript group, by the way. :)
>

You have a gmail account.  You can set up filters to tag the e-mails.  It
does not mean you have to "go through filters one at a time".  Your mail
can still all be in your inbox and the tags will be to the left of the
subject.

Anybody who wants to separate the mail into separate folders (virtual or
otherwise) can do so without cluttering the subject.  People who read mail
on devices with small screens can get a bit extra space for the actual
subject instead of having "[Clojurescript] " taking up large chunk of it.

Anyway, I don't feel strongly enough about it to try to get the
Clojurescript list changed.


> Wes
>
> On Thu, Jan 24, 2013 at 8:59 AM, Wolodja Wentland wrote:
>
>> On Thu, Jan 24, 2013 at 01:50 -0500, Wes Freeman wrote:
>> > This is great. Can you guys put [ClojureScript] in the email subject
>> like most
>> > google groups do? Wouldn't mind if they put [Clojure] in the clojure
>> emails,
>> > either.
>>
>> Just curious: But why would you want that? I would happily live without
>> that
>> as it reduces line-noise and leaves more room for important information
>> such
>> as the actual subject. It is not necessary to filter mails (just filter on
>> List-I[dD]) either, so I'd be curious why you would prefer it :)
>> --
>> Wolodja 
>>
>
-- 
Michael Wood 

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




When using gradle with the clojuresque plugin I'm getting a"Plugin with id 'clojure' not found." error

2013-01-25 Thread john
Hi,
this is my first day with gradle. 

I'm running :
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.4 comiled on May 22 2012
Ivy: 2.2.0
JVM: 1.7.0_11 (Oracle Corporation 23.6-b04)
OS: Mac OS X 10.7.5 x86_6

I have the following project layout

project/server
project/client
project/domain

project/settings.gradle looks like:
include 'domain', 'server', 'client'

project/build.gradle looks like:

project(':domain') {

   buildscript {
repositories {
mavenRepo name: 'clojars', url: 'http://clojars.org/repo'
}
dependencies {
classpath 'clojuresque:clojuresque:1.5.5'
}
  }

  apply plugin: 'clojure'
}
project(':server') {
apply plugin: 'groovy'
}
project(':client') {
apply plugin: 'groovy'
}

So I have a multiproject with one clojure and 2 groovy projects:

When I run gradle build I get the error : Plugin with id 'clojure' not 
found.

I have guess my build.gradle is faulty. Can somebody help?

Many Greetings
John




-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Clojure web server benchmarks

2013-01-25 Thread Shantanu Kumar


On Jan 25, 4:24 pm, Peter Taoussanis  wrote:
> Hi Dmitry,
>
> Raw bench results are provided in the `results`
> folder:https://github.com/ptaoussanis/clojure-web-server-benchmarks/blob/mas...
>
> There you'll find a breakdown of the times to connect, process, and wait.
> Also the cumulative % of requests served relative to max response time.
>
> I'd consider adding a graph if folks think these numbers are sufficiently
> interesting?

This is important info and would be great to see plotted. More like a
3D graph of (a) concurrency distribution, (b) throughput distribution,
(c) latency distribution, where you vary the concurrency to get the
other numbers.

Shantanu

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Clojure web server benchmarks

2013-01-25 Thread Bob Hutchison

On 2013-01-25, at 6:24 AM, Peter Taoussanis  wrote:

> I'd consider adding a graph if folks think these numbers are sufficiently 
> interesting?
> 

That would be great! This is very important information for me. And, unless 
things have improved markedly over that last year or so (I hope so), I think 
you'll be 'amused' by what you see.

Cheers,
Bob

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Clojure on heroku throws exception today

2013-01-25 Thread Jonathon McKitrick
And that wouldn't make sense on Heroku, would it?

On Friday, January 25, 2013 12:08:46 AM UTC-5, AtKaaZ wrote:
>
> looks like you denied outgoing for java.exe in your firewall
> the java.exe that's in your path(or in JAVA_HOME if set)
>
> in my case:
> ie. cmd.exe
> C:\Users\user>java -version
> java version "1.7.0_09"
> Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
> Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
>
> C:\Users\user>where java
> C:\Program Files\Java\jdk1.7.0_09\bin\java.exe
>
> C:\Users\user>echo %JAVA_HOME%
> C:\Program Files\Java\jdk1.7.0_09
> (but I also have PATH set to it)
>
>
> On Fri, Jan 25, 2013 at 2:43 AM, Jonathon McKitrick 
> 
> > wrote:
>
>> I just tried again, with and without trampoline, and now I'm getting this:
>>
>> ...
>>
>> Retrieving net/cgrand/parsley/0.9.1/parsley-0.9.1.jar from clojars
>> ConnectException Connection refused
>> java.net.PlainSocketImpl.socketConnect (PlainSocketImpl.java:-2)
>>  java.net.AbstractPlainSocketImpl.doConnect 
>> (AbstractPlainSocketImpl.java:327)
>> java.net.AbstractPlainSocketImpl.connectToAddress 
>> (AbstractPlainSocketImpl.java:193)
>>  java.net.AbstractPlainSocketImpl.connect 
>> (AbstractPlainSocketImpl.java:180)
>> java.net.SocksSocketImpl.connect (SocksSocketImpl.java:384)
>>  java.net.Socket.connect (Socket.java:546)
>> java.net.Socket.connect (Socket.java:495)
>> java.net.Socket. (Socket.java:392)
>>  java.net.Socket. (Socket.java:206)
>> clojure.tools.nrepl/connect (nrepl.clj:177)
>> clojure.core/apply (core.clj:601)
>>  clojure.tools.nrepl/add-socket-connect-method!/fn--332 (nrepl.clj:219)
>> Bye for now!
>>
>>
>> On Tuesday, January 22, 2013 11:07:39 PM UTC-5, Phil Hagelberg wrote:
>>>
 This is due to the release of Leiningen 2.0.0; the buildpack currently 
 back-ports a bugfix to the repl via an alias in a way that only works 
 in 
 the preview. For the time being you can use `lein trampoline repl` 
 explicitly; I'll push a fix for the alias tomorrow. Thanks for bringing 
 this to my attention. 

 -Phil 

>>>  -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@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+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>>  
>>  
>>
>
>
>
> -- 
> I may be wrong or incomplete.
> Please express any corrections / additions,
> they are encouraged and appreciated.
> At least one entity is bound to be transformed if you do ;)
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Call for volunteers to help moderate a ClojureScript Google group

2013-01-25 Thread Wes Freeman
I don't tend to filter emails, but just like to go through my inbox and
judge based on topic and subject whether I'd like to take a closer look
before archiving. I'm in too many groups to want to go through filters one
at a time, and currently there a handful that don't have subject markers,
so unless something obviously Clojure-related is in the subject, I have to
dig deeper to know that it's actually about Clojure. If you guys don't want
to do it, I'm fine with continued suffering (I guess I'm a minority)--just
throwing the idea out there.

Thanks for doing it in the ClojureScript group, by the way. :)

Wes

On Thu, Jan 24, 2013 at 8:59 AM, Wolodja Wentland  wrote:

> On Thu, Jan 24, 2013 at 01:50 -0500, Wes Freeman wrote:
> > This is great. Can you guys put [ClojureScript] in the email subject
> like most
> > google groups do? Wouldn't mind if they put [Clojure] in the clojure
> emails,
> > either.
>
> Just curious: But why would you want that? I would happily live without
> that
> as it reduces line-noise and leaves more room for important information
> such
> as the actual subject. It is not necessary to filter mails (just filter on
> List-I[dD]) either, so I'd be curious why you would prefer it :)
> --
> Wolodja 
>
> 4096R/CAF14EFC
> 081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Clojure web server benchmarks

2013-01-25 Thread Peter Taoussanis
Hi Dmitry,

Raw bench results are provided in the `results` 
folder: 
https://github.com/ptaoussanis/clojure-web-server-benchmarks/blob/master/results/20130116-01-25

There you'll find a breakdown of the times to connect, process, and wait. 
Also the cumulative % of requests served relative to max response time.

I'd consider adding a graph if folks think these numbers are sufficiently 
interesting?

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Call for volunteers to help moderate a ClojureScript Google group

2013-01-25 Thread Shantanu Kumar


On Jan 25, 1:55 pm, Samrat Man Singh  wrote:
> I'd suggest considering Librelist for the mailing list too. I'm subscribed
> to a few mailing lists powered by it and never seen a spam problem.

I would vote against such a thing, unless there is a way to (1) read
the messages in RSS reader, and (2) reply to the message by visiting
the discussion website.

Reading/replying to discussion group messages via E-mail is the last
thing I would want to do.

Shantanu

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Clojure web server benchmarks

2013-01-25 Thread Dmitry Groshev
It would be *really* nice to see latencies as well. Some webservers trade 
latency to throughput, and there is no point in throughput if your service 
is hardly usable due to 100ms+ responses.

On Wednesday, January 16, 2013 10:56:23 AM UTC+4, Peter Taoussanis wrote:
>
>
> This is very interesting. Have you tried running the Ring Jetty adapter 
>> with a larger thread pool? It's set lower than the default so as not to 
>> overload cloud hosts like Heroku.
>>
>
> Okay, bumped the :max-threads from 50 to 100 without seeing much change to 
> the results at these relatively low concurrency levels. May well make a 
> difference at higher concurrency &/or with better hardware (both on the 
> cards for later).
>
> Anecdotally, I've seen http-kit happily running dozens of thousands of 
> concurrent connections in a high-load testing environment. Would like to 
> see how far I can push it on a 16 logical core box.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Call for volunteers to help moderate a ClojureScript Google group

2013-01-25 Thread Samrat Man Singh
I'd suggest considering Librelist for the mailing list too. I'm subscribed 
to a few mailing lists powered by it and never seen a spam problem.

Leiningen is using it 
too- 
http://librelist.com/browser//leiningen/2012/10/25/moving-to-librelist/#1c0e8108daa50a6925b21fe69c8b7f13

Anyways, if you still need more moderators I'm interested too.

On Thursday, January 24, 2013 12:38:34 AM UTC+5:45, Andy Fingerhut wrote:
>
> An interest was expressed by a few in having a separate ClojureScript 
> mailing list. 
>
> If it is a Google group, that requires moderating messages sent to the 
> group, via manual approval.  I suspect early on there will be many people 
> posting to the group for the first time that have long worked with 
> ClojureScript, and you'll know them, and you can approve that and all 
> future messages from them, but every time a new sender sends their first 
> few messages to the group, a person needs to receive an email, click a 
> link, read the message to verify it is on topic, and click a couple of 
> buttons to approve it or reject it. 
>
> Anyone interested in helping out with that?  It is easier if the load can 
> be spread across multiple people.  If someone else approves a message, you 
> still might get an email about a message needing approval, but the last 
> couple of steps above are then unnecessary. 
>
> Andy 
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Installing Clojure on Windows 7

2013-01-25 Thread keeds
As people already have said Emacs + Leiningen is readily setup on Windows 
7. emacs-live makes clojure coding a breeze with emacs 24.
It's all the other frustrations that make it a pain. Command Line, git, 
grep etc

My solution: Ubuntu 12.04 on VirtualBox VM with Emacs 24. Quick, easy and 
s much more pleasant the Windows for clojure dev.

On Thursday, 24 January 2013 17:56:59 UTC, sampso...@googlemail.com wrote:
>
> Apparently installing a development environment for Clojure on Windows 7 
> is very difficult. What is the best way, that has a chance that it might 
> work?
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Is there any medium scale opensource project implemented using clojure-clr?

2013-01-25 Thread Shantanu Kumar
I came across Clj-MML, which is a ClojureCLR library: 
https://github.com/timgluz/clj-mml
and its starter: https://github.com/timgluz/starter-cljmml

I have also noticed few ClojureCLR ports of regular Clojure-contrib
libraries.

Just FYI, there is a ClojureCLR Google+ community:

https://plus.google.com/u/0/communities/106235975067046753407

Shantanu

On Jan 25, 9:00 am, 李振  wrote:
> Hi there,
>
> I am quite a freshman on clojure.
>
> Materials I've found are about the clojure syntax with no runable project
> to have a glance.
>
> Since I'm a .Net coder I prefer to use clojure-clr and need samples to have
> a better understanding.
>
> Please share me some experiences and best practices.
>
> Thanks.
>
> P.S. English is not my mother tongue, If you confused with my words, please
> let me know.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en