sorted-set

2011-08-06 Thread Oded Badt
Trying to migrate some of my code from clojure and javascript to ClojureScript and I'm missing 'sorted-set' Does anyone know if is is one of those parts of the library that has just not yet been migrated? Or will not at all be migrated? Or maybe I'm getting something wrong and its usage is not

Re: Interfacing Cljs with external libs.

2011-08-06 Thread Alen Ribic
Looking at the this line closely from Advanced Compilation and Externs [1]: Closure Compiler compilation never changes string literals in your code, no matter what compilation level you use... Whenever possible, use dot-syntax property names rather than quoted strings. Use quoted string property

Re: sorted-set

2011-08-06 Thread Stuart Halloway
Trying to migrate some of my code from clojure and javascript to ClojureScript and I'm missing 'sorted-set' Does anyone know if is is one of those parts of the library that has just not yet been migrated? Or will not at all be migrated? Or maybe I'm getting something wrong and its usage is

Re: JSON library for clojure 1.3

2011-08-06 Thread Arthur Edelstein
From clojure.contrib.string 1.2, I have found myself using drop, take, and butlast. (These are more than just wrappers for String/substring, because they behave nicely when indices exceed the string length.) I like these methods in part because they match the behavior of corresponding sequence

Out of memory using pmap

2011-08-06 Thread Shoeb Bhinderwala
Problem summary: I am running out of memory using pmap but the same code works with regular map function. My problem is that I am trying to break my data into sets and process them in parallel. My data is for an entire month and I am breaking it into 30/31 sets - one for each day. I run a

Optimizing JDBC code

2011-08-06 Thread Shoeb Bhinderwala
I am loading about 100,000 records from the database with clojure.contrib.sql, using a simple query that pulls in 25 attributes (columns) per row. Most of the columns are of type NUMBER so they get loaded as BigDecimals. I am using Oracle database and the jdbc 6 driver ( com.oracle/ojdbc6

Re: Out of memory using pmap

2011-08-06 Thread Sunil S Nandihalli
Just a guess. If your daily data is huge you will be loading the data for only one day when using map and you will be loading the data for multiple days (equal to number of parallel threads) .. and may be this is the cause of the problem. Sunil. On Sat, Aug 6, 2011 at 11:40 PM, Shoeb Bhinderwala

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2011-08-06 Thread George Jahad
Hey Andreas: I have heard that it works on Windows, though I've never tried it. Which jvm are you using? Also, can you try attaching with command line jdb like so and see if that gets the no providers exception. 1. add a specific port to your jvm options, like 8021 below:

Re: Out of memory using pmap

2011-08-06 Thread Shoeb Bhinderwala
You didn't understand my problem. The exact same code throws out of memory when I change map to pmap. My monthly data is evenly divided into 30 sets. For e.g total monthly data = 9 records, daily data size for each day = 3000 records. I am trying to achieve performance gain by processing the

Re: Optimizing JDBC code

2011-08-06 Thread Colin Yates
That assumption needs checking - first rule of performance analysis: check, don't guess :) For example, is the java code using an existing connection versus clojure creating one? I would also time the cost of creating 10 clojure maps of a similar structure. Finally - 100,000 is big enough

Re: Out of memory using pmap

2011-08-06 Thread Colin Yates
The point is that sequentially the GC gets to remove stale entries so simplistically only 3000 records are in memory at any one time, in parallel processing all 9 can be in memory at the same time. Sent from my iPad On 6 Aug 2011, at 21:34, Shoeb Bhinderwala shoeb.bhinderw...@gmail.com

Using Lein with Local Jars on Heroku

2011-08-06 Thread Asim Jalis
I am trying to push a Clojure app on Heroku. I have a local jar file that the app needs. How can I get lein to use the local jar? When I have local jar dependencies on my personal machine I just install the jar into the local maven repository on the machine. It's not obvious to me how to do this

Re: ClojureScript Compile errors

2011-08-06 Thread Rich Hickey
In Clojure, namespaces are different from the host's packages, in ClojureScript they are the same (insofar as they match the Google Closure approach). Why all the attention to :use - I thought everyone agreed using it is a bad idea? In any case, ClojureScript is a subset and right now

Re: ClojureScript Compile errors

2011-08-06 Thread Mark Engelberg
On Sat, Aug 6, 2011 at 2:30 PM, Rich Hickey richhic...@gmail.com wrote: Why all the attention to :use - I thought everyone agreed using it is a bad idea? ... The only benefit I see is that you can avoid a (minimum 2 character) prefix. The other benefit is it saves you from the cognitive load

Re: Optimizing JDBC code

2011-08-06 Thread Shoeb Bhinderwala
I am not guessing. I measured the performance of the query using plain Java and Clojure. In one test case, I loaded 69,099 records. The Java code took 5 seconds to execute the query and create as many objects. Clojure code took 50.43 seconds. The JVM settings are the same - both are initialized

Re: Optimizing JDBC code

2011-08-06 Thread Sean Corfield
On Sat, Aug 6, 2011 at 4:51 PM, Shoeb Bhinderwala shoeb.bhinderw...@gmail.com wrote: In one test case, I loaded 69,099 records. The Java code took 5 seconds to execute the query and create as many objects. Clojure code took 50.43 seconds. Try using clojure.java.jdbc instead of

(:key map) lookup vs accessor functions in large applications

2011-08-06 Thread Martin Jul
Having evolved domain models in large Clojure projects over a long time, I've been going back and forth on maps contra accessor functions to opaque objects and I do see some merit in the latter even though they are not idiomatic Clojure. Basically, the crucial point for me is how well they work

Re: ClojureScript Compile errors

2011-08-06 Thread Ken Wesson
On Sat, Aug 6, 2011 at 6:42 PM, Mark Engelberg mark.engelb...@gmail.com wrote: On Sat, Aug 6, 2011 at 2:30 PM, Rich Hickey richhic...@gmail.com wrote: Why all the attention to :use - I thought everyone agreed using it is a bad idea? ... The only benefit I see is that you can avoid a

Re: ClojureScript Compile errors

2011-08-06 Thread pmbauer
Why all the attention to :use - I thought everyone agreed using it is a bad idea? Really? I thought it's use was only considered bad form in the absence of :only The only benefit I see is that you can avoid a (minimum 2 character) prefix. I would think the obvious benefit is its

Re: Optimizing JDBC code

2011-08-06 Thread Shoeb Bhinderwala
I switched to clojure.java.jdbc. Found no difference at all. It is still about 10 times slower than java. On Aug 6, 8:54 pm, Sean Corfield seancorfi...@gmail.com wrote: On Sat, Aug 6, 2011 at 4:51 PM, Shoeb Bhinderwala shoeb.bhinderw...@gmail.com wrote: In one test case, I loaded 69,099