Re: clojure.inspector.inspect-table gives up when first element is nil...

2012-06-18 Thread Jim - FooBar();
#(when-not (nil? %) %) data) it should work like a charm! Unfortunately i don't have a CA! Jim On 18/06/12 22:58, Jim - FooBar(); wrote: First of all thanks both of you...As far as the tests go It is ridiculously easy to reproduce the 'bad behaviour' simply by passing a

memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
ed as well? Jim -- 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 t

Re: memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
This is really impressive!!! From 61ms it went down to 0.8ms !!! doing this is way faster than records I think...and since the fn I memoized takes no args it can't be cached more than once yes? Jim ps: my second question can be considered reduntant...I meant to say that some of the ke

Re: memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
Is there a catch to this that I'm not seeing? It seems to work just fine...after all the fn always returns the same thing (which always has the same values in)... Jim On 19/06/12 12:57, Jim - FooBar(); wrote: This is really impressive!!! From 61ms it went down to 0.8ms !!! doing this i

Re: memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
:record-name "Clondie24.checkers.CheckersPiece" :mappings board-mappings-checkers :north-player-start (starting-checkers true) :south-player-start (starting-checkers false)} Jim -- You received this message because you ar

Re: memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
particular slot returns a var that holds an atom...do you mean that the same atom value will be returned forever even though the actual atom will have been swapped! or resetted! ? Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
On 19/06/12 13:27, Jim - FooBar(); wrote: On 19/06/12 13:06, Tassilo Horn wrote: But I don't think the above applies to your usecase. Can it be that the function constructs the returned map by inspecting the value of some ref/atom or the current-phase-of-moon or so? In that case, you

Re: memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
On the other hand I am not dereferencing the atom inside the map so i'm not 'inspecting it' as you said before...just returning the var...dereferencing happens elsewhere (when moving for example)... Jim On 19/06/12 13:31, Jim - FooBar(); wrote: On 19/06/12 13:27, Jim - FooBa

Re: memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
For my use-case both memoize and constantly have the same effect with memoize being slightly faster [1]...since the atom is not being dereferenced in the map all is good! new states are being updated and logged just fine... Jim [1] --> without anything a move takes roughly 50-70

Re: memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
I have to deref some it seems as if there is more going on than what it actually is...constantly or memoize work great in my case because the map holds essentially constants...ok the atom is not a constant but it works just fine (provided that it will be deref-ed outside the map)... Jim ps:th

Re: memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
e constants, I certainly don't want to construct it from scratch every time... Jim -- 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

Re: memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
(If i defn/declare)...the only way is to have defn in both places... Jim On 19/06/12 13:30, Ambrose Bonnaire-Sergeant wrote: On Tue, Jun 19, 2012 at 8:20 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote: On 19/06/12 13:06, Tassilo Horn wrote: Well, if you memoize

Re: Standard alias for partial?

2012-06-19 Thread Jim - FooBar();
what if you need the '$' for interop? Jim On 19/06/12 19:25, JvJ wrote: This is not really a big deal, but I was wondering if there was a shorter alias for partial in the standard library. It seems like one of those things that should require a single-character operator. I

Re: Standard alias for partial?

2012-06-19 Thread Jim - FooBar();
what? is it not a reserved character to denote args in function literals? I'm confused =-O ! Jim On 19/06/12 19:29, Jay Fields wrote: I use %, (def % partial) On Tue, Jun 19, 2012 at 2:28 PM, Jim - FooBar(); wrote: what if you need the '$' for interop? Jim On 19/06/12 1

Re: Standard alias for partial?

