Re: Java Class Factory

2009-12-03 Thread sross
On Dec 3, 4:15 am, lazy1 wrote: > Hello, > What is the right way to do this? As people have mentioned, new is a special form which evaluates it's arguments at compile time and cannot be used with a dynamic class name. Fortunately you can use the reflection API and create instance of your class

Re: "Oh, yeah, transients are fast!"

2009-11-24 Thread sross
I believe that this is most likely a symptom of the Apple JVM and not that of transients as the change from persistents to transients is far more substantial on one of our linux servers than it is on my macbook pro (6x vs 2x speedup) I'm not entirely sure as to why this is the case but I suspect t

Re: Periodic tasks

2009-11-04 Thread sross
You could also try cron4j which, while less customisable than quartz, is far simpler to use. It also accepts Runnable's as as tasks which allows for much easier clojure integration. user=> (def sched (it.sauronsoftware.cron4j.Scheduler.)) #'user/sched user=> (.schedule sched "* * * * *" #(printl

Re: Applying Java methods.

2009-09-23 Thread sross
On Sep 22, 2:30 pm, Chouser wrote: > On Mon, Sep 21, 2009 at 5:22 PM, sross wrote: > > > Hi All, > > >  I'm looking for a bit of advice for calling a java method which has a > > few different signatures (such as Connection.prepareStatement). > >  Is the

Re: Applying Java methods.

2009-09-22 Thread sross
On Sep 21, 11:35 pm, pmf wrote: > On Sep 21, 11:22 pm, sross wrote: > > > I'm looking for a bit of advice for calling a java method which has a > > few different signatures (such as Connection.prepareStatement). > > Is there a cleaner way of passing a variable n

Applying Java methods.

2009-09-21 Thread sross
Hi All, I'm looking for a bit of advice for calling a java method which has a few different signatures (such as Connection.prepareStatement). Is there a cleaner way of passing a variable number of arguments to the method, such as (apply (memfn prepareStatement) (sql/connection) args) or is d

Re: How to splitt a string by words?

2009-08-11 Thread sross
clojure.contrib.str-utils/re-partition is what you are looking for; (re-partition #"\w+" " a word and another word1 ") -> (" " "a" " " "word" " " "and" " " "another" " " "word1" " ") On Aug 11, 12:57 pm, ogcraft wrote: > How can I split a string,  but not to drop witespaces. > Like th

Re: dosync ref-set and threads coordination problem

2009-06-15 Thread sross
On Jun 14, 12:20 am, vmargioulas wrote: > In the example below 256 clients threads put a byte (0-255) to server- > socket reference var "items", > then connect to server-socket, write the same byte to socket stream > and close the connection. > The server connections threads reads a byte from t

Re: What's the function that checks if an object is "sequence-able"?

2009-06-04 Thread sross
On Jun 3, 8:34 pm, "Stephen C. Gilardi" wrote: > On Jun 3, 2009, at 12:53 PM, CuppoJava wrote: >  From that we could derive isSeqable in Java as > >    static public bool isSeqable(Object coll){ >        return >          (coll instanceof ISeq) || >          (coll instanceof Seqable) || >