Re: clojure-contrib master now in submodules

2010-09-21 Thread Sean Corfield
On Fri, Aug 20, 2010 at 7:22 AM, Stuart Sierra wrote: > For example, to use the clojure.contrib.macro-utils namespace in your > projects, add a dependency on group "org.clojure.contrib", artifact > "macro-utils", version "1.3.0-SNAPSHOT". Having built contrib against clojure 1.2.0 (see my note in

Re: building new contrib against a specific clojure jar

2010-09-21 Thread Sean Corfield
Inspired by Rich asking folks to try 1.3 / master at the Bay Area meetup last night... On Thu, Sep 2, 2010 at 2:24 PM, Stuart Sierra wrote: > You'll need to adjust the version numbers for the Clojure > dependencies.  These are configured in clojure-contrib/modules/parent/ > pom.xml at the line: >

Re: why the big difference in speed?

2010-09-21 Thread Jason Wolfe
This one is more than 10x faster (defn sum-fields3 [^"[[D" arr1 ^"[[D" arr2 ^"[[D" result] (let [L (int (alength arr1))] (dotimes [i L] (let [^doubles a1 (aget arr1 i) ^doubles a2 (aget arr2 i) ^doubles r (aget result i)] (dotimes [j L] (aset-

Re: why the big difference in speed?

2010-09-21 Thread Ranjit
I was thinking I needed the Java arrays for interop. At one step in my simulation I need to take an FFT of a 2d array, then multiply that array with another array, and then inverse FFT. Java array operations in Clojure seem so slow though that it will actually be better to convert from either a bui

Re: why the big difference in speed?

2010-09-21 Thread Jason Wolfe
I think you're still missing some type hints. I think there are varying degrees of reflective code the compiler can emit, and it doesn't always warn for the intermediate cases. Do you need to do all this array business for Java interop, or just because you believe it will give you maximum perform

Re: why the big difference in speed?

2010-09-21 Thread Ranjit
Thanks, I just tried using the random number generator in Incanter as a replacement and it shaves another ~100 msec off the runtime of the function. That's better but still noticeably slower than python. I also tried applying what I've learned here to writing a function that adds two arrays which

Re: Working with the are macro

2010-09-21 Thread Sean Devlin
Yeah, it will the trade off is you lose line item visibility of failures. I guess eval isn't too bad in this case. On Sep 21, 2:15 pm, Justin Kramer wrote: > Is using 'is' and 'every?' an option? > > (deftest test-good-labels >   (is (every? valid-label? good-labels))) > > Justin > > On Sep 21,

Re: concurrency example about java x clojure

2010-09-21 Thread Stuart Halloway
To relate this example to the OP's request for a concurrency example: The Clojure versions shown below, if they are correct at all, are correct in the face of concurrency. The Java version is not generally correct, and cannot be made correct without switching to Clojure's interfaces and persist

Re: concurrency example about java x clojure

2010-09-21 Thread Stuart Halloway
This is in fact guaranteed. Eloquent documentation patch welcome. Stu The fact that currently having vals and keys return seqs in the same >>> order is not guaranteed by the documentation ? > > At the recent Pragmatic Studio class I asked Rich and Stuart about > this very point. As I recall

Re: why the big difference in speed?

2010-09-21 Thread Jason Wolfe
FYI I fired up a profiler and more than 2/3 of the runtime of gaussian- matrix5 is going to the .nextGaussian method of java.util.Random. I think there are faster (and higher-quality) drop-in replacements for java.util.Random, if that is really important to you. I seem to recall there being a goo

Re: Working with the are macro

2010-09-21 Thread Justin Kramer
Is using 'is' and 'every?' an option? (deftest test-good-labels (is (every? valid-label? good-labels))) Justin On Sep 21, 11:53 am, Sean Devlin wrote: > I'm trying to pass a vector to are, because I need to reuse some > source data.  Is there a better way to do this?  I don't like the > eval.

Re: Clojure meetup group listing

2010-09-21 Thread Sean Corfield
The Bay Area Clojure User Group had its 25th meeting last night: http://www.meetup.com/The-Bay-Area-Clojure-User-Group/ It was a great meeting - with Rich talking about the new primitives stuff in master / 1.3 and explaining design decisions behind the language! Awesome stuff! Big thanx to Amit

Working with the are macro

2010-09-21 Thread Sean Devlin
I'm trying to pass a vector to are, because I need to reuse some source data. Is there a better way to do this? I don't like the eval. (def good-labels [...]) (deftest test-good-labels (eval `(are [label] (valid-label? label) ~...@good-labels))) Sean -- You received this message because

Re: Clojure meetup group listing

2010-09-21 Thread Kyle R. Burton
We created a Philadelphia Clojure Langauge Club. The google group is here: http://groups.google.com/group/phl-clojure-language-club We're actually meeting again tomorrow night, but don't have any formal plans beyond that. We had one lunch meeting, a hack night, and a pseudo presentation night.

Re: Using Enum Qt.AlignmentFlag ClassNotFoundException

2010-09-21 Thread Randy Hudson
Try Qt$AlignmentFlag On Sep 21, 6:20 am, Matt Hoyt wrote: > I trying to use QtJambi and I'm having problems using the enums that > have this format Qt.. > > Error: > > error: java.lang.ClassNotFoundException > > Code: > > (ns collab-web-qt.dialog.connect >   (:import (com.trolltech.qt.gui QDialog

Re: Clojure meetup group listing

2010-09-21 Thread liebke
Information on the Washington D.C area Clojure Meetup can be found here http://www.meetup.com/Cap-Clug David -- 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 member

Re: Isn't STM good at building an ant colony?

2010-09-21 Thread Hozumi
Hi Nicolas, That is a nice idea! Thanks. -- Takahiro Hozumi -- 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 f

Re: clojure.contrib.sql and duplicate inserts

2010-09-21 Thread Bart J
I wanted to use insert-values to re-insert the same values to the table again. I think using "update-or-insert-values" suffices. Thanks. On Sep 20, 6:29 pm, "Stephen C. Gilardi" wrote: > On Sep 20, 2010, at 8:27 AM, Bart J wrote: > > > Currently, it is not possible to insert duplicate rows > > u

Re: why the big difference in speed?

2010-09-21 Thread Ranjit
Yeah, I spoke too soon. All the rows are identical. This is what I meant to do: (defn gaussian-matrix-for-the-nth-time [L] (into-array (map double-array (repeatedly L #(repeatedly L next- gaussian) and on my computer takes ~800 msecs vs. ~400 msecs for gaussian- matrix5 to make an array of

Re: Clojure Serial Connection

2010-09-21 Thread Kyle Cordes
On Mon, Sep 20, 2010 at 10:17 PM, Ivan Willig wrote: > I list, i am trying to connect to a USB GSM Modem with clojure. Basically, i > want to open a serial connection to my modem and be able to pass commands to > it. ( I think I am new to this whole modem thing).  I know I can do this in > Java, b

Using Enum Qt.AlignmentFlag ClassNotFoundException

2010-09-21 Thread Matt Hoyt
I trying to use QtJambi and I'm having problems using the enums that have this format Qt.. Error: error: java.lang.ClassNotFoundException Code: (ns collab-web-qt.dialog.connect (:import (com.trolltech.qt.gui QDialog QWidget QVBoxLayout QFormLayout QLineEdit) (com.trolltech.qt.core

Re: Clojure Serial Connection

2010-09-21 Thread Ivan Willig
Thanks!!! Ivan Willig Modi Research Group Columbia University On Tue, Sep 21, 2010 at 6:07 AM, Nurullah Akkaya wrote: > Hi Ivan, > > I have a project called Clodiuno which allows you to control an > Arduino board using either serial or TCP/IP protocol, that may give > you a head start, > > htt

Re: Clojure meetup group listing

2010-09-21 Thread Jeff Rose
The Amsterdam Clojurians meet the 2nd Wednesday of every month in the center of Amsterdam. We organize on a google group here: http://groups.google.com/group/amsterdam-clojurians In the last year we've grown from 3 to 33 people, and the growth rate seems to be accelerating :-) -Jeff On Sep 21,

Re: Clojure Serial Connection

2010-09-21 Thread Nurullah Akkaya
Hi Ivan, I have a project called Clodiuno which allows you to control an Arduino board using either serial or TCP/IP protocol, that may give you a head start, http://github.com/nakkaya/clodiuno/blob/master/src/clodiuno/firmata.clj http://nakkaya.com/clodiuno.html Regards... -- Nurullah Akkaya h

Re: appengine-magic: using Clojure with Google App Engine

2010-09-21 Thread Saul Hazledine
On Sep 20, 10:15 pm, Constantine Vetoshev wrote: > > http://github.com/gcv/appengine-magic > > Comments welcome, as always. > One thing that would simplify the process a little is that, when Leiningen 1.4 is released, that appengine-magic uses the plugin manager to install: http://groups.google.

Re: concurrency example about java x clojure

2010-09-21 Thread Laurent PETIT
2010/9/21 Meikel Brandmeyer > Hi, > > On 21 Sep., 09:39, Laurent PETIT wrote: > > > So (= m1 m2) may not imply (= (zipmap (keys m1) (vals m1)) (zipmap (keys > m2) > > (vals m2))) for any (m1, m2), hmmm, good to remember somewhere in my head > > ... :) > > I don't think that this is the case. Wha

Re: concurrency example about java x clojure

2010-09-21 Thread Meikel Brandmeyer
Hi, On 21 Sep., 09:39, Laurent PETIT wrote: > So (= m1 m2) may not imply (= (zipmap (keys m1) (vals m1)) (zipmap (keys m2) > (vals m2))) for any (m1, m2), hmmm, good to remember somewhere in my head > ... :) I don't think that this is the case. What is meant, is (= (keys m1) (keys m2)) is not n

Re: what's up with user.clj?

2010-09-21 Thread Laurent PETIT
2010/9/21 Laurent PETIT > 2010/9/21 Phil Hagelberg > > On Mon, Sep 20, 2010 at 10:07 PM, Kevin Downey wrote: >> > On Mon, Sep 20, 2010 at 7:33 PM, Robert McIntyre wrote: >> >> If it is to be deprecated, is there a "correct" way of achieving the >> >> same result (having things automatically lo

Re: concurrency example about java x clojure

2010-09-21 Thread Laurent PETIT
2010/9/21 Phil Hagelberg > On Mon, Sep 20, 2010 at 7:15 PM, David Cabana wrote: > >> > > The fact that currently having vals and keys return seqs in the same > >> > order is not guaranteed by the documentation ? > > > > At the recent Pragmatic Studio class I asked Rich and Stuart about > > this

Re: what's up with user.clj?

2010-09-21 Thread Laurent PETIT
2010/9/21 Phil Hagelberg > On Mon, Sep 20, 2010 at 10:07 PM, Kevin Downey wrote: > > On Mon, Sep 20, 2010 at 7:33 PM, Robert McIntyre wrote: > >> If it is to be deprecated, is there a "correct" way of achieving the > >> same result (having things automatically loaded when you create the > >> re