Re: Scientific computing

2009-10-24 Thread Ahmed Fasih
> If all you need is a statistical or array-processing language like MATLAB, > my frank view is you're best off staying in R, or Mathematica, or MATLAB, or > Octave, or whatever... they're mature and great at what they do (Mathematica > most of all ;-) ). The reason you might want to use Clojurati

News on Mini Kanren / Javascript generator; when is an implementation sufficiently original?

2009-10-24 Thread Michel Salim
Jim was working on logic programming in Clojure up to a few months ago, and it seems as if the concern was that the code was too derivative. I have recently made available a Scala-based Kanren implementation; the differences between Scala and Scheme means that the code is sufficiently original. M

Re: SICP in Clojure

2009-10-24 Thread John Harrop
On Sat, Oct 24, 2009 at 10:19 PM, Robert Stehwien wrote: > Hadn't seen it posted here yet: > http://sicpinclojure.com/ > Are they looking for help writing Clojure versions of the Scheme code snippets? --~--~-~--~~~---~--~~ You received this message because you are

Re: reading a range from a large file

2009-10-24 Thread Richard Newman
> In clojure, i can grab the first n lines nicely: > (with-open [r (reader "FILE")] (str-join ", " (take n (line-seq r > > How can i grab the first n lines starting from an line offset? ex, > grab lines 5 to 10 rather than just the first 5. (with-open [r (reader "FILE")] (str-join ", "

reading a range from a large file

2009-10-24 Thread tommy c
I have a huge file(>900MB) that I would like to read/process in chunks. In clojure, i can grab the first n lines nicely: (with-open [r (reader "FILE")] (str-join ", " (take n (line-seq r How can i grab the first n lines starting from an line offset? ex, grab lines 5 to 10 rather than just t

SICP in Clojure

2009-10-24 Thread Robert Stehwien
Hadn't seen it posted here yet: http://sicpinclojure.com/ --~--~-~--~~~---~--~~ 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

Re: STM talk

2009-10-24 Thread MarkSwanson
I'm confused about the slide on barging: "txnB has a status of RUNNING and can be changed to KILLED". Are you implying that simply having a status of RUNNING is all that is required for the txn to be killed? Or, are there other requirements to "can be changed"? I'm having a hard time wrapping m

Re: is there a cannonical way to create executable jar files?

2009-10-24 Thread Nurullah Akkaya
On Sat, Oct 24, 2009 at 10:50 PM, Richard Newman wrote: > >> for anyone who has this same problem. The only solution that I've >> gotten so far that works is to use a java file that launches my >> clojure files. I'm still looking for a better way to do this. > > I've had success on several projec

Re: Scientific computing

2009-10-24 Thread Rock
Thanks for your replies. You've been very helpful. On Oct 24, 1:36 pm, Konrad Hinsen wrote: > On 23 Oct 2009, at 22:00, Konrad Hinsen wrote: > > > For matrix computations and linear algebra, your best choice is   > > probably > >  the Colt library developed at CERN, or the somewhat parallelized

Re: STM talk

2009-10-24 Thread ngocdaothanh
After reading your PDF, I now understand what Clojure means by the term "coordinate". Thanks a lot! -- coordinating activities of multiple actors (i.e. transactions) • may want to send messages to multiple actors within a txn and guarantee that either all messages are proc

Re: Code improvement: searching a tree

2009-10-24 Thread samppi
Jeez, that's amazing. Thanks a lot; I had no idea that trees-seq existed. I keep getting surprised by Clojure. On Oct 24, 2:05 pm, James Reeves wrote: > This is a slightly faster and somewhat shorter version: > > (defn find-dependencies2 >   [rel-rep] >   (set (filter symbol? (tree-seq seq? rest

Re: Code improvement: searching a tree

2009-10-24 Thread James Reeves
This is a slightly faster and somewhat shorter version: (defn find-dependencies2 [rel-rep] (set (filter symbol? (tree-seq seq? rest rel-rep - James On Oct 24, 9:55 pm, samppi wrote: > I suspect the code below can be improved. The function returns the set > of all symbols inside a list-

Code improvement: searching a tree

2009-10-24 Thread samppi
I suspect the code below can be improved. The function returns the set of all symbols inside a list-tree that are not at the beginning of a list. Is there a way to make the code more compact or faster? (with-test (defn- find-dependencies [rel-rep] (cond (list? rel-rep) (le

Re: Writing binary data using http.agent and duck-streams

2009-10-24 Thread Rob Wolfe
Baishampayan Ghose writes: > Hello, > > I was trying to download a zip file using clojure.contrib.http.agent and > writing it to a file using clojure.contrib.duck-streams. > > Apparently the zip file is getting corrupt because I was trying to treat > the stream as a string. > > Is there any way

Re: is there a cannonical way to create executable jar files?

2009-10-24 Thread Richard Newman
> for anyone who has this same problem. The only solution that I've > gotten so far that works is to use a java file that launches my > clojure files. I'm still looking for a better way to do this. I've had success on several projects with: (ns com.foo.bar (:refer-clojure) (:gen-class))

Re: is there a cannonical way to create executable jar files?

2009-10-24 Thread Folcon
for anyone who has this same problem. The only solution that I've gotten so far that works is to use a java file that launches my clojure files. I'm still looking for a better way to do this. Here is the code for the launcher. import java.io.OutputStreamWriter; import java.io.IOException; impor

Re: Why can't :let be first in a for

2009-10-24 Thread Howard Lewis Ship
>From my perspective, having the forms be flatter (less nested) and having the call to the extend-dom function be at the outermost level is the most readable. On Fri, Oct 23, 2009 at 1:20 PM, Meikel Brandmeyer wrote: > Hi, > > Am 23.10.2009 um 21:16 schrieb Howard Lewis Ship: > >> Here's what I

Re: Macro newbie: Trying to create a map template

2009-10-24 Thread John Harrop
On Sat, Oct 24, 2009 at 2:43 PM, samppi wrote: > Thanks a lot! I didn't know about the existence of gensym. This will > help a lot. You're welcome. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. T

Re: Macro newbie: Trying to create a map template

2009-10-24 Thread samppi
Thanks a lot! I didn't know about the existence of gensym. This will help a lot. On Oct 23, 9:54 pm, John Harrop wrote: > On Sat, Oct 24, 2009 at 12:19 AM, samppi wrote: > > user=> (defmacro b [form] > >  (let [processed-form (a form rec#)] > >    `(fn [rec#] processed-form))) > > java.lang.Exc

STM talk

2009-10-24 Thread Mark Volkmann
I gave a talk on STM at a conference in St. Louis called "Strange Loop" last Thursday. 1 up and 2 up PDF versions of the slides are available at http://ociweb.com/mark/stm/. The talk was videotaped. I'll send another email when that is available. Feedback is welcomed! I'll update the slides if nee

Re: Clojure in a big Java solution

2009-10-24 Thread eyeris
It's difficult to provide advice without more information about your current code. You say that you want a part of your system, which manipulates a lot of objects, to run in parallel. Do you mean that you want this part of the system to run parallel to the other parts -or- do you mean that this pa

Re: Scientific computing

2009-10-24 Thread Konrad Hinsen
On 23 Oct 2009, at 22:00, Konrad Hinsen wrote: > For matrix computations and linear algebra, your best choice is > probably > the Colt library developed at CERN, or the somewhat parallelized > version called Parallel Colt. Colt has arrays up to three dimensions > for > a couple of data types

Re: Converting symbols to strings

2009-10-24 Thread Tzach
Thanks for the help! I created a small function, which convert the nodes of a nested collection to strings: (defn rec-to-strs [f] "recursively change parameters to strings" (vec (for [c f] (if (coll? c) (vec (rec-to-strs c)) (str c) I use this function from a macro as

Re: Large lazy seq = StackOverflow?

2009-10-24 Thread Dmitry Kakurin
On Oct 21, 9:14 pm, John Harrop wrote: > You probably therefore want this instead: > > (defn multi-filter [filters coll] >   (let [c (count filters) >         ignore (Object.)] >     (map >       (fn [i] >         (remove #(= % ignore) >           (take-nth c >             (drop i >