Re: Exception handling changes in Clojure 1.3.0

2011-10-09 Thread Constantine Vetoshev
I finally came up with a simple example which shows the broken exception handling behavior I described in my earlier post on this thread. (defn broken-catch [filename] (try (java.io.FileReader. filename) (catch java.io.FileNotFoundException fnfe FileNotFoundException caught)

Google Maps in Clojurescript

2011-10-09 Thread Sam Ritchie
Hey all, I started playing with Clojurescript tonight, and couldn't quite figure out how to access an external library -- specifically the Google Maps API -- from within a clojurescript project. I can download maps.js, but how do I go about including it in a project? Thanks, -- Sam Ritchie,

Re: clojure.contrib.base64

2011-10-09 Thread Ray Miller
On 6 October 2011 19:38, Ray Miller r...@1729.org.uk wrote: Incidentally, I used the Apache Commons Base64 encoder, as the one in contrib was producing different results from the Apache Commons and Perl implementations. Perhaps a bug? Here's the problem I alluded to above. I'm trying to

Re: Google Maps in Clojurescript

2011-10-09 Thread r0man
Hi Sam, this is how I use Google Maps with Clojurescript. In the html page I load Google's Loader library, the Google Closure base.js file and the deps.js file which is the one cljsc spit out. (defhtml javascripts [] (html (include-js (str https://www.google.com/jsapi?key=;

Re: Google Maps in Clojurescript

2011-10-09 Thread r0man
Forgot to mention my init-map fn: (defn init-map [element] (let [options (h/clj-js {:zoom 1 :mapTypeId google.maps.MapTypeId.ROADMAP}) parent-size (style/getSize (. element parentNode)) element-size (style/getSize element) map (doto (google.maps.Map. element options)

Re: Oxjure - Oxford Clojure Group

2011-10-09 Thread Si
I'm not often in the UK, but when I am, I'm in the Thames Valley. It would be great to have an Oxford Clojure group I could meet up with. On Oct 8, 1:49 pm, Folcon fol...@gmail.com wrote: Hi Everyone, I'm interested in seeing if there are enough people in Oxford, United Kingdom to start an

Re: Anyone have any tips on functional - relational db data mapping?

2011-10-09 Thread Base
Can you create a db view for this? I have often tried to build this sort of thing into the db as much as possible to reduce the complexity of the app code and since this Ultimately what db's do well. Of course if you don not have create rights in the db you can't do that... On Oct 7, 7:55 am, Si

Is there a clojure counterpart for java.lang.String indexOf method?

2011-10-09 Thread jingguo
java.lang.String has a method called indexOf(String str). We can use it with clojure in the following way: (.indexOf 012 12) Does clojure has a API for this? I have checked clojure.core and clojure.string. It seems that clojure does not have a counterpart for indexOf. -- You received this

Re: Is there a clojure counterpart for java.lang.String indexOf method?

2011-10-09 Thread Stephen Compall
On Sun, 2011-10-09 at 07:36 -0700, jingguo wrote: Does clojure has a API for this? I have checked clojure.core and clojure.string. It seems that clojure does not have a counterpart for indexOf. No, it doesn't. There's usually a way to do string operations that you traditionally do with

Re: Anyone have any tips on functional - relational db data mapping?

2011-10-09 Thread Si
I have free reign over the db. I think a view would simplify the join approach from the app perspective, and this might be a good idea when the db is normalizing data not needed to be seen by the app as separate objects, but I sense a snag with join. It would work for 1-1 relationships, but for

Stanford Dabatabase Class Begins Tomorrow

2011-10-09 Thread Harrison Maseko
The Stanford Introduction to Databases class officially starts tomorrow, October 10, 2011. I have enrolled and look forward to this nine-week online course. I was wondering if anyone on this list is taking it. It will be encouraging to know I am not the only Clojure programmer doing this!? -h. --

Re: clojure.contrib.base64

2011-10-09 Thread Teemu Antti-Poika
On Oct 9, 12:56 pm, Ray Miller r...@1729.org.uk wrote: On 6 October 2011 19:38, Ray Miller r...@1729.org.uk wrote: Incidentally, I used the Apache Commons Base64 encoder, as the one in contrib was producing different results from the Apache Commons and Perl implementations. Perhaps a bug?

Re: clojure.contrib.base64

2011-10-09 Thread Ray Miller
On 9 October 2011 20:13, Teemu Antti-Poika antti...@gmail.com wrote: On Oct 9, 12:56 pm, Ray Miller r...@1729.org.uk wrote: On 6 October 2011 19:38, Ray Miller r...@1729.org.uk wrote: Incidentally, I used the Apache Commons Base64 encoder, as the one in contrib was producing different

ANN: core.match 0.2.0-alpha5

2011-10-09 Thread David Nolen
I've removed some fairly big bugs in the algorithm. This will probably the be the last alpha release before I cut a beta. Would love to hear any and all feedback. In particular if people have strong opinions about the remaining issues, let me know now - http://dev.clojure.org/jira/browse/MATCH

Re: ANN: core.match 0.2.0-alpha5

2011-10-09 Thread Daniel Pittman
On Sun, Oct 9, 2011 at 12:31, David Nolen dnolen.li...@gmail.com wrote: I've removed some fairly big bugs in the algorithm. This will probably the be the last alpha release before I cut a beta. Would love to hear any and all feedback. In particular if people have strong opinions about the

Re: Stanford Dabatabase Class Begins Tomorrow

2011-10-09 Thread Andreas Kostler
I am :) On 10 October 2011 04:02, Harrison Maseko lis...@gmail.com wrote: The Stanford Introduction to Databases class officially starts tomorrow, October 10, 2011. I have enrolled and look forward to this nine-week online course. I was wondering if anyone on this list is taking it. It will

Re: Oxjure - Oxford Clojure Group

2011-10-09 Thread Folcon
A real world group was more what I had in mind :). Similar to Seajure etc. @Si you are welcome to anything we manage to setup, though I am hoping we will get more interest over the week :). I'm trying to work out a good/convenient place for the gathering. Preferably with a table for laptop

Re: Stanford Dabatabase Class Begins Tomorrow

2011-10-09 Thread Claudia Zignaigo
I am, too! :) 2011/10/9 Andreas Kostler andreas.koest...@leica-geosystems.com I am :) On 10 October 2011 04:02, Harrison Maseko lis...@gmail.com wrote: The Stanford Introduction to Databases class officially starts tomorrow, October 10, 2011. I have enrolled and look forward to this

Re: ANN: core.match 0.2.0-alpha5

2011-10-09 Thread Alan Malloy
On Oct 9, 12:31 pm, David Nolen dnolen.li...@gmail.com wrote: I've removed some fairly big bugs in the algorithm. This will probably the be the last alpha release before I cut a beta. Would love to hear any and all feedback. - clojure.core.match instead of clojure.core.match.core Those both

Re: Spread work onto multiple threads (in pure Clojure)

2011-10-09 Thread Lee Spector
I've been playing with medusa and it sometimes does what I expect, but sometimes it's doing something strange and I'm wondering if someone can help me to do one specific medusa-like thing but more simply (and without the strangeness, which I haven't fully traced but I hope to avoid having to).