2012-06-19 Thread Jim - FooBar();
On 19/06/12 19:32, Timothy Baldridge wrote: That works until you try to use the shorthand for anonymous functions: (map #(inc %) [1 2 3]) ; what's this going to do? Timothy Thank you! :-) Jim -- You received this message because you are subscribed to the Google Groups "Clojure&

Re: memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
On 19/06/12 19:06, Jim - FooBar(); wrote: No no I tried that...the map has to be one of the first things in the namespace. 2 of its keys call a specific fn that itself expects the map as argument. everything I tried will either return 'stack overflow' (if I try to def/declare) or a &

Re: memoization of an no-arg fn that returns a map?makes sense?

2012-06-19 Thread Jim - FooBar();
as I phrased it originally did not make complete sense... Jim -- 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 pa

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-21 Thread Jim - FooBar();
until light-table comes out! Jim -- 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 unsubs

Re: aot compilation of clojure source code...

2012-06-21 Thread Jim - FooBar();
ith x and y This is just plain confusing for a a java person isn't it? Jim On 21/06/12 18:44, Phil Hagelberg wrote: "jim.foobar" writes: If we aot compile a namespace in clojure will it be harder to decompile than the Java equivalent? Recently, the concept of securing code

Re: Little question about doto?

2012-06-23 Thread Jim - FooBar();
position 0 0 0}}] (let [sphere (mesh.sphere.)] (doto sphere (.SetColor color) (.SetPosition position) (...) (...) (...) ))) Jim ps: 'doto' will give you back the object and will not ask you to repeat the name in every expression following (as opposed

verify that a fn throws an exception via testing?

2012-06-25 Thread Jim - FooBar();
ual Exception object (e) but on second thought I don't see any advantages... Any ideas? Jim -- 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

Re: verify that a fn throws an exception via testing?

2012-06-25 Thread Jim - FooBar();
On 25/06/12 12:31, Tassilo Horn wrote: "Jim - FooBar();" writes: Hi Jim, the only thing I can think of in order to test whether a fn does indeed throw an exception when certain circumstances are met is something like this: (fact (try (fn-that-throws-exc bad-arg) (catch E

Re: verify that a fn throws an exception via testing?

2012-06-25 Thread Jim - FooBar();
On 25/06/12 13:03, Tassilo Horn wrote: "Jim - FooBar();" writes: Hi Jim, I'm using midje... Ah, ok. Midje seems to support that, too. See https://github.com/marick/Midje/wiki/Prerequisites-that-throw-exceptions Bye, Tassilo excellent! Thanks Tassilo :-) Jim ps:I

Re: Distributed transactions

2012-06-26 Thread Jim Crossley
Well, it took a little longer than I thought it would, but we announced support for XA on Immutant today: http://immutant.org/news/2012/06/26/transactions/ Enjoy! Jim On Saturday, December 31, 2011 7:59:27 PM UTC-5, Jim Crossley wrote: > > > > On Dec 31, 7:33 pm, Stuart Hal

[ANN] Immutant 0.2.0 released

2012-07-05 Thread Jim Crossley
- Deploys your Leiningen projects from disk, no war file necessary - Multiple apps can be deployed to a single Immutant, each with its own isolated runtime - Embedded Swank/nREPL servers let you build your app while it's running in the container Give it a gander! Thanks, Jim --

Re: [ANN] Immutant 0.2.0 released

2012-07-06 Thread Jim Crossley
forming a single app that depends on those libraries. Jim Toby Crawley writes: > Murtaza: > > Technically it may be possible. The first naive approach that comes to > mind is a classloader per dependency that would be specific to the > particular version of the dependency an appli

Re: binding vs futures bug or feature (or more likely, am I missing the picture?)

2012-08-03 Thread Jim - FooBar();
nothing to base this on... Jim On 03/08/12 08:49, Daniel Silén wrote: Hi! I am new to the language, and at the moment playing around with concurrent-constructs as presented in a series on Clojure concurrency at pluralsight.com (by Chraig Andera). When playing with thread-local redefinitions

Re: binding vs futures bug or feature (or more likely, am I missing the picture?)

2012-08-03 Thread Jim - FooBar();
the idea was to make the behavior of dynamic vars in these contexts less surprising / more useful, but YMMV. -Marshall aaa ok thanks a lot...I do think this needs to be documented...I can add an example on clojureDocs but the actual documentation needs updating as well... Jim -- You received

Re: record constructor

2012-08-04 Thread Jim - FooBar();
least that is the way I see it...I originally thought you were asking about how to create a record at runtime via a macro or a function, which is actually quite tricky (and I can certainly help), but what you're asking sort of exists doesn't it? Jim On 04/08/12 17:44, Warren Lynn

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
p this is very strange...i'll update clojars within the next hour...sorry about this! Jim On 04/08/12 18:52, Timothy Washington wrote: Hey Jim, So I started playing around with clojure-encog <https://github.com/jimpil/clojure-encog>, and I'm pretty excited about it so

Re: record constructor

2012-08-04 Thread Jim - FooBar();
those arguments is: how about assembly language? It definitely works, definitely powerful, and put no restrictions on the user. I know nobody who is a fan of such language. Deep inside, we are all fans of assembly or at least we should be... :) Jim -- You received this message because you ar

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
nspots example... Hope that helps... :) Jim ps: empirically, tanh and sigmoid work almost always best...I can say the same for the nuygen-widrow randomiser...Also, just so you know I'll be renaming clojure-encog to "enclog" for the 0.5 release... On 04/08/12 19:18, Jim -

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
I will address your second issue shortly...You say you have a lazy-seq of arrays that have 5 strings? why strings? Jim On 04/08/12 20:02, Jim - FooBar(); wrote: Clojars has been updated with a clojure-encog jar containing all the namespaces...I'm really sorry I can't believe I hadn

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
omise you it will be the first thing I look at as soon as I find some time... hope that helps... Jim On 04/08/12 20:08, Jim - FooBar(); wrote: I will address your second issue shortly...You say you have a lazy-seq of arrays that have 5 strings? why strings? Jim On 04/08/12 20:02, Jim - F

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
r me to convert those strings to doubles, datetimes, etc. cool! i think read-string should do it anyway (at least for numbers) This helps a great deal that is good to know... cheers! Jim -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: record constructor

2012-08-04 Thread Jim - FooBar();
ability to optionally attach validator functions to some record fields. I have to admit that sounds nice...we can already do that with atoms why can't we do that with regular vars? Jim On 04/08/12 22:06, Warren Lynn wrote: I am not sure I follow...If you're just creating a new record

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
as confirmed in this post: http://www.heatonresearch.com/node/2124 Jim -- 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 - ple

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
lling-salesman-problem example. that should sort any compilation issues... Jim On 04/08/12 23:35, Timothy Washington wrote: Ok, this makes sense. Thanks very much for your insights. Tim Washington Interruptsoftware.ca <http://Interruptsoftware.ca> 416.843.9060 On Sat, Aug 4, 2012

Re: record constructor

2012-08-05 Thread Jim - FooBar();
(.getConstructors recordclass))) args (map #(symbol (str "x" %)) (range max-arg-count))] (eval `(fn [~@args] (new ~(symbol recordname) ~@args) One can do whatever he wants with 'args' before passing them in...This has solved a lot of my problems!

Re: Playing with clojure-encog, Machine-Learning wrapper

2012-08-05 Thread Jim - FooBar();
emagh to respond within the week. I do remember some other guy very much interested in financial predictions but he was doing everything in C#... Hope that helps, Jim On 05/08/12 19:27, Timothy Washington wrote: Hey all, This post is a fork of a thread in the post "community int

Re: Question about sets

2012-08-05 Thread Jim - FooBar();
because i don't recall getting any weird behaviour and so I assumed this worked with sets as well... Jim On 05/08/12 22:18, Phil Hagelberg wrote: On Sat, Aug 4, 2012 at 11:45 PM, Mark Engelberg wrote: My jaw is dropping here. I can't believe anyone would seriously propose that the

Re: Playing with clojure-encog, Machine-Learning wrapper

2012-08-06 Thread Jim - FooBar();
e to see the solution unfold! In fact if you get it going I'd love to add it in the clojure-encog examples... Jim On 05/08/12 20:40, Timothy Washington wrote: Hey Jim, Yes, it absolutely crossed my mind to post this on the encog-java forum. So I did just that (see here <http://www.heat

why would this fail in core.logic?

2012-08-06 Thread Jim - FooBar();
(Math/abs (- y b))) (== q [a b]) thanks in advance, Jim -- 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

