Re: Leiningen Run ?

2009-11-30 Thread Phil Hagelberg
David Nolen writes: > The problem is that JOGL needs JNIs and JNIs need to be on > java.library.path or java.ext.dirs, not the classpath. In order to > make life easier for people learning about clojure as well generally > making lein projects simpler to play around for newbies do people see > an

Query blobs in clojure.contrib.sql?

2009-11-30 Thread Base
Hi I have a database that has a table with complex java objects stored in a binary field. In java i would do something like: protected Object read(byte[] buf){ Object obj = null; if (buf==null) return obj; try { ObjectInputStream objectIn =

Re: Leiningen Run ?

2009-11-30 Thread Alex Osborne
Hi David, David Nolen wrote: > So my Java ignorance once again rears it's ugly head. It turns out > that JNI dynamic libs can't really be part of a .jar. I can't say I know much about JNI but I've used some libraries like SQLiteJDBC and Qt Jambi which bundle the native libraries in the jar, so th

Leiningen Run ?

2009-11-30 Thread David Nolen
So my Java ignorance once again rears it's ugly head. It turns out that JNI dynamic libs can't really be part of a .jar. Say for example that you want to build a JOGL Clojure project. Then your project file looks something like this: (defproject gears "0.1.0" :description "OpenGL Gears" :repos

Re: 'cheap' embedded dbs?

2009-11-30 Thread Alex Osborne
Raoul Duke wrote: > what do people use for doing in-memory simple dbs? like, do people > just use persistent maps, or do they go out and use derby or > something? > Sean Devlin's suggested a contrib library which adds a bunch of functions for working with maps. Have a look at this thread on the

Re: 'cheap' embedded dbs?

2009-11-30 Thread Raoul Duke
On Mon, Nov 30, 2009 at 5:07 PM, Raoul Duke wrote: > what do people use for doing in-memory simple dbs? like, do people > just use persistent maps, or do they go out and use derby or > something? some relevant things: http://osdir.com/ml/clojure/2009-09/msg00404.html cupboard datalog k,v wrapper

Datatypes and protocols - update

2009-11-30 Thread Rich Hickey
An updated version of the code for datatypes[1] and protocols[2] is now available in the 'new' branch[3]. I have done a lot of work on performance, and refined the design. The big news is that you can now directly implement a protocol inside a deftype, and you can also reify protocols. This cement

Re: Continuation monad tutorial

2009-11-30 Thread pmf
On Nov 30, 11:07 pm, jim wrote: > Just finished the tutorial explaining the continuation monad in > clojure. Haven't even proofed it but I want to head to the gym. :) > > http://intensivesystems.net/tutorials/cont_m.html This is great stuff; thanks! -- You received this message because you are

LISP like DSLs

2009-11-30 Thread chris
I am creating a DSL that has clojure-LISP syntax. I thought briefly that the read function would be ideal for reading the files for this DSL but I would need line and character numbers attached to every item read from the file so I can give good error feedback. "read" doesn't appear to be the ans

'cheap' embedded dbs?

2009-11-30 Thread Raoul Duke
what do people use for doing in-memory simple dbs? like, do people just use persistent maps, or do they go out and use derby or something? e.g. (def db1 {0 "a" 1 "b"}) (def db2 {0 "ayh" 1 "bee"}) (def dbJoin-1-2 {0 0 1 1}) (defn lookup-forward [db1 db2 dbj key] (let [key2 (get dbj key)] (lis

Re: Small problem: convert [a b c d] into [[[a b] c] d]

2009-11-30 Thread samppi
Dang. I forgot about reduce. Thanks a lot for the really quick answer! On Nov 30, 3:45 pm, Martin DeMello wrote: > On Tue, Dec 1, 2009 at 4:09 AM, samppi wrote: > > The title says it all. Is there a nice, concise, Clojurey way to > > convert a vector [a b c d] into [[[a b] c] d]? It's fine if th

Re: Small problem: convert [a b c d] into [[[a b] c] d]

2009-11-30 Thread Martin DeMello
On Tue, Dec 1, 2009 at 4:09 AM, samppi wrote: > The title says it all. Is there a nice, concise, Clojurey way to > convert a vector [a b c d] into [[[a b] c] d]? It's fine if the > vectors are sequences instead. I can't think of a way without a loop, > but I suspect there's a much shorter way. us

Small problem: convert [a b c d] into [[[a b] c] d]

2009-11-30 Thread samppi
The title says it all. Is there a nice, concise, Clojurey way to convert a vector [a b c d] into [[[a b] c] d]? It's fine if the vectors are sequences instead. I can't think of a way without a loop, but I suspect there's a much shorter way. -- You received this message because you are subscribed

Continuation monad tutorial

2009-11-30 Thread jim
Just finished the tutorial explaining the continuation monad in clojure. Haven't even proofed it but I want to head to the gym. :) http://intensivesystems.net/tutorials/cont_m.html -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: leiningen - a Clojure build tool

2009-11-30 Thread Mark Derricutt
When I finally get around to working on my clojure polyglot implementation for maven 3 I'll probably be basing my project structure off of leiningen, which should mean anything IDE using maven should work with the project file. Sadly I'm still trying to nail down some time to look at this project

Re: reduce with-precision using BigDecimal

2009-11-30 Thread Joseph Smith
I see- Sounds like we're on the same page. :) --- Joseph Smith j...@uwcreations.com (402)601-5443 On Nov 30, 2009, at 11:14 AM, John Harrop wrote: > On Mon, Nov 30, 2009 at 7:07 AM, Joseph Smith > wrote: > setScale returns a new BigDecimal with a given scale, it does not > change the ori

Re: roll call of production use?

2009-11-30 Thread prhlava
Hello, > i'd be interested to hear who has successfully used clojure in > production. i know of some, as some folks have been vocal; any other > interesting-but-so-far-silent uses people'd be willing to fess up > about? I have done a smallish project (mainly to stop my friend doing some monkey w

How to use/refer to multiple Clojure classes

2009-11-30 Thread Dan Kefford
OK... I'm trying to take Clojure for a spin on Project Euler problems. I have source files for each problem that I have solved and although I can refer to and invoke any one of them explicitly from a main class, I cannot seem to figure out how to refer to them all at once so that I can choose to ru

Re: reduce with-precision using BigDecimal

2009-11-30 Thread John Harrop
On Mon, Nov 30, 2009 at 7:07 AM, Joseph Smith wrote: > setScale returns a new BigDecimal with a given scale, it does not change > the original value. > I did not claim otherwise. The effect of with-precision is like an implicit (.setScale foo) around every BigDecimal "foo", only more efficient s

clojure developer job in florida

2009-11-30 Thread Martin Flack
Hi all, I hope you don't mind a Clojure job ad on the group - please let me know if there's an official place for Clojure job ads. I'm the CTO of Velocitude and we have a job opening for Clojure Developer in Fort Lauderdale, Florida. Velocitude is doing interesting things in the mobile web space

uploading file(s) to the "Files" section of this group

2009-11-30 Thread prhlava
Hello, What is the correct way these days to upload a file to the "Files" section of the Clojure google group? I checked the info on the group, it looks that only "managers" can upload files, but how do I do this (i.e. who do I send the files to)? The files in question are small bugfixes to the

Re: "arithmetic" change between 1.0.0 and 1.1. 0

2009-11-30 Thread prhlava
Hello Steve, > As an alternative to the code you posted, for positive integers n and m, >         (int (Math/floor (/ n m)) > is equivalent to >         (quot n m) > If negative values are possible, you could write a function based on quot > that would give the appropriate answer in all cases.

Re: Web application framework (beta)

2009-11-30 Thread jim
Jim, I think I can see how to write a library that would scale across any number of servers and I don't think it would be too difficult. I've got other itches to scratch before I'd get to it, but if people started asking for it (or someone wanted to sponsor the work) I might decide to do it sooner

Re: ANN: Web application framework (beta)

2009-11-30 Thread Jim Powers
Re: not all web applications have to scale - true, but I haven't worked on one of those since about 1998 (this is an analog to Rich Hickey's statement about not having to build non-concurrent programs in the last N years), including "admin-like" things. Further: once you build all those non-continu

Re: reduce with-precision using BigDecimal

2009-11-30 Thread Joseph Smith
setScale returns a new BigDecimal with a given scale, it does not change the original value. e.g.) user=> (def mybd (BigDecimal. 40)) #'user/mybd user=> (.setScale mybd 4) 40.M user=> mybd 40M --- Joseph Smith j...@uwcreations.com (402)601-5443 On Nov 30, 2009, at 12:00 AM, John Harro

Re: ANN: Web application framework (beta)

2009-11-30 Thread Joel Westerberg
Not every web application has to scale. I think that continuation based stuff rocks for adminstration interfaces. The main benefit with continuation based stuff, is that it's possible to build something that is more application like, so that one can avoid building wizards, and having to split up s

Re: reduce with-precision using BigDecimal

2009-11-30 Thread John Harrop
On Mon, Nov 30, 2009 at 12:22 AM, Joseph Smith wrote: > What you want is to set the 'scale' of the BigDecimal. > > There doesn't seem to be a nice clojure macro for it, but this works: >user=> (.setScale (reduce + [15.00M 15.01M 3.00M 3.01M]) 3) >36.020M > That's what with-precision does