Re: Clojure 1.3 amap/aset issue?

2010-10-04 Thread Sean Corfield
On Sun, Oct 3, 2010 at 11:26 PM, ataggart alex.tagg...@gmail.com wrote:
 I don't see what you're seeing for the type-hinted version:
...
 Perhaps you need to update your 1.3 install.

Just ran lein deps on the snapshot to get the latest versions and
still see the warnings:

(set! *warn-on-reflection* true)
; true
(defn asum-sq [ ^floats xs]
  (let [^floats dbl (amap xs i ret
 (* (aget xs i)
 (aget xs i)))]
(areduce dbl i ret 0
  (+ ret (aget dbl i)
; Reflection warning, NO_SOURCE_PATH:2 - call to aclone can't be resolved.
; Reflection warning, NO_SOURCE_PATH:2 - call to alength can't be resolved.
; Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
; Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
; Reflection warning, NO_SOURCE_PATH:2 - call to aset can't be resolved.
; Reflection warning, NO_SOURCE_PATH:2 - call to alength can't be resolved.
; Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
; NO_SOURCE_FILE:2 recur arg for primitive local: ret is not matching
primitive, had: Object, needed: long
; Auto-boxing loop arg: ret
; Reflection warning, NO_SOURCE_PATH:2 - call to alength can't be resolved.
; Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
; #'user/asum-sq

Here's the 1.3.0 snapshot files:

(! 520)- ls lib
clojure-1.3.0-master-20101002.200208-12.jar dev 
standalone-1.3.0-20101002.230520-4.jar
-- 
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/

If you're not annoying somebody, you're not really alive.
-- Margaret Atwood

-- 
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: big integers in 1.2 leading to parked processes? (maybe somehow, I think)

2010-10-04 Thread Laurent PETIT
2010/10/4 George Jahad cloj...@blackbirdsystems.net



 On Oct 4, 2:34 am, Lee Spector lspec...@hampshire.edu wrote:
  On Oct 4, 2010, at 3:58 AM, George Jahad wrote:
 
  I also look forward to the integration of CDT into Eclipse/ccw :-). Or
 maybe I need to migrate back to emacs, from whence I came (but was lured
 away by a couple nice features of eclipse/ccw...).
 

 I want to emphasize that my goal with the CDT is very definitely NOT
 to have it be an Emacs debugger.

 Emacs was first because that's what I know, (Emacs loves me and the
 feeling is mutual).  Laurent has kindly expressed an interest in
 porting the CDT to CCW and I intend on supporting him to do so in the
 near future, (after I clean up the porting layer a bit, so he doesn't
 have to do it more than once.)

 Having said all that, the CDT is still very powerful in command line
 mode, with no IDE front end at all.  (That is how I used it when
 debugging this problem, since I had to create the debugging primitives
 for handling Agents anyway.)  So until it gets integrated with CCW,
 (and even afterwards,) command line mode is always an option.


Yes, that's good to know. So, Lee, if I understand correctly, being able to
use the CDT from CCW is just a matter of :
  * adding its jar file to the project's Java Build Path: Project 
Properties  Java Build Path  Libraries  [ Add Jars if you copied the
jar in your project | Add external Jars if the jar is not relative to
Eclipse's workspace but located somewhere in the filesystem ]
  * starting the REPL not with Run  Run as ... or the like, but with Run
 Debug as ... (so the JVM is started with JVM debugging options)

Cheers,

-- 
Laurent

-- 
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 1.3 amap/aset issue?

2010-10-04 Thread ataggart
I don't see what you're seeing for the type-hinted version:

user= (defn asum-sq [ ^floats xs ]
user=*   (let [ ^floats dbl (amap xs i ret
user=*   (* (aget xs i)
user=*  (aget xs i)))]
user=* (areduce dbl i ret 0
user=*   (+ ret (aget dbl i)
NO_SOURCE_FILE:12 recur arg for primitive local: ret is not matching
primitive, had: double, needed: long
Auto-boxing loop arg: ret
#'user/asum-sq

Perhaps you need to update your 1.3 install.


On Oct 3, 11:16 pm, Sean Corfield seancorfi...@gmail.com wrote:
 Further digging seems to indicate aset etc work for int-array types -
 but not float-array types?

 (let [^ints xii (int-array [1 2 3 4 5])] (amap xii i ret (* (aget xii
 i) (aget xii i

 (without the hint, it also works but emits various reflection warnings)



 On Sun, Oct 3, 2010 at 9:41 PM, Sean Corfield seancorfi...@gmail.com wrote:
  I'm trying out various examples in The Joy Of Clojure and I'm in
  Chapter 12 Performance looking at type hinting.

  The authors give this example:

  (set! *warn-on-reflection* true)
  ; true
  (defn asum-sq [xs]
   (let [dbl (amap xs i ret
               (* (aget xs i)
                  (aget xs i)))]
     (areduce dbl i ret 0
       (+ ret (aget dbl i)

  ; Reflection warning, NO_SOURCE_PATH:2 - call to aclone can't be resolved.

  Plus lots of others:

  Reflection warning, NO_SOURCE_PATH:2 - call to alength can't be resolved.
  Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
  Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
  Reflection warning, NO_SOURCE_PATH:2 - call to aset can't be resolved.
  Reflection warning, NO_SOURCE_PATH:2 - call to alength can't be resolved.
  Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
  NO_SOURCE_FILE:2 recur arg for primitive local: ret is not matching
  primitive, had: Object, needed: long
  Auto-boxing loop arg: ret
  Reflection warning, NO_SOURCE_PATH:2 - call to alength can't be resolved.
  Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
  #'user/asum-sq

  They claim if you use ^floats as a type hint, this will solve the
  problem, but here's what I get (on Clojure 1.3):

  (defn asum-sq [ ^floats xs ]
   (let [ ^floats dbl (amap xs i ret
               (* (aget xs i)
                  (aget xs i)))]
     (areduce dbl i ret 0
       (+ ret (aget dbl i)
  Reflection warning, NO_SOURCE_PATH:3 - call to aclone can't be resolved.
  Reflection warning, NO_SOURCE_PATH:3 - call to alength can't be resolved.
  Reflection warning, NO_SOURCE_PATH:3 - call to aget can't be resolved.
  Reflection warning, NO_SOURCE_PATH:3 - call to aget can't be resolved.
  Reflection warning, NO_SOURCE_PATH:3 - call to aset can't be resolved.
  Reflection warning, NO_SOURCE_PATH:3 - call to alength can't be resolved.
  Reflection warning, NO_SOURCE_PATH:3 - call to aget can't be resolved.
  NO_SOURCE_FILE:3 recur arg for primitive local: ret is not matching
  primitive, had: Object, needed: long
  Auto-boxing loop arg: ret
  Reflection warning, NO_SOURCE_PATH:3 - call to alength can't be resolved.
  Reflection warning, NO_SOURCE_PATH:3 - call to aget can't be resolved.
  #'user/asum-sq

  In other words, the same set of reflection warnings.

  Trying either version of asum-sq blows up tho'...

  (time (dotimes [_ 1] (asum-sq (float-array [1 2 3 4 5]
  ; IllegalArgumentException No matching method found: aset
  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:77)

  Shouldn't it at least run, albeit slowly?

  Simplifying the example somewhat:

  (def xs (float-array [1 2 3 4 5]))
  ; #'user/xs
  (amap xs i ret (* (aget xs i) (aget xs i)))
  ; Reflection warning, NO_SOURCE_PATH:12 - call to aclone can't be resolved.
  ; Reflection warning, NO_SOURCE_PATH:12 - call to alength can't be resolved.
  ; Reflection warning, NO_SOURCE_PATH:12 - call to aget can't be resolved.
  ; Reflection warning, NO_SOURCE_PATH:12 - call to aget can't be resolved.
  ; Reflection warning, NO_SOURCE_PATH:12 - call to aset can't be resolved.
  ; IllegalArgumentException No matching method found: aset
  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:77)

-- 
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: relational data aggregation language

2010-10-04 Thread Shantanu Kumar
Thanks Ross, that gives me a better insight into your environment.

 In the online environment single cases are fetched from a
 database with no aggregation capability and fired at the service that
 contains the aggregation functionality.

What does a single case consist of? Is it just a result-set (as a
consequence of running an SQL query)?. Maybe an example will help.

 This would make sense if the IMDB query language supported the
 aggregations we want in a way our statisticians can use, and the IMDB
 is sufficiently lightweight that we can link it into our service as a
 function library (rather than a separate server connected by some
 communication protocol).

I know that Apache Derby[1], HSQLDB[2] (now called HyperSQL) and H2[3]
can be readily used in Clojure as in-memory databases without needing
to start a server. You can find the examples here:
http://bitbucket.org/kumarshantanu/clj-dbcp/src (though Clj-DBCP 0.1
is not actually released yet, expected soon with SQLRat 0.2)

[1] http://db.apache.org/derby/
[2] http://hsqldb.org/
[3] http://www.h2database.com/html/main.html

There are likely more in-memory databases I am not aware of at the
moment. As long as they have JDBC drivers using them should be easy.
Since your main criteria is SQL features/functions, I guess you would
need to find out which IMDB suits better.

I will be happy to add any missing bits to Clj-DBCP and SQLRat (I am
the author) if you can let me know. Please feel free to ping me off
the list.

Regards,
Shantanu

On Oct 4, 4:57 pm, Ross Gayler r.gay...@gmail.com wrote:
 Thanks for the two posts Shantanu.

 The rql and Clause examples are useful, both as potential parts of a
 solution and as examples of how query/aggregation stuff may be done in
 Clojure style.  It is conceivable that I may end up deciding all I
 need is a DSL that covers the kinds of aggregations of interest to us
 and translates them to SQL via SQLrat.

 With respect to your three suggestions in your second post - things
 get a bit more interesting.  A major part of the problem (which I
 failed to emphasize/mention in my first post) is that I really want
 this aggregation stuff to work in two deployment environments: a batch
 oriented statistical development environment that we control and an
 online, realtime transactional environment that corporate IT
 controls.  In the online environment single cases are fetched from a
 database with no aggregation capability and fired at the service that
 contains the aggregation functionality. We control what happens inside
 that service but have close to zero chance of changing anything
 outside that service - so in that online environment we have no
 possibility of putting aggregation into the datasource DB that feeds
 our service.  However, it *might* be reasonable to put an in-memory
 database inside our service, purely to take advantage of the
 aggregation facilities provided by that IMDB. A single case would get
 loaded into the IMDB, the aggregation would be carried out in that
 IMDB, the results exported, and the IMDB cleared ready for the next
 case. This would make sense if the IMDB query language supported the
 aggregations we want in a way our statisticians can use, and the IMDB
 is sufficiently lightweight that we can link it into our service as a
 function library (rather than a separate server connected by some
 communication protocol).

 In our statistical development environment things are different. The
 source data happens to live in a database, and we query that to get
 the subset of cases we are interested in (say, 1M of them). In that
 subset, each case can be treated completely in isolation and our
 aggregations will use 100% of the component data in each case. An
 individual aggregation might touch 20% of the data in one case, but we
 might have ~500 different  aggregations from the same case, so every
 value gets used in lots of different aggregations.  So although I am
 interested in DB query languages as a way of specifying aggregations I
 am not so convinced that I would actually use a full-blown DB  to
 implement those aggregations.

 Cheers

 Ross

 On Oct 4, 3:24 am, Shantanu Kumar kumar.shant...@gmail.com wrote:



  I looked at Tutorial D - it's pretty interesting. Here are few top-of-
  my-head observations:

  * Which RDBMS do you use? If you are free to choose a new RDBMS,
  probably you can pick one that provides most of the computational
  functionality (as SQL constructs/functions) out of the box. For
  example Oracle, MS SQL Server, PostgreSQL etc. The reason is
  performance - the more you can compute within the database, the less
  amount of data you will need to fetch in order to process.

  * The kinds of computations you need to solve look like a superset of
  what SQL can provide. So, I think you will have to re-state the
  problem in terms of computations/iterations over SQL result-sets,
  which is probably what you are currently doing using the imperative
  language. If you 

Sandbar - unbound session

2010-10-04 Thread Paul
Hi,

I've added sandbar session mgmt to my  google app engine + compojure
application, wrapping a stateful session around my routes
configuration with:

(def app (- my-routes wrap-stateful-session))
(defservice my-routes)

The application compiles but I get the following error when I perform
session-get or session-pu!:

java.lang.IllegalStateException: Var sandbar.stateful-session/sandbar-
session is unbound.

Can anyone help?

Thanks,

Paul.

-- 
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 1.3 amap/aset issue?

2010-10-04 Thread Sean Corfield
Further digging seems to indicate aset etc work for int-array types -
but not float-array types?

(let [^ints xii (int-array [1 2 3 4 5])] (amap xii i ret (* (aget xii
i) (aget xii i

(without the hint, it also works but emits various reflection warnings)

On Sun, Oct 3, 2010 at 9:41 PM, Sean Corfield seancorfi...@gmail.com wrote:
 I'm trying out various examples in The Joy Of Clojure and I'm in
 Chapter 12 Performance looking at type hinting.

 The authors give this example:

 (set! *warn-on-reflection* true)
 ; true
 (defn asum-sq [xs]
  (let [dbl (amap xs i ret
              (* (aget xs i)
                 (aget xs i)))]
    (areduce dbl i ret 0
      (+ ret (aget dbl i)

 ; Reflection warning, NO_SOURCE_PATH:2 - call to aclone can't be resolved.

 Plus lots of others:

 Reflection warning, NO_SOURCE_PATH:2 - call to alength can't be resolved.
 Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
 Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
 Reflection warning, NO_SOURCE_PATH:2 - call to aset can't be resolved.
 Reflection warning, NO_SOURCE_PATH:2 - call to alength can't be resolved.
 Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
 NO_SOURCE_FILE:2 recur arg for primitive local: ret is not matching
 primitive, had: Object, needed: long
 Auto-boxing loop arg: ret
 Reflection warning, NO_SOURCE_PATH:2 - call to alength can't be resolved.
 Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
 #'user/asum-sq

 They claim if you use ^floats as a type hint, this will solve the
 problem, but here's what I get (on Clojure 1.3):

 (defn asum-sq [ ^floats xs ]
  (let [ ^floats dbl (amap xs i ret
              (* (aget xs i)
                 (aget xs i)))]
    (areduce dbl i ret 0
      (+ ret (aget dbl i)
 Reflection warning, NO_SOURCE_PATH:3 - call to aclone can't be resolved.
 Reflection warning, NO_SOURCE_PATH:3 - call to alength can't be resolved.
 Reflection warning, NO_SOURCE_PATH:3 - call to aget can't be resolved.
 Reflection warning, NO_SOURCE_PATH:3 - call to aget can't be resolved.
 Reflection warning, NO_SOURCE_PATH:3 - call to aset can't be resolved.
 Reflection warning, NO_SOURCE_PATH:3 - call to alength can't be resolved.
 Reflection warning, NO_SOURCE_PATH:3 - call to aget can't be resolved.
 NO_SOURCE_FILE:3 recur arg for primitive local: ret is not matching
 primitive, had: Object, needed: long
 Auto-boxing loop arg: ret
 Reflection warning, NO_SOURCE_PATH:3 - call to alength can't be resolved.
 Reflection warning, NO_SOURCE_PATH:3 - call to aget can't be resolved.
 #'user/asum-sq

 In other words, the same set of reflection warnings.

 Trying either version of asum-sq blows up tho'...

 (time (dotimes [_ 1] (asum-sq (float-array [1 2 3 4 5]
 ; IllegalArgumentException No matching method found: aset
 clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:77)

 Shouldn't it at least run, albeit slowly?

 Simplifying the example somewhat:

 (def xs (float-array [1 2 3 4 5]))
 ; #'user/xs
 (amap xs i ret (* (aget xs i) (aget xs i)))
 ; Reflection warning, NO_SOURCE_PATH:12 - call to aclone can't be resolved.
 ; Reflection warning, NO_SOURCE_PATH:12 - call to alength can't be resolved.
 ; Reflection warning, NO_SOURCE_PATH:12 - call to aget can't be resolved.
 ; Reflection warning, NO_SOURCE_PATH:12 - call to aget can't be resolved.
 ; Reflection warning, NO_SOURCE_PATH:12 - call to aset can't be resolved.
 ; IllegalArgumentException No matching method found: aset
 clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:77)

-- 
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: Sandbar - unbound session

2010-10-04 Thread Paul
Managed to solve my own problem. For anyone with the same problem in
the future, here is the corrected code:

(defservice (- my-routes wrap-stateful-session))

and remove the (def app) line.

P.

On Oct 4, 10:27 am, Paul paul_bow...@yahoo.com wrote:
 Hi,

 I've added sandbar session mgmt to my  google app engine + compojure
 application, wrapping a stateful session around my routes
 configuration with:

 (def app (- my-routes wrap-stateful-session))
 (defservice my-routes)

 The application compiles but I get the following error when I perform
 session-get or session-pu!:

 java.lang.IllegalStateException: Var sandbar.stateful-session/sandbar-
 session is unbound.

 Can anyone help?

 Thanks,

 Paul.

-- 
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: big integers in 1.2 leading to parked processes? (maybe somehow, I think)

2010-10-04 Thread George Jahad


On Oct 4, 2:34 am, Lee Spector lspec...@hampshire.edu wrote:
 On Oct 4, 2010, at 3:58 AM, George Jahad wrote:

 I also look forward to the integration of CDT into Eclipse/ccw :-). Or maybe 
 I need to migrate back to emacs, from whence I came (but was lured away by a 
 couple nice features of eclipse/ccw...).


I want to emphasize that my goal with the CDT is very definitely NOT
to have it be an Emacs debugger.

Emacs was first because that's what I know, (Emacs loves me and the
feeling is mutual).  Laurent has kindly expressed an interest in
porting the CDT to CCW and I intend on supporting him to do so in the
near future, (after I clean up the porting layer a bit, so he doesn't
have to do it more than once.)

Having said all that, the CDT is still very powerful in command line
mode, with no IDE front end at all.  (That is how I used it when
debugging this problem, since I had to create the debugging primitives
for handling Agents anyway.)  So until it gets integrated with CCW,
(and even afterwards,) command line mode is always an option.

-- 
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: big integers in 1.2 leading to parked processes? (maybe somehow, I think)

2010-10-04 Thread George Jahad
Using the CDT I was able to confirm that one of the agents actually is
generating a run time exception, trying to cast an int from a long.
Could the perturb function be calling rand-int with a value that is
too large?  I'm including the stack trace below in case that helps.

This is line 950 in RT.java:
throw new IllegalArgumentException(Value out of range for int:  +
x);

user= (print-frames)
  0 clojure.lang.RT intCast [x] RT.java:950
  1 clojure.lang.RT intCast [x] RT.java:922
  2 clojure.core$rand_int invoke [this n] core.clj:3821
  3 clojush$perturb invoke [this z denom atom-generators safe-denom i
points pgm zipper] regression.clj:280
  4 clojush$fn__1071 invoke [this state] regression.clj:290
  5 clojush$execute_instruction invoke [this literal-type instruction
state] clojush.clj:1282
  6 clojush$eval_push invoke [this iteration state exec-top s print]
clojush.clj:1300
  7 clojush$run_push invoke [this state print code s] clojush.clj:1319
  8 clojush$run_push invoke [this state code] clojush.clj:1312
  9 clojush$eval1080$fn__1083$iter__1084__1088$fn__1089$fn__1090
invoke [this b--1087 size--4062--auto-- program c--4061--auto--
i--1086 input] regression.clj:310
 10 clojush$eval1080$fn__1083$iter__1084__1088$fn__1089 invoke [this
program iter--1084 s--1085 size--4062--auto--1095 temp--3589--
auto--1097 c--4061--auto--1094 b--1087] regression.clj:306
 11 clojure.lang.LazySeq sval [this] LazySeq.java:42
 12 clojure.lang.LazySeq seq [this] LazySeq.java:56
 13 clojure.lang.RT seq [coll] RT.java:450
 14 clojure.core$seq invoke [this coll] core.clj:122
 15 clojure.core$dorun invoke [this coll] core.clj:2450
 16 clojure.core$doall invoke [this coll] core.clj:2465
 17 clojush$eval1080$fn__1083 invoke [this program] regression.clj:306
 18 clojush$evaluate_individual invoke [this error-function i]
clojush.clj:1455
 19 clojure.lang.AFn applyToHelper [arglist a1 ifn] AFn.java:165
 20 clojure.lang.AFn applyTo [this arglist] AFn.java:151
 21 clojure.lang.Agent$Action doRun [action oldval error] Agent.java:
100
 22 clojure.lang.Agent$Action run [this] Agent.java:150
 23 java.util.concurrent.ThreadPoolExecutor$Worker runTask []
ThreadPoolExecutor.java:886
 24 java.util.concurrent.ThreadPoolExecutor$Worker run []
ThreadPoolExecutor.java:908
 25 java.lang.Thread run [] Thread.java:637


On Oct 3, 5:07 pm, Lee Spector lspec...@hampshire.edu wrote:
 On Oct 3, 2010, at 7:16 PM, Lee Spector wrote:



  I've just done a couple of runs verifying that this happens when using the 
  exact same code in 1.1 and 1.2. (Previously the code I was running under 
  the different versions varied slightly, but now I'm using exactly the same 
  code.)

 If anyone feels like trying it themselves -- that would be wonderful -- the 
 code is athttp://hampshire.edu/lspector/gptp10/autopush-gptp10-code.zip

 Open the regression.clj file in success-12, scroll to the bottom, decrease 
 the :population-size parameter near the bottom the file from 10 to 1000 
 (just so it goes through generations faster), and then run that file (which 
 will load clojush.clj). Under 1.2 this generally hangs within a couple dozen 
 generations for me... sometimes a little longer. (In case this could matter 
 I'm running under Mac OS X in Eclipse/Counterclockwise, with the most recent 
 versions of everything.) Under 1.1 it runs through at least several hundred 
 generations without error or hanging until I stop it. (It's unlikely with 
 these parameters but it's possible it would stop earlier because it found a 
 solution -- then it would say Success!.)

 If anyone does this please note that I do know that the code in that file is 
 TERRIBLE, AWFUL, unidiomatic clojure code. I was still new(er) to clojure 
 when I wrote it. My more recent versions are improved in several ways -- some 
 of that is athttp://github.com/lspector/Clojush-- but since I wanted code 
 that ran in 1.1 I'm using this old version to track down this problem.

  -Lee

 --
 Lee Spector, Professor of Computer Science
 School of Cognitive Science, Hampshire College
 893 West Street, Amherst, MA 01002-3359
 lspec...@hampshire.edu,http://hampshire.edu/lspector/
 Phone: 413-559-5352, Fax: 413-559-5438

 Check out Genetic Programming and Evolvable 
 Machines:http://www.springer.com/10710-http://gpemjournal.blogspot.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 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: relational data aggregation language

2010-10-04 Thread Ross Gayler
Thanks for the two posts Shantanu.

The rql and Clause examples are useful, both as potential parts of a
solution and as examples of how query/aggregation stuff may be done in
Clojure style.  It is conceivable that I may end up deciding all I
need is a DSL that covers the kinds of aggregations of interest to us
and translates them to SQL via SQLrat.

With respect to your three suggestions in your second post - things
get a bit more interesting.  A major part of the problem (which I
failed to emphasize/mention in my first post) is that I really want
this aggregation stuff to work in two deployment environments: a batch
oriented statistical development environment that we control and an
online, realtime transactional environment that corporate IT
controls.  In the online environment single cases are fetched from a
database with no aggregation capability and fired at the service that
contains the aggregation functionality. We control what happens inside
that service but have close to zero chance of changing anything
outside that service - so in that online environment we have no
possibility of putting aggregation into the datasource DB that feeds
our service.  However, it *might* be reasonable to put an in-memory
database inside our service, purely to take advantage of the
aggregation facilities provided by that IMDB. A single case would get
loaded into the IMDB, the aggregation would be carried out in that
IMDB, the results exported, and the IMDB cleared ready for the next
case. This would make sense if the IMDB query language supported the
aggregations we want in a way our statisticians can use, and the IMDB
is sufficiently lightweight that we can link it into our service as a
function library (rather than a separate server connected by some
communication protocol).

In our statistical development environment things are different. The
source data happens to live in a database, and we query that to get
the subset of cases we are interested in (say, 1M of them). In that
subset, each case can be treated completely in isolation and our
aggregations will use 100% of the component data in each case. An
individual aggregation might touch 20% of the data in one case, but we
might have ~500 different  aggregations from the same case, so every
value gets used in lots of different aggregations.  So although I am
interested in DB query languages as a way of specifying aggregations I
am not so convinced that I would actually use a full-blown DB  to
implement those aggregations.

Cheers

Ross



On Oct 4, 3:24 am, Shantanu Kumar kumar.shant...@gmail.com wrote:
 I looked at Tutorial D - it's pretty interesting. Here are few top-of-
 my-head observations:

 * Which RDBMS do you use? If you are free to choose a new RDBMS,
 probably you can pick one that provides most of the computational
 functionality (as SQL constructs/functions) out of the box. For
 example Oracle, MS SQL Server, PostgreSQL etc. The reason is
 performance - the more you can compute within the database, the less
 amount of data you will need to fetch in order to process.

 * The kinds of computations you need to solve look like a superset of
 what SQL can provide. So, I think you will have to re-state the
 problem in terms of computations/iterations over SQL result-sets,
 which is probably what you are currently doing using the imperative
 language. If you can split every problem in terms of (a) computation
 you need versus (b) SQL queries you need to fire, then you can easily
 do it using Clojure itself without needing any DSL.

 * If you want a DSL for this, I suppose it should make maximum use of
 the database's inbuilt query functions/constructs to maximize
 performance. This also means the DSL implementation needs to be
 database-aware. Secondly, it is possible to write functions in Clojure
 that would emit appropriate SQL clauses (as long as it is doable) to
 compute certain pieces of information. Looking at multiple use cases
 (covering various aspects - fuzzy vs deterministic) will be helpful.

 Regards,
 Shantanu

 On Oct 3, 5:10 pm, Shantanu Kumar kumar.shant...@gmail.com wrote:

  On Oct 3, 1:16 pm, Ross Gayler r.gay...@gmail.com wrote:

   Thanks Michael.

This sounds very similar to NoSQL and Map/Reduce?

   I'm not so sure about that (which may be mostly due to my ignorance of
   NoSQL and Map/Reduce). The amount of data involved in my problem is
   quite small and any infrastructure aimed at massive scaling may bring
   a load of conceptual and implementation baggage that is unnecessary/
   unhelpful.

   Let me restate my problem:

   I have a bunch of statistician colleagues with minimal programming
   skills. (I am also a statistician, but with slightly better
   programming skills.) As part of our analytical workflow we take data
   sets and preprocess them by adding new variables that are typically
   aggregate functions of other values. We source the data form a
   database/file, add the new variables, and store the augmented 

Re: Clojure 1.3 amap/aset issue?

2010-10-04 Thread Sean Corfield
BTW, having updated to the latest snapshot, when I press ctl-D in the
repl, I get this exception:

user= Exception in thread Thread-4 java.lang.RuntimeException:
java.lang.IndexOutOfBoundsException
at clojure.lang.AFn.run(AFn.java:28)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.IndexOutOfBoundsException
at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:132)
at java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:90)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
at leiningen.repl$copy_out_loop.invoke(repl.clj:56)
at leiningen.repl$connect_to_server$fn__823.invoke(repl.clj:74)
at clojure.lang.AFn.run(AFn.java:24)
... 1 more


On Sun, Oct 3, 2010 at 11:32 PM, Sean Corfield seancorfi...@gmail.com wrote:
 On Sun, Oct 3, 2010 at 11:26 PM, ataggart alex.tagg...@gmail.com wrote:
 I don't see what you're seeing for the type-hinted version:
 ...
 Perhaps you need to update your 1.3 install.

 Just ran lein deps on the snapshot to get the latest versions and
 still see the warnings:

-- 
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


evaluation of a function via clojure ...

2010-10-04 Thread Sunil S Nandihalli
Hello everybody,
I am trying to use clojure along with mathematica. Thanks to Clojuratica,
the integration is seamless..
 when I try to execute the following code
(math (SetDelayed (func1 (Pattern x (Blank)))
(With [f 10 g 20]
  (* f (+ g x)
(math (func1 30))
I got
(ClojurianScopes/With [f 10 g 20] (* f (+ 30 g)))

and when I evaluated

(math (Set (func2 (Pattern x (Blank)))
(With [f 10 g 20]
  (* f (+ g x)

(math (func2 30))


I got ...

(ClojurianScopes/With [f 10 g 20] (* f (+ 30 g)))

Adding N/Simplify did not make any difference..

I was expecting 500 in both of those tries..
Can anybody help?
Sunil.

-- 
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

evaluation of a function via mathematica from clojure using the clojuratica bridge...

2010-10-04 Thread Sunil S Nandihalli
I am sorry for reposting .. I realized that the subject line was not very
intelligible .. so I  am changing the subject line and reposting the same
message.

Hello everybody,
I am trying to use clojure along with mathematica. Thanks to Clojuratica,
the integration is seamless..
 when I try to execute the following code
*(math (SetDelayed (func1 (Pattern x (Blank)))*
*(With [f 10 g 20]*
*  (* f (+ g x)*
*(math (func1 30))*
I got
*(ClojurianScopes/With [f 10 g 20] (* f (+ 30 g)))*

and when I evaluated

*(math (Set (func2 (Pattern x (Blank)))*
*(With [f 10 g 20]*
*  (* f (+ g x)*
*
*
*(math (func2 30))*


I got ...

*(ClojurianScopes/With [f 10 g 20] (* f (+ 30 g)))*

Adding N/Simplify did not make any difference..

I was expecting 500 in both of those tries..
 Can anybody help?
Sunil.

-- 
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

International Lisp Conference 2010 - Update

2010-10-04 Thread aml
With the usual apologies to those who receive multiple copies.  This
version contains the schedules of presentations and tutorials.

~~~
   International Lisp Conference 2010
  October 19-21, 2010
 John Ascuaga's Nugget (Casino)
   Reno/Sparks, Nevada, USA (near Lake Tahoe)
Collocated with SPLASH 2010 (OOPSLA  DLS  more)
see also http://splashcon.org as well as
   http://www.dynamic-languages-symposium.org/dls-10/
   In association with ACM SIGPLAN
~~~

The Association of Lisp Users is pleased to announce the 2010
International Lisp Conference, to be held in Reno, Nevada, in
collocation with SPLASH 2010.

This year's program consists of tutorials for beginners and advanced
users, a selection of prominent invited speakers, an excellent
technical session, lightning talks and an open forum.

All ILC and other SPLASH co-located registrants have free admittance
to the ILC tutorials.  Note that these tutorials are double-tracked
across from the early-morning SPLASH keynote addresses.


Schedule:
~

 See also http://www.international-lisp-conference.org/2010/schedule


Tuesday, October 19
~~~

  ILC tutorial: Ernst van Waning
Introduction to Common Lisp, part 1

  SPLASH keynote: Stephanie Forrest
The Case for Evolvable Software

  ILC invited speaker: Dr. Lawrence Hunter
Building a Mind for Life

  ILC invited speaker: Jans Aasman
AllegroGraph and the Linked Open Data Cloud

  Hannes Mehnert
Extending Dylan's Type System for Better Type Inference and Error
Detection

  Shingo Yuasa and Masahiro Yasugi
Validating Low-Level Instructions for Fixnums using BDDs

  Roy Turner
LP/Lisp: Literate Programming for Lisp

  Francois-Rene Rideau and Robert Goldman
ASDF 2: Evolving an API to Improve Social Interactions


Wednesday, October 20
~

  ILC tutorial: Ernst van Waning
Introduction to Common Lisp, part 2

  ILC tutorial: David Margolies
AllegroGraph, Lisp for a NoSQL World

  SPLASH keynote: Benjamin C. Pierce
Art, Science, and Fear

  ILC invited speaker: Marc Feeley
Gambit Scheme: Inside Out

  ILC invited speaker: Peter Seibel
Common Lisp Standardization: The Good, the Bad, and the Ugly

  Tomoharu Ugawa, Hideya Iwasaki, and Taiichi Yuasa
Starvation-free Heap Size for Replication-Based Incremental
Compacting Garbage Collection

  John Maraist
NST: A unit testing system for Common Lisp

  ALU meeting


Thursday, October 21


  ILC tutorial:
Introduction to Common Lisp, part 3

  SPLASH keynote: Kenneth Stanley
Searching Without Objectives

  ILC Invited speaker: Lowell Hawkinson
Lisp for Breakthrough Products

  ILC Invited speaker and SPLASH keynote: Don Syme
F#: Taking Succinct, Efficient, Typed Functional Programming into
the Mainstream

  Didier Verna
CLon, the Command-Line Option Nuker

  Masahiro Yasugi, Tsuneyasu Komiya, Tasuku Hiraishi and Seiji Umatani
Managing Continuations for Proper Tail Recursion

  Lightning talks and open forum


Conference Registration:


  Due to colocation, registration must be done using ILC/SPLASH'10
  unified registration forms available at http://splashcon.org

  Please note that the registration page (page 3) has the option
  SPLASH (OOPSLA/Onward!) selected by default. If you are only
  planning to attend ILC, don't forget to deselect that option.

Travel and Accommodation:
~

  SouthWest Airlines offers low fares into Reno but requires booking
  online at www.southwest.com

  John Ascuaga's Nugget offers reduced rates for ILC participants; see
  http://splashcon.org to obtain the group code; or you can have your
  travel agent look for best bookings (e.g. priceline.com)


Scope:
~~

Lisp is one of the greatest ideas from computer science and a major
influence for almost all programming languages and all sufficiently
complex software applications.

The International Lisp Conference is a forum for the discussion of
Lisp and, in particular, the design, implementation and application of
any of the Lisp dialects.  We encourage everyone interested in Lisp to
participate.


Organizing Committee:
~

 * General Chair:
   JonL White - The Ginger IceCream Factory of Palo Alto, ALU

 * Program Chair:
   Antonio Leitao - Instituto Superior Tecnico/INESC-ID

 * Conference Treasurer:
   Duane Rettig - Franz, Inc., ALU Director

 * Publicity Chair:
   Daniel Herring - ALU Director

 * ALU Treasurer:
   Rusty Johnson - TASC, Inc., ALU Director


Program Committee:
~~

 * Antonio Leitao - Instituto Superior Tecnico/INESC-ID, Portugal
 * Alex Fukunaga - University of Tokyo, Japan
 * Charlotte 

Re: big integers in 1.2 leading to parked processes? (maybe somehow, I think)

2010-10-04 Thread Lee Spector

On Oct 4, 2010, at 3:58 AM, George Jahad wrote:

 Using the CDT I was able to confirm that one of the agents actually is
 generating a run time exception, trying to cast an int from a long.
 Could the perturb function be calling rand-int with a value that is
 too large?  I'm including the stack trace below in case that helps.

Thank you George!

I think this will solve my current problem although I wonder if this points to 
some issues with agent error handling that deserve more attention.

FWIW I had noticed that the exception you found could occur, and in my most 
recent code I have an alternative to rand-int that includes this:

(if (= (type n) java.lang.Integer)
  (. thread-local-random-generator (nextInt n))
  (. thread-local-random-generator (nextInt 2147483647) ;; biggest 
java.lang.Integer

BUT I foolishly forgot to change the call to rand-int in perturb to use this 
alternative, so I was still calling rand-int with something that wasn't a 
java.lang.Integer and that seems like it is indeed the source of the trouble.

I still don't understand why everything continues to chug merrily along in 1.1 
when I hit this error (although other errors in agents would produce a message 
saying that the agent had errors -- not specific but at least something), why 
1.2 hangs without comment (shouldn't the exception produce some sort of 
feedback?), or why I couldn't find a trace of the exception in the Eclipse 
debugger. 

Setting aside the 1.1 mystery for now -- since it's just history anyway -- is 
there a rationale for silencing exceptions in agents and just having calls to 
await hang without comment? I'm not sure what I think should happen in terms of 
continued processing, but it sure would be nice to know that an exception 
occurred and to be shown the details.  

I also look forward to the integration of CDT into Eclipse/ccw :-). Or maybe I 
need to migrate back to emacs, from whence I came (but was lured away by a 
couple nice features of eclipse/ccw...).

Thanks George especially for running the code to diagnose this. It was tricky 
because the bignums only arise in certain situations, although here there is 
actually selection pressure for bignums since bigger arguments to perturb 
increase replication accuracy.

 -Lee

-- 
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


Correct place to put human understandable tests

2010-10-04 Thread sebastien
I write a search application, and to test it I need some util
functions such as test-search to run and see the result. I.e. this
function cannot be created as unit test - there's just no one correct
answer, and only human can understand it. So, test directory is not
the place to put such functions to.
Another way is to put them into source code files itself. But
1) they are not related to the file itself, and I don't want them to
be compiled or loaded at runtime;
2) in these tests for simplicity I use absolute paths for resources on
my disk, and if they will be included in production version,
namespaces may fail to be loaded.

So, the question is: what is the most appropriate place to put such
human understandable tests to?

-- 
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: Clj-DBCP 0.1 - Database Connection Pooling

2010-10-04 Thread Shantanu Kumar
Hi,

I just pushed Clj-DBCP 0.1 to Clojars. It is a Java-6/Clojure wrapper
for the Apache DBCP library. Besides exposing the creation of
connection-pooled datasource, the wrapper also provides API for
embedding databases (in-memory, filesystem, network) such as Apache
Derby, HSQLDB/HyperSQL and H2.

Project page/Tutorial: http://bitbucket.org/kumarshantanu/clj-dbcp/src

Clojars: http://clojars.org/org.bituf/clj-dbcp

Index: http://code.google.com/p/bitumenframework/

Discussion: http://groups.google.com/group/bitumenframework

Comments, feedback and contribution are welcome.

Regards,
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: lispy ways of handling dev mode

2010-10-04 Thread Michael Ossareh
On Sat, Oct 2, 2010 at 22:46, Scott Jaderholm jaderh...@gmail.com wrote:

 On Sat, Oct 2, 2010 at 6:36 PM, Michael Ossareh ossa...@gmail.com wrote:

 What is the recommended manner in which to let your application know its
 on a dev machine?


 I use an environment variable that determines which config (dev,
 production, test) gets loaded.

 APPNAME_CONFIG=development lein swank

 I don't know if it has issues in war deployments or such, I haven't done
 them. If someone knows of problems with this approach I'd be curious to hear
 them.


I ended up using (load-script) - it's the grungy solution in just the right
way :)

It gives me a config namespace, is read from arbitrary locations (provided
by a command line argument) and it contains clojure forms.

-- 
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: SQLRat - A Clojure 1.2 library to access Relational Databases using DataTypes

2010-10-04 Thread nchubrich
Shantanu---

This looks great!  Can you compare it to ClojureQL?  Is it attempting
to do more or less the same thing?  (Not sure what is happening with
ClojureQL right now.)

Thanks,

Nick.

On Aug 31, 1:19 pm, Shantanu Kumar kumar.shant...@gmail.com wrote:
 SQLRat 0.1 GA is pushed to Clojars. Maven/Lein details 
 here:http://clojars.org/org.bituf/sqlrat

 The same is also reflected here:http://code.google.com/p/bitumenframework/

 # Changes and TODO

 ## 0.2 / planned

 - [TODO] Support large sized query result-sets (by adding lazy loading
 option)
 - [TODO] Optimistic locks using time stamps
 - [TODO] DSL for the WHERE clause
 - [] Add :groupby and :orderby arguments to find-xxx functions

 ## 0.1 / 2010-Aug-31 (GMT + 5:30)

 - Entity definitions, meta data, relations
 - CRUD (Create, Retrieve, Update, Delete) functions for entities
 - Small-to-medium sized query result-sets (eager-fetching is the only
 option)
 - Query by COUNT(*) function
 - User can specify columns, WHERE clause in retrieve functions
 - CRUD (Create, Retrieve, Update, Delete) functions for entity-
 relations
 - Avoid N+1 Select

 Feel free to kick the tires and do share your experience/impression.

 Regards,
 Shantanu

 On Aug 18, 11:38 pm, Shantanu Kumar kumar.shant...@gmail.com wrote:

  Hi,

  I have uploaded source code (Apache 2 license) forSQLRat- a library
  for Clojure 1.2 to access relational databases using DataTypes
  (entities). It also lets you define relations between entities and
  navigate them. While this is a part of what typically Object-
  Relational Mapping (ORM) frameworks do, it is not an ORM framework per
  se -- it does not implement State managent, Identity management, Lazy
  loading, Eager fetching etc. The code is quite rough around the edges
  right now and beta-quality at best (at 0.1-SNAPSHOT), but it works
  nevertheless. I intend to release it as GA soon after Clojure 1.2 goes
  GA too.

  The source code is here:http://bitbucket.org/kumarshantanu/sqlrat/

  Discussions can be posted 
  here:http://groups.google.com/group/bitumenframework

  You may also like to keep a tab at 
  this:http://code.google.com/p/bitumenframework/

  The intent of this announcement is to gather feedback, so that I can
  fix as many warts as I can before doing a 0.1 GA release. It is not on
  Clojars yet, but the GA will eventually be there. The most important
  parts to review would be the API it exposes, followed by the
  implementation details. So, I would request you to give the library a
  try, ask questions (I would be happy to answer), give feedback, make
  suggestions and if you can, fork and contribute as well.

  The usage can be found in the dbblog.clj file, which contains the unit
  tests and describes how the library can be used.

  Regards,
  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 1.3 amap/aset issue?

2010-10-04 Thread ataggart
Not sure, but I suspect 'lein deps' doesn't kill your local maven
cache, so you might not actually be getting the latest jar off the
server.  cake has a 'cake deps force' precisely to deal with this
issue.

On Oct 3, 11:32 pm, Sean Corfield seancorfi...@gmail.com wrote:
 On Sun, Oct 3, 2010 at 11:26 PM, ataggart alex.tagg...@gmail.com wrote:
  I don't see what you're seeing for the type-hinted version:
 ...
  Perhaps you need to update your 1.3 install.

 Just ran lein deps on the snapshot to get the latest versions and
 still see the warnings:

 (set! *warn-on-reflection* true)
 ; true
 (defn asum-sq [ ^floats xs]
   (let [^floats dbl (amap xs i ret
              (* (aget xs i)
                  (aget xs i)))]
     (areduce dbl i ret 0
       (+ ret (aget dbl i)
 ; Reflection warning, NO_SOURCE_PATH:2 - call to aclone can't be resolved.
 ; Reflection warning, NO_SOURCE_PATH:2 - call to alength can't be resolved.
 ; Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
 ; Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
 ; Reflection warning, NO_SOURCE_PATH:2 - call to aset can't be resolved.
 ; Reflection warning, NO_SOURCE_PATH:2 - call to alength can't be resolved.
 ; Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
 ; NO_SOURCE_FILE:2 recur arg for primitive local: ret is not matching
 primitive, had: Object, needed: long
 ; Auto-boxing loop arg: ret
 ; Reflection warning, NO_SOURCE_PATH:2 - call to alength can't be resolved.
 ; Reflection warning, NO_SOURCE_PATH:2 - call to aget can't be resolved.
 ; #'user/asum-sq

 Here's the 1.3.0 snapshot files:

 (! 520)- ls lib
 clojure-1.3.0-master-20101002.200208-12.jar     dev                           
                   standalone-1.3.0-20101002.230520-4.jar
 --
 Sean A Corfield -- (904) 302-SEAN
 Railo Technologies, Inc. --http://getrailo.com/
 An Architect's View --http://corfield.org/

 If you're not annoying somebody, you're not really alive.
 -- Margaret Atwood

-- 
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 ClojureCLR converging toward a release?

2010-10-04 Thread Mike K
David, Rich: any further updates on this?

   Mike

On Sep 24, 8:24 am, dmiller dmiller2...@gmail.com wrote:
  Just waiting for that person's CA to be processed by Rich.

-- 
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: SQLRat - A Clojure 1.2 library to access Relational Databases using DataTypes

2010-10-04 Thread Shantanu Kumar


On Oct 5, 2:42 am, nchubrich nchubr...@gmail.com wrote:
 Shantanu---

 This looks great!  Can you compare it to ClojureQL?  Is it attempting
 to do more or less the same thing?  (Not sure what is happening with
 ClojureQL right now.)

Thanks, Nick. From what I understood after reading the blog post[1]
and the sources[2], ClojureQL builds a Clojure-oriented query language
for doing database stuff - the ClojureQL queries you write don't need
to change when you change the database. I think roughly speaking
ClojureQL is like Hibernate's HQL (plus query optimization - prepared
statements). On the contrary SQLRat does not try to build a common
language to talk to all databases - you rather use SQL clauses that
can be readily understood by the database. I guess ClojureQL is to
SQLRat what Hibernate/HQL is to SpringJDBC+primitive_O/R_mapping.

SQLRat uses the concept of database entities - entities can be related
to other entities and SQLRat provides API around that. I created
SQLRat considering the typical workflow for Domain Driven Design and I
was careful to avoid the abstraction-leakiness (that's why didn't
consider state management or entity-identity management). My attempt
is to pick the good parts of O/R mapping (as per my experience) and
put them into SQLRat. ClojureQL does not deal with entities AFAICT.

So, the question is -- is SQLRat doing more or less the same thing as
ClojureQL? Partly yes, but mostly no. There are big parts in both
SQLRat and ClojureQL that are orthogonal, and if ClojureQL can provide
database-agnostic query language at an SQL-clause level (maybe it
already does, I am not sure) rather than constructing only complete
queries I think SQLRat and ClojureQL can be a good combination for
doing database stuff.

By the way, SQLRat 0.2 (release expected very soon) will have an SQL-
clause API[3] that is like Clojure DSL for SQL but then the intent is
not to enable database-agnostic querying there.

[1] 
http://www.bestinclass.dk/index.clj/2009/12/clojureql-where-are-we-going.html
[2] git://gitorious.org/clojureql/clojureql.git
[3] http://bitbucket.org/kumarshantanu/sqlrat/wiki/Clause

Regards,
Shantanu


 Thanks,

 Nick.

 On Aug 31, 1:19 pm, Shantanu Kumar kumar.shant...@gmail.com wrote:



  SQLRat 0.1 GA is pushed to Clojars. Maven/Lein details 
  here:http://clojars.org/org.bituf/sqlrat

  The same is also reflected here:http://code.google.com/p/bitumenframework/

  # Changes and TODO

  ## 0.2 / planned

  - [TODO] Support large sized query result-sets (by adding lazy loading
  option)
  - [TODO] Optimistic locks using time stamps
  - [TODO] DSL for the WHERE clause
  - [] Add :groupby and :orderby arguments to find-xxx functions

  ## 0.1 / 2010-Aug-31 (GMT + 5:30)

  - Entity definitions, meta data, relations
  - CRUD (Create, Retrieve, Update, Delete) functions for entities
  - Small-to-medium sized query result-sets (eager-fetching is the only
  option)
  - Query by COUNT(*) function
  - User can specify columns, WHERE clause in retrieve functions
  - CRUD (Create, Retrieve, Update, Delete) functions for entity-
  relations
  - Avoid N+1 Select

  Feel free to kick the tires and do share your experience/impression.

  Regards,
  Shantanu

  On Aug 18, 11:38 pm, Shantanu Kumar kumar.shant...@gmail.com wrote:

   Hi,

   I have uploaded source code (Apache 2 license) forSQLRat- a library
   for Clojure 1.2 to access relational databases using DataTypes
   (entities). It also lets you define relations between entities and
   navigate them. While this is a part of what typically Object-
   Relational Mapping (ORM) frameworks do, it is not an ORM framework per
   se -- it does not implement State managent, Identity management, Lazy
   loading, Eager fetching etc. The code is quite rough around the edges
   right now and beta-quality at best (at 0.1-SNAPSHOT), but it works
   nevertheless. I intend to release it as GA soon after Clojure 1.2 goes
   GA too.

   The source code is here:http://bitbucket.org/kumarshantanu/sqlrat/

   Discussions can be posted 
   here:http://groups.google.com/group/bitumenframework

   You may also like to keep a tab at 
   this:http://code.google.com/p/bitumenframework/

   The intent of this announcement is to gather feedback, so that I can
   fix as many warts as I can before doing a 0.1 GA release. It is not on
   Clojars yet, but the GA will eventually be there. The most important
   parts to review would be the API it exposes, followed by the
   implementation details. So, I would request you to give the library a
   try, ask questions (I would be happy to answer), give feedback, make
   suggestions and if you can, fork and contribute as well.

   The usage can be found in the dbblog.clj file, which contains the unit
   tests and describes how the library can be used.

   Regards,
   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

Re: [ANN] appengine-magic: using Clojure with Google App Engine

2010-10-04 Thread Glen Stampoultzis
On 21 September 2010 07:15, Constantine Vetoshev gepar...@gmail.com wrote:

 I'd like to announce the release of a working version of appengine-
 magic, a library designed to make it easier to get started with Google
 App Engine using Clojure.
 .. chop ..


I noticed it uses ring out of the box.  I was wondering if this is
compatible with compojure?  There also seems to be a compojure-gae project
floating around so I'm a little confused as to which project I should be
using.

Regards,

Glen

-- 
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