Re: why would this fail in core.logic?

2012-08-07 Thread Jim - FooBar();
I do instead for the difference and how would I get the absolute value of the difference? any pointers? Jim -- 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

Re: why would this fail in core.logic?

2012-08-07 Thread Jim - FooBar();
thmetic...could this be exactly what I need (for subtraction at least)? as far as the 'Math/abs' bit is concerned I really don't know what to do! Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

Re: why would this fail in core.logic?

2012-08-07 Thread Jim - FooBar();
lt; a xmax) (< b ymax) (= (- x a) (- y b)) (== q [a b]) They are very similar aren't they? same operators, same functions etc etc... any help/clarification? Jim On 07/08/12 11:34, Jim - FooBar(); wrote: On 07/08/12 11:26, Moritz Ulrich wrote: You can. Usin

Re: why would this fail in core.logic?

2012-08-07 Thread Jim - FooBar();
ro b board) (!= b y) (== a x)]) (== q [a b]) Thanks again! Jim -- 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 pati

Re: why would this fail in core.logic?

2012-08-07 Thread Jim - FooBar();
as well and you can do whatever you want with it (it's only 55 lines or so)... cheers Jim On 07/08/12 13:40, Jim - FooBar(); wrote: On 07/08/12 13:19, David Nolen wrote: (= (- x a) (- y b)) Is not going to work. You probably want. (project [x y a b] (== (- x a) (- y b))) Though o

Re: Attractive examples of function-generating functions

2012-08-08 Thread Jim Weirich
y [pt] (pt (fn [x y] y))) (def pt (make-point 1 2)) (println [(point-x pt) (point-y pt)]) -- -- Jim Weirich -- jim.weir...@gmail.com -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@go

