Re: ANN: ClojureQL 1.0.0 finally released as public beta

2010-11-30 Thread Janico Greifenberg
On Tue, Nov 30, 2010 at 12:00 PM, LauJensen wrote: > @Janico: > > Since we allow strings as arguments to most functions, I think you > could simple express it like so: > > clojureql.core> (defn st-intersects [loc poly] >                      (format "ST_Intersects(%s, > ST_GeographyFromText('SRID=

Re: ANN: ClojureQL 1.0.0 finally released as public beta

2010-11-27 Thread Janico Greifenberg
First of all, thank you for this awesome library. I'm experimenting with ClojureQL for accessing Postgis, the spacial extender for Postgres. To improve the ClojureQL for this use case, it would be useful to have a way to add custom predicates. For example to find all places whose location column i

Re: How to convert a sequence to a byte[]?

2010-08-10 Thread Janico Greifenberg
By into-array default, into-array returns an array of the capital-B Bytes (that's what the cryptic [Ljava.lang.Byte; in the error message means). To get an array of primitive bytes (the class being printed as [B), you can pass the type as additional parameter (into-array Byte/TYPE mybytes) On Tue

Re: Aleph and Conjure

2010-07-21 Thread Janico Greifenberg
On Wed, Jul 21, 2010 at 4:11 PM, Marko Kocić wrote: > Something like ring-aleph-adapter, however trivial it might be to > implement, will help in seamlessly switching existing applications to > aleph/netty. But why would that be useful? Maybe I'm missing something here, but I thought the idea beh

Re: On laziness and with-open

2009-07-09 Thread Janico Greifenberg
Hi Mike, On Thu, Jul 9, 2009 at 12:10 PM, Mike wrote: > > I wanted to grab bytes out of a stream, and didn't see an analogue to > reader from duck-streams, so I made my own: > > (defn byte-seq >  "Returns the bytes from stream as a lazy sequence of ints. >  stream must implement java.io.InputStre

Re: Designing an SQL-based application

2009-05-12 Thread Janico Greifenberg
dy))) >> >> Kind regards, >> >> Victor Rodriguez. >> >> > Approach #3:  This is a good approach once you hit the limits of the >> > first approach, and before you move on to the second approach. >> >> > I've written SQL apps in Clojur

Designing an SQL-based application

2009-05-11 Thread Janico Greifenberg
Hi, I'm writing an RSS-reader using compojure and clojure.contrib.sql. As this is my first project in a functional language, I'm not sure about how to design the application. The concrete question I'm having right now, is how to encapsulate database queries in functions. For my RSS-reader, a basi

Unexpected behavior of 'if' with Boolean objects

2009-05-03 Thread Janico Greifenberg
Hi, I encountered unexpected behavior of the 'if' form in clojure when using instances of java.lang.Boolean as the condition. I wanted to convert input strings to booleans and used the constructor of the Boolean class with the string parameter. However, when I pass these values as a condition