Re: JDBC Timezone Issue

2012-08-09 Thread Jestine Paul
Given that the patch just provides a way for users to tell the library these columns are special, it seems like you might just as well map a column adjustment function over the result set yourself? It feels very clunky. The JDBC library requires us to treat these columns special. If we

Re: ANN lein-expectations 0.0.7

2012-08-09 Thread Jay Fields
If you like Midje you should probably stick with it. The two libraries were designed with very different goals in mind. Midje is much more polished and targeted adoption early on. expectations was created for testing the application I was working on, made available on github, but never really

drawing a chess-board with seesaw ...

2012-08-09 Thread Jim - FooBar();
Hey all, Spent most of yesterday trying to draw a chessboard on a paintable canvas, however I'm stuck after drawing the lines of the grid...I mean the grid is there but its all one colour (the background colour of the panel)! The fn that draws the lines is simply this: (defn draw-grid [c g]

Re: drawing a chess-board with seesaw ...

2012-08-09 Thread Stathis Sideris
How about drawing all the rectangles with .fillRect()http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics.html#fillRect%28int,%20int,%20int,%20int%29and before each call alternate between black and white by calling

Re: drawing a chess-board with seesaw ...

2012-08-09 Thread Jim - FooBar();
On 09/08/12 10:08, Stathis Sideris wrote: How about drawing all the rectangles with .fillRect() http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics.html#fillRect%28int,%20int,%20int,%20int%29 and before each call alternate between black and white by calling .setColor()

Re: drawing a chess-board with seesaw ...

2012-08-09 Thread Jim - FooBar();
On 09/08/12 11:17, Jim - FooBar(); wrote: On 09/08/12 10:08, Stathis Sideris wrote: How about drawing all the rectangles with .fillRect() http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics.html#fillRect%28int,%20int,%20int,%20int%29 and before each call alternate between black and

Re: drawing a chess-board with seesaw ...

2012-08-09 Thread Jim - FooBar();
On 09/08/12 11:23, Jim - FooBar(); wrote: aaa ok sorry...you mean having it as doseq binding...that makes sense! I apologise for rushing... Jim No I can't put 'cycle' inside a doseq cos its trying to consume it! Jim -- You received this message because you are subscribed to the Google

Re: drawing a chess-board with seesaw ...

2012-08-09 Thread David Powell
You can try using the multi-input version of map to knit your data together with some other, potentially infinite, sequence: (map vector items (cycle [black white])) It returns something like this: ([item1 black] [item2 white] [item3 black] [item4 white]) Then you can use doseq over that,

Re: drawing a chess-board with seesaw ...