drawing a chess-board with seesaw ...

2012-08-09 Thread Jim - FooBar();
loop(s) and a couple of flags but I'm really struggling to tweak the 'draw-grid' accordingly to paint the colours as well... Any seesaw gurus? -> please help... cheers, Jim -- You received this message because you are subscribed to the Google Groups "Clojure" g

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

2012-08-09 Thread Jim - FooBar();
e back...they are not alternating! Have I misunderstood? thanks for bothering btw... :-) Jim (Dimitris) -- 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

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 bla

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 subscribe

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

2012-08-09 Thread Jim - FooBar();
) (.fillRect g x y 50 50)) )) Thanks a lot! It looked impossible to achieve without mutation, indices and counting pixels!!! Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroup

Is this expected of seesaw ?

2012-08-09 Thread Jim - FooBar();
500) directly...I am suspecting there must be some easy way to get around that yes? Just so we're clear, question #1 is the important one... Thanks in advance, Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: Is this expected of seesaw ?

2012-08-09 Thread Jim - FooBar();
o open up a new one! this is weird yes? Jim -- 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.

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.

use pmap but ensure that original ordering is retained?

2012-08-11 Thread Jim - FooBar();
assumes that the initial ordering of moves ('successors') has been preserved throughout the recursion and so I can use .indexOf to go from the score back to the move that started it all! Is this the case? I am suspecting not! any suggestions? Thanks in advance, Jim -- You receive

not-nilo in core.logic?

2012-08-15 Thread Jim - FooBar();
Hi everyone, I was thinking about how to invert the 'nilo' relation found in core.logic: (defn nilo "A relation where a is nil" [a] (== nil a)) there is a != operator but it is in the arithmetic namespace so i don't expect it to work... any pointers? J

Re: not-nilo in core.logic?

2012-08-15 Thread Jim - FooBar();
hmmm...good question!!! It can be anything can't it? basically I'm trying to assert whether a specific index in a vector is nil or not but i am inside a conde statement...Can I still use boolean functions like 'nil?' ? Jim On 15/08/12 14:07, Ambrose Bonnaire-Sergean

Re: not-nilo in core.logic?

2012-08-15 Thread Jim - FooBar();
to check each move generated against the current-board. essentially filtering out the moves that are blocked by other pieces...do you think this can be done non-relationally by a novice or am I better off using a regular fn? any clues are greatly appreciated... Jim On 15/08/12 14:32, David N

Re: not-nilo in core.logic?

2012-08-15 Thread Jim - FooBar();
On 15/08/12 15:09, David Nolen wrote: On Wed, Aug 15, 2012 at 9:53 AM, Jim - FooBar(); wrote: OK thanks a lot both of youit turns out the != works just fine! at the moment I've almost completed the entire moving rules for chess and checkers (including kills) but only on an empty

Re: not-nilo in core.logic?