where can I find the official statement about changes from 1.2 to 1.3?

2011-10-09 Thread jaime
When I tried to answer a question (from other people) about why in 1.3 we need to explicitly declare ^:dynamic for a Var, I found I cannot find an official document about this change from 1.2 (or older version) to 1.3. I went to github (https://github.com/clojure/clojure/ blob/master/changes.md)

Re: Oxjure - Oxford Clojure Group

2011-10-09 Thread jaime
Got it. :-) On Oct 9, 11:00 am, jaime xiejianm...@gmail.com wrote: Why not use this group directly?? I personally think separating people in different groups will disperse people's attention only.what is the benefit? On Oct 8, 7:49 pm, Folcon fol...@gmail.com wrote: Hi

How to Collapse Nested Map into a Sequence of Flat Maps

2011-10-09 Thread Ari
Hi, I'd appreciate suggestions and insights on how I can collapse a nested map with n number of keys (levels) to create a flat map which is comprised of composite keys and a value. For example, let's say we have: { a { 2011 [ [ a 2011 ari] [ a 2011 dan] ] } { 2010 [ [ a 2010 jon] ] } } I'd like

Re: How to Collapse Nested Map into a Sequence of Flat Maps

2011-10-09 Thread Alan Malloy
Your input isn't a legal Clojure form, and the correlation between input and output is difficult to spot, so it is hard to guess what you mean. Try a simpler example, preferably with less repetition of similar-looking values. On Oct 9, 5:34 pm, Ari ari.brandeis.k...@gmail.com wrote: Hi, I'd

Re: clojure.contrib.base64

2011-10-09 Thread Stuart Sierra
The original clojure.contrib.base64 was little more than an exercise. This is the kind of thing that Java libraries do well; don't see much point to rewriting in Clojure unless somebody clever can make one that's actually *faster* than the best Java lib. -S -- You received this message

Re: ANN: core.match 0.2.0-alpha5

2011-10-09 Thread Ambrose Bonnaire-Sergeant
On Mon, Oct 10, 2011 at 3:31 AM, David Nolen dnolen.li...@gmail.com wrote: - return nil instead of throwing if no match found to mirror the behavior of cond I don't like this. Why are we emulating cond? clojure.core/case, for example, seems closer to what `match` provides, and that throws an

inconsistent results from String.valueOf

2011-10-09 Thread Jack Moffitt
Hi, I discovered this testing some code this evening: (String/valueOf nil) ; throws NullPointerException (#(String/valueOf %) nil) ; null Another formulation of the above (courtesy of brehaut in IRC): (let [s nil] (String/valueOf s)) ; exception (let [s nil] (String/valueOf ^Object s)) ; null

Re: Stanford Dabatabase Class Begins Tomorrow

2011-10-09 Thread Harrison Maseko
Great! Hope we'll cross paths on the forums. -h. On Oct 10, 1:12 am, Claudia Zignaigo claudia.doppiosl...@gmail.com wrote: I am, too! :) 2011/10/9 Andreas Kostler andreas.koest...@leica-geosystems.com I am :) On 10 October 2011 04:02, Harrison Maseko lis...@gmail.com wrote: The