2012-08-09 Thread Jim - FooBar();
On 09/08/12 12:00, David Powell wrote: You can try using the multi-input version of map to knit your data together with some other, potentially infinite, sequence: (map vector items (cycle [black white])) It returns something like this: ([item1 black] [item2 white] [item3 black] [item4

Re: Attractive examples of function-generating functions

2012-08-09 Thread Chris Ford
I use quite a few of these in my Overtone rendering of Bachhttp://skillsmatter.com/podcast/home/functional-composition : ; Defining a scale function from intervals (defn sum-n [series n] (reduce + (take n series))) (defn scale [intervals] (fn [degree] (if-not (neg? degree) (sum-n

Is this expected of seesaw ?

2012-08-09 Thread Jim - FooBar();
Hi again, I'm having a couple of issues with seesaw and I'd like to see the community's experience with it... 1. First of all, my lein repl hangs each time I reload a namespace that uses seesaw.core. Not when I first load it (load-file blah...blah), but when I reload it after some

Re: Is this expected of seesaw ?

2012-08-09 Thread Meikel Brandmeyer (kotarak)
Hi, Am Donnerstag, 9. August 2012 14:10:55 UTC+2 schrieb Jim foo.bar: 1. First of all, my lein repl hangs each time I reload a namespace that uses seesaw.core. Not when I first load it (load-file blah...blah), but when I reload it after some changes...this is really a problem

Re: drawing a chess-board with seesaw ...

2012-08-09 Thread Stathis Sideris
Yeah, sorry Dimitri, I wasn't very clear :-) I meant that if you were going to do it recursively you would be using the first element of the seq, and you would be passing the (rest) of the seq to the subsequent recursive call. Very elegant solution! On Thursday, 9 August 2012 12:29:12 UTC+1,

Re: Is this expected of seesaw ?

2012-08-09 Thread Jim - FooBar();
On 09/08/12 13:39, Meikel Brandmeyer (kotarak) wrote: (config! your-frame :size [x :by y]) yep! that does the trick... thanks a lot Meikel! are you 'using' or 'requiring' seesaw.core in your projects? the same thing happens (repl hangs) when i cose my frame and try to open up a new one!

Why does (conj (transient {}) {}) fail with CCE?

2012-08-09 Thread Jacek Laskowski
Hi, I've been digging into the sources of Clojure and found frequencies. There's the transient function and I thought I'd use it with a map and conj. Why does this fail? user= (conj {} {:y 1}) {:y 1} user= (conj (transient {}) {:y 1}) ClassCastException [trace missing] I ran into the issue

Re: Why does (conj (transient {}) {}) fail with CCE?

2012-08-09 Thread dennis zhuang
you must use conj! instead of conj. 在 2012-8-9 PM8:49,Jacek Laskowski ja...@japila.pl写道: Hi, I've been digging into the sources of Clojure and found frequencies. There's the transient function and I thought I'd use it with a map and conj. Why does this fail? user= (conj {} {:y 1}) {:y 1}

Re: Why does (conj (transient {}) {}) fail with CCE?

2012-08-09 Thread Baishampayan Ghose
On Thu, Aug 9, 2012 at 6:19 PM, Jacek Laskowski ja...@japila.pl wrote: What's the rationale behind TransientArrayMap *not* being a IPersistentCollection? A transient map can't be a persistent map at the same time. You need to use the transient version of conj, called conj! to conjoin something

New to Clojure, need some help

2012-08-09 Thread Jason Long
I am trying to remove every occurrence of a given element from a vector. I can use (filter #(== % a) v) where 'a' is the value to be removed and 'v' is the vector, but this returns 'a' and 'a' is the value i want to remove. So, how can i do this? I tried replacing 'filter' with 'remove' but it

Re: New to Clojure, need some help

2012-08-09 Thread Baishampayan Ghose
Hi, Does this work for you? (remove #{:a} [:a :b :a :c :d :e]) Also, if you have a list of items you can have all of them in the same set/predicate like so - (remove #{:a :z :x} [:a :b :a :c :d :e :z :b :d :e :x :z]) Hope this helps. Regards, BG On Thu, Aug 9, 2012 at 10:11 AM, Jason Long

Re: New to Clojure, need some help

2012-08-09 Thread Timothy Baldridge
To clarify Baishampayan's code, hash-sets in Clojure are functions: = (#{1} 1) 1 = (#{1} 2) nil Nil and false in Clojure are the same thing, So Baishampayan's example: (remove #{:a :z :x} [:a :b :a :c :d :e :z :b :d :e :x :z]) #{:a :z : x} will return nil if the value is not in the vector,

Re: New to Clojure, need some help

2012-08-09 Thread Baishampayan Ghose
On Thu, Aug 9, 2012 at 10:11 AM, Jason Long jsnl...@gmail.com wrote: Also, can anyone tell me why != is not included for equality testing, that would make this problem easy. To answer your other question, != in Clojure is called not= Regards, BG -- Baishampayan Ghose b.ghose at gmail.com --

Re: Is this expected of seesaw ?

2012-08-09 Thread Meikel Brandmeyer (kotarak)
Hi, Am Donnerstag, 9. August 2012 14:43:57 UTC+2 schrieb Jim foo.bar: are you 'using' or 'requiring' seesaw.core in your projects? I usually do (require '[seesaw.core :as swing]). the same thing happens (repl hangs) when i cose my frame and try to open up a new one! this is weird yes?

Re: Clojure group in DFW area

2012-08-09 Thread Alex Robbins
The group hasn't met in a long time, but we were actually talking about some kind of a relaunch last week. We were hoping some Clojure interest had increased in the DFW area since we tried last time. Anyone else in the DFW area interested in getting together? Alex On Tue, Aug 7, 2012 at 11:09

reduce-kv doesn't reduce a sorted-map in order

2012-08-09 Thread Baishampayan Ghose
Hi, It seems reduce-kv doesn't reduce a sorted-map in the correct order. Example - user (def *sm (into (sorted-map) {:aa 1 :zz 2 :bb 3 :yy 4 :cc 5 :xx 6})) ;= #'user/*sm user *sm ;= {:aa 1, :bb 3, :cc 5, :xx 6, :yy 4, :zz 2} ;; plain reduce user (reduce (fn [ret e] (conj ret e)) [] *sm) ;=

Re: Why does (conj (transient {}) {}) fail with CCE?

2012-08-09 Thread Jacek Laskowski
On Thu, Aug 9, 2012 at 2:54 PM, Baishampayan Ghose b.gh...@gmail.com wrote: A transient map can't be a persistent map at the same time. You need to use the transient version of conj, called conj! to conjoin something into a transient map and then use persistent! to get a persistent version

Ideas for interactive tasks

2012-08-09 Thread Nikita Beloglazov
Hello I'm going to organize little clojure course at my university this year. For this I want to implement set of tasks that hopefully will help to practise clojure. Tasks will be animated so students can see how their solutions work. E.g. one of the tasks is to hit plane by missile: there is

Re: Ideas for interactive tasks

2012-08-09 Thread Jim - FooBar();
On 09/08/12 16:21, Nikita Beloglazov wrote: I'm going to organize little clojure course at my university this year. this is amazing! seriously, bravo! what university is this? Jim -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: Ideas for interactive tasks

2012-08-09 Thread Nikita Beloglazov
Thank you, Jim. This is Belarusian State University. On Thu, Aug 9, 2012 at 6:23 PM, Jim - FooBar(); jimpil1...@gmail.comwrote: On 09/08/12 16:21, Nikita Beloglazov wrote: I'm going to organize little clojure course at my university this year. this is amazing! seriously, bravo! what

Re: Clojure group in DFW area

2012-08-09 Thread James Ashley
I just moved to the DFW area, and I'm curious about these meetings as well. Is anything going on with them? On Tuesday, August 7, 2012 11:09:05 AM UTC-5, VishK wrote: Hello, Is this group still meeting? (When?) Would be interested in attending the next one if possible to meet like-minded

Re: basic question , clojure io

2012-08-09 Thread Stuart Sierra
No, there is no language-level distinction between pure functions and functions which perform side effects. In practice, it is a good idea to keep them separate. -S On Tuesday, August 7, 2012 9:37:31 AM UTC-4, centaurian_slug wrote: does clojure have a strict split between side-effects and

Re: Attractive examples of function-generating functions

2012-08-09 Thread hyPiRion
On Wednesday, August 8, 2012 6:48:23 PM UTC+2, Brian Marick wrote: ... show the mechanics, but I'm looking for examples that would resonate more with an object-oriented programmer. Such examples might be ones that close over a number of values (which looks more like an object), or

Re: Attractive examples of function-generating functions

2012-08-09 Thread Jonah Benton
You've probably seen these, but if not, Doug Crockford's video series on javascript walks through a number of interesting information sharing examples like the ones you're looking for using fn-generating-fns- http://yuiblog.com/crockford/ They're all great but act 3 - function the ultimate is

Re: DAG (Direct Acyclic Graph) and Bayesian Network help

2012-08-09 Thread Alexsandro Soares
Hi Simone, You can look at the code made ​​by Cory Giles at https://github.com/gilesc/factor-graph Good luck. Alexsandro 2012/7/14 Simone Mosciatti mweb@gmail.com Hi guys, I'm trying to develop a Bayesian Network just for fun XD My first problem is to understand how