2012-08-15 Thread Jim - FooBar();
is possible but timing it for a couple of hundred times shows no difference whatsoever (it settles at 1.81 ms roughly)...this is really good stuff!!! Chess is almost complete now!I can start showing things up on screen :-) In case someone is confused about ho

anonymous fns won't work in seesaw...

2012-08-17 Thread Jim - FooBar();
examples using (fn [e] (... ...)) but I'm sure I've seen snippets that use #(... ...). What is going on? Jim -- 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 fro

Re: anonymous fns won't work in seesaw...

2012-08-17 Thread Jim - FooBar();
aaa ok thanks a lot! I was under the impression that #() created a (fn [& args] ...) ! Jim On 17/08/12 11:46, Bronsa wrote: this is because the #() checks for arguments used inside its body to infer its arity. in #(alert "..") you don't use any arg so it creates

genuine help needed to speed up minimax algorithm!

2012-08-17 Thread Jim - FooBar();
if someone has done anything similar...I honestly wish i had started coding checkers first so I could compare with the Java one! at least i would knew whether to pursuit it further or not... thanks a lot for your patience and looking forward to comments :-) Jim -- You received this message b

Re: genuine help needed to speed up minimax algorithm!

2012-08-18 Thread Jim - FooBar();
s + 2x2 knights). There is a lot of work to be done in each branch so assigning a future to each, sounds reasonable. However if that was actually happening I should be seeing all 4 cores working non-stop! I just wish pmap worked! Jim -- You received this message because you are subscribed

Re: genuine help needed to speed up minimax algorithm!

2012-08-18 Thread Jim - FooBar();
vels i get almost 100% utilisation of cpu but nothing useful happens!!! anyway, I'll have a look at reducers! thanks for the snippet anyway! Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloju

Re: genuine help needed to speed up minimax algorithm!

2012-08-18 Thread Jim - FooBar();
s my algorithm completely wrong? this is scary stuff... the bad news is that i always get the same answer regardless of the depth...also something suspicious is the fact the no matter the depth the r/map returns in constant time! something smells here! Jim On 18/08/12 19:24, Jim - F

help needed to use reducers and monoid

2012-08-18 Thread Jim - FooBar();
hts are very much welcome...I am just starting playing around with reducers but it seems like the situation I'm in is the perfect candidate for this sort of thing and I want to know more! Also without this, my chess minimax searching is hopeless! Jim -- You received this message because

Re: help needed to use reducers and monoid

2012-08-19 Thread Jim - FooBar();
goes out the window with agents doesn't it? Again thanks a lot for your time and thoughts! Jim -- 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 fro

Re: help needed to use reducers and monoid

2012-08-19 Thread Jim - FooBar();
itely play around with your code tomorrow morning...if you say you can go up to level 5 in 11 sec this is really good performance -I can't wait to explore the code...I'll let you know of any comments of mine soon! Jim -- You received this message because you are subscribed to th

Re: help needed to use reducers and monoid

2012-08-19 Thread Jim - FooBar();
extra parameter (direction) ,which I'm negating after each level, so I know who I'm scoring at the bottom! Did you have any of this when you run yours? Jim On 19/08/12 21:32, nicolas.o...@gmail.com wrote: A correction for the wrong part: (defn my-max ([x y] (if (nil? x) y

Re: help needed to use reducers and monoid

2012-08-20 Thread Jim - FooBar();
nil? x) y (if (nil? y) x (min x y ([] nil)) 'max-key' does look like the perfect candidate for this job but unfortunately I can't get it to cooperate with reducers! Problem... Jim -- You received this message because you are subscribed to the Google Gro

Re: help needed to use reducers and monoid

2012-08-20 Thread Jim - FooBar();
On 20/08/12 12:34, Jim - FooBar(); wrote: On 20/08/12 10:12, nicolas.o...@gmail.com wrote: (defn generate [board next-boards] ;; next-boards return a seq of MoveAndBoard (BoardAndChildren. board (r/map (fn [m] (MoveAndTree

real-world usage of reducers?

2012-08-21 Thread Jim - FooBar();
)) (:children tree))... I'd love to see some proper usage of reducers so I can understand what is going on...From all the videos I've watched, I 've understood that the algorithm I'm implementing (minimax) is an ideal candidate for reducers - however I've still not

Re: What is the meaning of :while in a for ?

2012-08-21 Thread Jim - FooBar();
://groups.google.com/forum/?fromgroups=#!topic/clojure/wjO5imtEoRs <https://groups.google.com/forum/?fromgroups=#%21topic/clojure/wjO5imtEoRs> Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@

Re: real-world usage of reducers?

2012-08-21 Thread Jim - FooBar();
e))' approach with the 'r/fold' equivalent. btw (:children tree) is foldable cos it is the result of calling r/map. Jim On 21/08/12 17:17, Dennis Haupt wrote: i assume you are coming from a java background? if so, every time you wrote this: Result result = null; for (Stuff

Re: real-world usage of reducers?

2012-08-21 Thread Jim - FooBar();
ince each branch from the root can essentially be generated/traversed independently...pmap-ing at the top did very little, using a fixed thread pool did nothing, my only hope is now r/fold... Jim On 21/08/12 16:29, Michał Marczyk wrote: Actually no, reducers are applicable to all sorts of coll

ForkJoinTask not found under Java 7?

2012-08-21 Thread Jim - FooBar();
e.core.reducers/fold (reducers.clj:98) I thought I did not need the jsr166y.jar under java 7...what is happening? Jim -- 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 th

Re: ForkJoinTask not found under Java 7?

2012-08-21 Thread Jim - FooBar();
Has clojure 1.5 apha3 been aot-compiled against java 6? Jim On 21/08/12 19:40, Jim - FooBar(); wrote: Hi everyone, I get this very strange error even though I'm using clojure 1.5 alpha3 and java version "1.7.0_02" on Java HotSpot(TM) 64-Bit Server VM ! ClassNo

lein2 is not aware of newly installed jars in ~/.m2/repositories/

2012-08-21 Thread Jim - FooBar();
I built clojure 1.5 snapshot from source and installed it in ~/.m2/repositories/org/clojure/ via 'mvn install' but now lein2 reverts to 1.3 after amending my project.clj!!! How can I make leiningen aware of the newly installed snaphot version? Jim On 21/08/12 19:49, Jim - FooBa

Re: lein2 is not aware of newly installed jars in ~/.m2/repositories/

2012-08-21 Thread Jim - FooBar();
tions {:classpath "target/dependency/encog-core-3.1.0.jar" :destdir "target/classes"} ;:java-source-path "src/java" ;:main Clondie24.games.chess ) Jim On 21/08/12 20:28, Nelson Morris wrote: Whats the project.clj look like? On Tue, Aug 21, 2012 at 2:25 PM,

Re: lein2 is not aware of newly installed jars in ~/.m2/repositories/

2012-08-21 Thread Jim - FooBar();
wow! I would have never found that on my own! my temporary solution was to cheat (renaming the jar) but your suggestion works as well...Thanks a lot Nelson... :-) Jim On 21/08/12 21:35, Nelson Morris wrote: This took me a while to debug cause I expected [org.clojure/clojure "1.5.0-m

Re: ForkJoinTask not found under Java 7?

2012-08-21 Thread Jim - FooBar();
hmmm... I see. anyway I sorted my problem my building the latest clojure snpashot from source on my machine with Java 7 and then installing it ~/.m2/repositories/... Jim On 21/08/12 21:41, Sung Pae wrote: "Jim - FooBar();" writes: I thought I did not need the jsr166y.jar un

Re: real-world usage of reducers?

2012-08-21 Thread Jim - FooBar();
completely...I should be seeing massive performance benefits! Havinf done somehtign similar yourself if you can provide any insight that would be fantastic! Jim On 22/08/12 00:12, Joshua Ballanco wrote: Not sure if you'd consider this "real code", but I recently wrote a scrabbl

Re: real-world usage of reducers?

2012-08-22 Thread Jim - FooBar();
and 2 for each knight) but quickly goes up to 30, 40, 50 etc. I will try your suggestion... 3)I'm not sure I understand what you mean...You're returning nil - I'm returning a very small number, they can both be read by the next branch don't they? Jim On 22/08/12 10:04

Re: real-world usage of reducers?

2012-08-22 Thread Jim - FooBar();
sequential equivalent)... Jim On 22/08/12 13:33, Jim - FooBar(); wrote: Hi again Nicolas, 1) My moves at the top are a result of r/map...I did try to pou it all in a vector with 'nto []' but nothing changes. 2)well, no there is no way to have 512 moves at any point in in the game!!

Re: real-world usage of reducers?

2012-08-22 Thread Jim - FooBar();
lue keys) where the :value key could be Integer/MIN_VALUE - I'm not doing (:value Integer/MIN_VALUE) anywhere... Jim -- 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 N

Re: real-world usage of reducers?

2012-08-22 Thread Jim - FooBar();
t is just heating up (my ubuntu becomes less responsive as well)! Jim ps: Could it be that the sequential version really is a lot worse than what I'm approximating? On 22/08/12 14:20, Jim - FooBar(); wrote: On 22/08/12 14:08, nicolas.o...@gmail.com wrote: You should see a close to *4

Re: real-world usage of reducers?

2012-08-22 Thread Jim - FooBar();
.Thread peak is 12 if I remember correctly (quad-core cpu). Have I hit the limit? I don't want to think that core.logic is to blame...after all, I went through rough times in order to encode the rules in core.logic and I thought i would have performance benefits as well (apart from cl

Re: real-world usage of reducers?

2012-08-23 Thread Jim - FooBar();
he board) x 6 columns (the pieces)...I will try that as well! thanks Nicolas Jim -- 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

Re: real-world usage of reducers?

2012-08-23 Thread Jim - FooBar();
turns instantly (less than 1ms). But both these fns should only be called n times (where n is the depth)...this is weird stuff indeed... Jim On 23/08/12 12:43, Jim - FooBar(); wrote: On 23/08/12 09:35, nicolas.o...@gmail.com wrote: If it is so slow, that's maybe because the branching facto

Re: real-world usage of reducers?

2012-08-23 Thread Jim - FooBar();
On 23/08/12 20:23, Jim - FooBar(); wrote: But both these fns should only be called n times (where n is the depth). now this is completely wrong!!! next-level should be called on every single node!!! 8421 times for level 2... Jim -- You received this message because you are subscribed to

Re: dumping maps out to XML

2012-08-23 Thread Jim - FooBar();
make sure to bind *read-eval* to false when reading arbitrary code from files... (defn read-back "Read the file f back on memory. Careful not to eval anything dangerous (#=)." [f] (binding [*read-eval* false] (read-string (slurp f Jim On 23/08/12 21:32, larry google groups wr

calling record ctor from within the record definition fails?

2012-08-24 Thread Jim - FooBar();
Hi all, It seems that trying to instantiate a new record via its own methods fails!!! example: (defrecord Foo [a b c] Bar (update-position [this np] (Foo. a np c))) No matching ctor found ! There must be a way to do this without going round and round in functions... Jim -- You received

Re: calling record ctor from within the record definition fails?

2012-08-24 Thread Jim - FooBar();
On 24/08/12 11:32, Jim - FooBar(); wrote: Hi all, It seems that trying to instantiate a new record via its own methods fails!!! example: (defrecord Foo [a b c] Bar (update-position [this np] (Foo. a np c))) No matching ctor found ! There must be a way to do this without going round and

Re: calling record ctor from within the record definition fails?

2012-08-24 Thread Jim - FooBar();
yes sorry, I was missing an argument!!! Jim On 24/08/12 11:43, Ambrose Bonnaire-Sergeant wrote: Hmm I can't see to reproduce. ambrose@ambrose-VirtualBox:~$ lein repl nREPL server started on port 33367 REPL-y 0.1.0-beta10 Clojure 1.4.0 user=> (defprotocol Bar (update-position [this n

Re: real-world usage of reducers?

2012-08-24 Thread Jim - FooBar();
... however level 4 is still out of practical reach...I really don't want to involve Java arrays and stuff like that! Jim On 24/08/12 10:26, nicolas.o...@gmail.com wrote: More optimsation ideas: (defn next-level [b dir] (r/map #(Move->Board. % (core/try-move %)) (core/te

Re: profiler help...

2012-08-24 Thread Jim - FooBar();
problem especially after dropping the alive objects to 6,000 from 29,000...first pane you mean the first tab yes - where it shows the graphs (bottom left graph)? Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

<    4   5   6   7   8   9   10   11   12   >