Re: Concurrency and custom types.

2013-03-25 Thread Jim foo.bar
uff indeed... :) 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 this

cannot get more than 94 fibonacci numbers -> integer overflow

2013-03-25 Thread Jim foo.bar
ny type hints, I don't understand why I get an integer overflow... any ideas? Jim ps: this is not 'important', I'm just messing about... -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send e

Re: cannot get more than 94 fibonacci numbers -> integer overflow

2013-03-25 Thread Jim foo.bar
On 25/03/13 15:22, Ben Wolfson wrote: The 94th fibonacci number is greater than Long/MAX_VALUE, so it overflows. It is using longs. I seeshouldn't Clojure auto-promote it to a BigInt then? Jim -- -- You received this message because you are subscribed to the Google Groups "Cloj

Re: cannot get more than 94 fibonacci numbers -> integer overflow

2013-03-25 Thread Jim foo.bar
Cool, thanks guys :) Jim On 25/03/13 15:34, David Powell wrote: On Mon, Mar 25, 2013 at 3:24 PM, Jim foo.bar <mailto:jimpil1...@gmail.com>> wrote: On 25/03/13 15:22, Ben Wolfson wrote: The 94th fibonacci number is greater than Long/MAX_VALUE, so it overflo

Re: Apply elements in a vector as arguments to function

2013-03-26 Thread Jim - FooBar();
On 26/03/13 19:28, Ryan wrote: apply the elements of my vector as arguments to the function you said it yourself in your first post... :) 'apply' is what you're looking for! Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure&quo

Re: Apply elements in a vector as arguments to function

2013-03-26 Thread Jim - FooBar();
:last :address.state] or in your case exactly: [:id] [[:id :identity]] ;;with aliasing is this how your 'fields-vector' looks like? Jim ps: I've not looked at the source of 'fields', I may be wrong... On 26/03/13 20:12, Ryan wrote: Thank you guys for your answer. ap

Re: Apply elements in a vector as arguments to function

2013-03-26 Thread Jim - FooBar();
aaa see? always check the docs first and the sources second (if available)...I should have done that as well :) Jim On 26/03/13 20:28, Ryan wrote: Ah damn, you are right! Sorry if I wasted anyone's time :) At least I learned that apply was the way to go in my original post On Tu

Re: Apply elements in a vector as arguments to function

2013-03-27 Thread Jim foo.bar
luable (at least for me)... Jim ps: by no means I meant "read the source before posting here"...my comment was closer to "read the sources - it's good for you - you'll learn stuff and potentially save time & effort" :) -- -- You received this message bec

Re: ANN: print-foo - a library of print debugging macros

2013-03-28 Thread Jim - FooBar();
h is the one I mostly use but I can imagine it shouldn't be too hard to do the same on the threading macros, cond etc. Also if I face any problems there is always your code to guide me... Jim On 28/03/13 05:42, Alex Baranosky wrote: print-foo is a small library useful when debugging code

Re: ANN: print-foo - a library of print debugging macros

2013-03-28 Thread Jim - FooBar();
On 28/03/13 18:39, Alex Baranosky wrote: Jim, I'm interested in that idea definitely, but perhaps we should just create another open source project for time.foo? Ok cool, I'll do that over the weekend and poke you sometime next week to have a look...also, have you deliberatel

Re: core.logic : In one list but not in another

2013-03-28 Thread Jim - FooBar();
clojure.set/difference 'membero' combined with its negated form? Jim On 28/03/13 18:47, JvJ wrote: In core.logic, how do the following: "Give me everything that is a member of list A and not a member of list B"? -- -- You received this message because you are subscribed

Re: Problem with map (only when running on browser)

2013-03-30 Thread Jim - FooBar();
Clojurescript is Clojure...you may be able to skip some JVM idiosyncrasies but it's the same language - no way around that! Jim On 30/03/13 14:09, Nico wrote: Thank you very much sw1nn and John, both worked great. This goes to show how much of a newb I am. Sorry if this is the wrong

Re: why can I re-use local variables if Clojure is immutable?

2013-04-02 Thread Jim - FooBar();
All you're doing is re-let(ing) the same name using the value with which it'd been previously 'let'. It has nothing to do with mutability...if you used a different name you'd see that nothing would happen to the 'first' mega value. Yes I'd say this is ba

Re: why can I re-use local variables if Clojure is immutable?

2013-04-02 Thread Jim - FooBar();
code in Clojure if you start re-def(ing) and using dynamic vars heavily... Jim On 02/04/13 20:19, Jim - FooBar(); wrote: All you're doing is re-let(ing) the same name using the value with which it'd been previously 'let'. It has nothing to do with mutability...if you

Re: Fastest way to generate comma-separated list

2013-04-02 Thread Jim - FooBar();
I'm sorry, I've not followed this discussion - what is wrong with user=>(apply str (interpose \, (list 1 2 3 4 5))) "1,2,3,4,5" the problem is strings where you want to preserve each string...you can special case that and avoid the (apply str...) bit.. user=> (int

nested reduce/reduce-kv idiom

2013-04-03 Thread Jim - FooBar();
t doesn't quite work...has anyone done this already? It comes down to 'seq' returning a [k,v] vector when called on a map so the second nesting level will break because it will find a keyword or something similar. any ideas? Jim -- -- You received this message because you are s

Re: nested reduce/reduce-kv idiom

2013-04-04 Thread Jim - FooBar();
Thanks John, I came up with this, which uses destructuring quite heavily and might slow things down... (reduce (fn [s [t1 t2 w3 v]] (assoc-in s [t1 t2 w3] (/ (count v) all))) {} (for [[k1 v1] ems [k2 v2] v1 [k3 v3] v2] [k1 k2 k3 v3])) is this what you meant? Jim On 03/04/13 19:54, John D

Re: Analog to Scheme's partition in Clojure?

2013-04-04 Thread Jim - FooBar();
mapv persistent! both))) Jim On 04/04/13 13:16, Christian Romney wrote: Hi all, I was wondering if something in core (or new contrib) like this exists already... (defn segregate "Takes a predicate, p, and a collection, coll, and separates the items in coll into matching and non-ma

Re: Analog to Scheme's partition in Clojure?

2013-04-04 Thread Jim - FooBar();
want go parallel... you asked where to find this funciton... a couple of places actually :) http://clojuredocs.org/clojure_contrib/clojure.contrib.seq-utils/separate http://richhickey.github.com/clojure-contrib/seq-utils-api.html HTH, Jim On 04/04/13 19:12, Christian Romney wrote: On

Re: Getting the right Clojure version with dependencies

2013-04-04 Thread Jim - FooBar();
[ghostandthemachine/seesaw"1.4.3-SNAPSHOT":exclusions[org.clojure/clojure]] Jim ps: maybe the actual coordinate for clojure is wrong but I can On 05/04/13 00:32, Mark Engelberg wrote: Right now, I'm experimenting with seesaw. In Clojars, it appears the latest version is

Re: Using update-in to produce vectors from nothing

2013-04-05 Thread Jim foo.bar
if I understood correctly you're looking for 'fnil' : =>(update-in {} [:foo :bar] (fnil conj []) :a :b :c) {:foo {:bar [:a :b :c]}} Jim On 05/04/13 12:25, Simon Katz wrote: Hi. Is there an idiomatic way to have update-in create a vector when the supplied keys do not

Re: Using update-in to produce vectors from nothing

2013-04-05 Thread Jim foo.bar
aaa Laurent beat me to it! :) it seems we both understood the same thing so fnil is indeed your friend... Jim On 05/04/13 12:29, Jim foo.bar wrote: if I understood correctly you're looking for 'fnil' : =>(update-in {} [:foo :bar] (fnil conj []) :a :b :c) {:foo {:bar [:a

Re: Something goofy you can do in Clojure.

2013-04-09 Thread Jim foo.bar
Hey Mark, don't get paranoid :)... this is all Cedric did! user=> (def .3 0.4) #'user/.3 user=> (+ .3 1.7) 2.1 Jim On 09/04/13 10:46, Mark Engelberg wrote: What version are you running? As far as I know, .3 isn't even a valid representation for a number -- you'

Re: defrecord and namespace-qualified symbols

2013-04-10 Thread Jim foo.bar
defined? It doesn't make sense to me at all... 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 you

classloader and proxied classes issue

2013-04-11 Thread Jim - FooBar();
uimafit.component.JCasAnnotator_ImplBase$0") ** ** (catch ClassNotFoundException cnf "NOT FOUND!"))** ** ** =>hotel_nlp.externals.uima.proxy$org.uimafit.component.JCasAnnotator_ImplBase$0* What on earthis happening? How am I able to get the class Object back but the ClassLoader

Re: classloader and proxied classes issue

2013-04-11 Thread Jim - FooBar();
I found this on SO which seems to be related but the answer proposes deftype which is not an option for me as I need to extend a particular class with proxy... I'm completely stuck... Jim On 11/04/13 14:10, Jim - FooBar(); wrote: Hi all, I'm writing a tiny wrapper around apach

Re: classloader and proxied classes issue

2013-04-11 Thread Jim - FooBar();
ng uima's classloader to use clojure's dynamic classloader and even if I could who knows what kind of problems that would bring... Jim On 11/04/13 16:36, Jim - FooBar(); wrote: I found this on SO which seems to be related but the answer proposes deftype which is not an option for

loading proxied classes outside of clojure

2013-04-11 Thread Jim - FooBar();
since classes generated by proxy reside on memory how would the standard java.net.URLClassolader find them? is there a way to emit the class on disk? Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

nice Clojure at Nokia talk

2013-04-12 Thread Jim foo.bar
Nice talk :) http://skillsmatter.com/podcast/scala/clojure-at-nokia-entertainment/wd-23 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 m

proxy doesn't care about type hints?

2013-04-15 Thread Jim - FooBar();
Providing the types does nothing - it seems proxy only cares about arity void bar(InterfaceX ix); //*not *supposed to be overriden abstract void bar(InterfaceY iy); //but this is indeed supposed to be overriden Should I just give up? Jim -- -- You received this message because you are sub

Re: proxy doesn't care about type hints?

2013-04-15 Thread Jim - FooBar();
'proxy' (If i could use it!)... 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 fi

Re: proxy doesn't care about type hints?

2013-04-15 Thread Jim - FooBar();
On 15/04/13 21:37, Meikel Brandmeyer (kotarak) wrote: (proxy [YourClass BarInterface] [] (bar [x-or-y] (if (instance? InterfaceY x-or-y) (override x-or-y) (proxy-super x-or-y I'm sorry I forgot...what is 'override' above? what fn is this? I cannot find

Re: proxy doesn't care about type hints?

2013-04-15 Thread Jim - FooBar();
aaa ok sorry... proxy-super is a no-no in this case...I think at this point my best bet is to write a macro that will expand into a gen-class skeleton form...there is no other way I'm afraid...the proxy approach would be so elegant if it worked! Jim On 15/04/13 22:17, Meikel Brand

Re: Why is the compiler more strict on one of my machines?

2013-04-16 Thread Jim foo.bar
It sounds to me that you forgot to run 'lein clean' at work, leaving certain classfiles present in 'target'. This would explain why you got your uberjar at work but not at home (presumably .class files are being ignored by git) Jim On 16/04/13 13:59, larry google groups

Re: Reducers newbie question

2013-04-26 Thread Jim - FooBar();
+1 ! I use 'fold-into-vec' regularly.... :) Jim On 26/04/13 18:07, Alan Busby wrote: Some additional pointers here (this is a little old though); http://www.thebusby.com/2012/07/tips-tricks-with-clojure-reducers.html On Fri, Apr 26, 2013 at 11:51 PM, László Török <mailto:ltoro

cannot read foo.xml from the top level of a jar!

2013-04-26 Thread Jim - FooBar();
tream from the classloader + the Class object... any ideas? thanks, 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 - pl

Re: cannot read foo.xml from the top level of a jar!

2013-04-26 Thread Jim - FooBar();
tried both... nothing worked... :( Jim On 26/04/13 20:16, Jonathan Fischer Friberg wrote: Did you put "/" at the beginning of the string to resource? Because you shouldn't. You should call it like this: (resource "foo.xml"). Jonathan On Fri, Apr 26, 2013

[ANN] Immutant 0.10.0 released

2013-04-26 Thread Jim Crossley
S7 that aims to reduce the incidental complexity in real-world applications. It provides support for Ring handlers, asynchronous messaging, caching, scheduled jobs, XA transactions, clustering, and highly-available "daemon" services. Thanks, Jim -- -- You received this message because

Re: testing for nil may not be enough

2013-04-29 Thread Jim - FooBar();
I 've found that whenever I get a var-unbound exception it is almost always my fault and my fault only...why would you do (def a) anyway? Jim On 29/04/13 16:32, AtKaaZ wrote: How do you guys handle the cases when the var is unbound? I mean specifically in the cases where you just test i

Re: testing for nil may not be enough

2013-04-29 Thread Jim - FooBar();
funny you should mention that!!! that is exactly what I meant by 'my fault'...I've come to realise that dynamic scope is almost evil, thus I go to great lengths to avoid it completely...in the rare cases where I do use it I always make sure it is bound to a init/default value :

Re: More idiomatic way to use map like this?

2013-05-03 Thread Jim - FooBar();
because you specifically asked not to use any reference types. 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: More idiomatic way to use map like this?

2013-05-03 Thread Jim - FooBar();
something like this perhaps? (loop [[c & more]] cards res [] due 100] (if-not c res (recur more (conj res (doto c (.setAppliedBalance (max 0 (- due ) (- due (.getBalance c ) Jim ps: haven't got a clue what objects you're workin

Re: More idiomatic way to use map like this?

2013-05-03 Thread Jim - FooBar();
oops there is a typo! line 6 should be: (conj res (doto c (.setAppliedBalance (max 0 (- due (.getBalance c)) On 03/05/13 15:22, Jim - FooBar(); wrote: something like this perhaps? (loop [[c & more]] cards res [] due 100] (if-not c res (recur more (conj

Re: More idiomatic way to use map like this?

2013-05-03 Thread Jim - FooBar();
I Just realised you've many responses and that you've already solved your problem...sorry for the noise people. Jim On 03/05/13 15:38, Jim - FooBar(); wrote: oops there is a typo! line 6 should be: (conj res (doto c (.setAppliedBalance (max 0 (- due (.getBalance c)) On 03/0

Re: Struggling with encapsulation

2013-05-10 Thread Jim - FooBar();
l do the wrong thing' etc. claws into me though, so it is with trepidation I set out on this gloriously liberating new path :). the mindset you're describing is a direct consequence of unrestrained mutability ...nothing bad can happen to your *immutable* clojure data :)... very liber

Re: confused on set!

2013-05-15 Thread Jim - FooBar();
On 15/05/13 17:23, Phillip Lord wrote: I cannot do (set!*my-test* true) (alter-var-root #'*my-test* (constantly true)) Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: confused on set!

2013-05-15 Thread Jim - FooBar();
On 15/05/13 17:28, Jim - FooBar(); wrote: On 15/05/13 17:23, Phillip Lord wrote: I cannot do (set!*my-test* true) (alter-var-root #'*my-test* (constantly true)) Jim here explains what you're asking: http://clojure.org/Vars scroll down to until you see (*set!*var-s

Re: confused on set!

2013-05-16 Thread Jim - FooBar();
ogress-monitor-silent} tests)) ...shorter, same behaviour and as a bonus you're not limited to vars declared as dynamic. This should work with vanilla 'def' too :) Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: After waiting for agents, something still hanging around?

2010-06-10 Thread Jim Menard
wait like my little app does? Jim -- Jim Menard, http://www.io.com/~jimm/ -- 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 - pleas

After waiting for agents, something still hanging around?

2010-06-10 Thread Jim Menard
e"))) (run-example) Output: hello (# # # # #) sending do-something to agents something! something! something! something! something! waiting all done [Here, the app hangs. Why it it hanging?] Jim -- Jim Menard, http://www.io.com/~jimm/ -- You received this message because you are subscribed

Re: After waiting for agents, something still hanging around?

2010-06-10 Thread Jim Menard
lojure-agent-thread-pools/ > > IMHO, using agents should not prevent your JVM from exiting or require > the use of (shutdown-agents). Jim -- Jim Menard, http://www.io.com/~jimm/ -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: New Clojure web application launched: DocuHarvest

2010-06-13 Thread Jim Blomo
y's (Moritz Ulrich) branch is being actively maintained and he's been helpful getting it working for me. 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

Re: New Clojure web application launched: DocuHarvest

2010-06-16 Thread Jim Blomo
Thanks, very helpful. I hadn't heard of clutch before your announcement, so I appreciate the introduction. The clojure view server sounds especially interesting! Jim On Tue, Jun 15, 2010 at 12:51 PM, Chas Emerick wrote: > Last I looked (and it appears to be the same way after a quic

Re: Problems with URL params and http-agent

2010-06-17 Thread Jim Blomo
another port. Then make the same requests with the browser and library to the new port and compare netcat's output. Perhaps they are escaping the paths differently. Cheers, Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: Idiomatic Clojure namespace names5

2010-07-08 Thread Jim Blomo
he semantics of forking. So for example clojure.http.ring.weavejester. 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

Re: What is the reason Lisp code is not written with closing parenthesis on new lines?

2010-08-19 Thread Jim Wise
currently open parens' as well, as in (defun foo (x) (progn (foo) (bar] but as more lisps (R6RS, clojure, several older schemes) provide [ ] as a separate syntactic form or as an equivalent to ( ), this is not really an option any more. -- J

clojure-opennlp

2012-02-11 Thread Jim foo.bar
efn find-names-model [text] (map #(drug-find (tokenize %)) (get-sentences text))) It is very strange because i am getting back "Folic" but not "Folic acid" regardless of using the exact same model i used with the command line tool... Any help will be greatly appre

Re: mcache 0.1.0 released

2012-02-21 Thread Jim Crossley
be great to see another distributed option for "pluggable memoization". Jim [1] https://github.com/clojure/core.cache [2] https://github.com/immutant/immutant/blob/master/modules/cache/src/main/clojure/immutant/cache.clj -- You received this message because you are subscribed to the Goo

Re: [ANN] mcache 0.2.0 released

2012-02-29 Thread Jim Crossley
Hi Dave, This is awesome! :) DHM writes: [...] > Thanks to Jim Crossly for the suggestion to look into CacheProtocol. > Also, Jim, I hope you don't mind that I borrowed your naming scheme > for the put functions. :-) Not at all. I love that within a coupla weeks we

Re: What Java classes/objects/methods do you find yourself most often using?

2012-03-07 Thread Jim - FooBar();
On 06/03/12 17:09, John Gabriele wrote: While writing Clojure code, what Java classes, objects, and static methods do you most often find yourself using? I use java.lang.Math quite a lot... Jim -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: clojure on android over CLI

2012-03-08 Thread Jim - FooBar();
There is a clojure repl for android...it will make your life easier...the only problem is you cannot include external libs in your project... Jim On 08/03/12 01:43, Rostislav Svoboda wrote: Hi. I'm trying to run: java -cp clojure-${VERSION}.jar clojure.main on an Android phone

[ANN] Immutant 0.1.0 released

2012-03-14 Thread Jim Crossley
Howdy all, Just in time for my Clojure/West talk, we're happy to have published our first official release of Immutant, the Clojure app server built on JBoss AS7. Read all about it here: http://bit.ly/immutant010 Thanks, Jim -- You received this message because you are subscribed t

Re: A New Core.logic Primer

2012-03-15 Thread Jim - FooBar();
amazing stuff guys!!! Jim On 14/03/12 19:00, David Nolen wrote: Thanks to Edmund Jackson we have a new primer for core.logic: https://github.com/clojure/core.logic/wiki/A-Core.logic-Primer Feedback appreciated! David -- You received this message because you are subscribed to the Google

Has anyone solved the zebra/einstein puzzle using core.logic?

2012-03-23 Thread Jim - FooBar();
ly. I know David Nolen has solved it (says so on core.logic github page) but i'd expect his solution to be very elaborate/optimized rather than simple (he's a logic-guru whereas i'm a logic-newbie)...I only need this for studying so the simpler the better! Thanks in advance... Ji

Re: Has anyone solved the zebra/einstein puzzle using core.logic?

2012-03-23 Thread Jim - FooBar();
aaa ok i see...so i'm supposed to pivot around house and NOT around person as i was trying to...thanks for the link - very much appreciated! Jim On 23/03/12 17:43, Daniel Gagnon wrote: p.s: If someone thinks that the zebra puzzle is too complicated as a first example please

Re: Is it possible to extend a parameterized type using gen-class?

2012-03-28 Thread Jim Blomo
tadata argument to the symbol passed to gen-class :extends or :implements - when that metadata is present, override getGenericSuperclass in the generated class to return the ParameterizedType Is this reasonable? Are there other areas that need to expose generic parameters? Jim http://docs.oracle.co

Re: Is it possible to extend a parameterized type using gen-class?

2012-03-31 Thread Jim Blomo
-class :extends ^{:parameters [SomeItemType]} java.util.AbstractCollect)) Note that neither the types nor constraints are checked when writing the signature. https://github.com/jblomo/clojure/commit/15ff4f96840788253c5af66a2265387d880bad80 Jim On Wed, Mar 28, 2012 at 10:27 PM, Jim Blomo wrote:

Re: ClojureScript Debug

2012-04-02 Thread Jim - FooBar();
I don't think any of the concurrency primitives made it to clojureScript... On 02/04/12 14:54, Moritz Ulrich wrote: See [1]: "Agents are currently not implemented" They wouldn't be very useful, as javascript is single threaded in most implementations. [1]: https://github.com/clojure/clojuresc

Re: ClojureScript Debug

2012-04-02 Thread Jim - FooBar();
except for atoms of course... On 02/04/12 14:55, Jim - FooBar(); wrote: I don't think any of the concurrency primitives made it to clojureScript... On 02/04/12 14:54, Moritz Ulrich wrote: See [1]: "Agents are currently not implemented" They wouldn't be very useful, as

Re: Need help to find a bug in a genetic algorithm

2012-04-02 Thread Jim - FooBar();
Is it possible to explain briefly what this genetic algorithm tries to accomplish? I mean what problem is it producing solution for? It never seems to end regardless of number-of-domiciles! I think i got a glimpse of a "ThursdayGNEXT" string but i'm not sure what it means... J

Re: Need help to find a bug in a genetic algorithm

2012-04-02 Thread Jim - FooBar();
aa ok i see, that makes perfect sense... thanks a lot! Jim On 02/04/12 19:06, Goldritter wrote: First there is an error in my code :( These are the allowed symbols from which the creator function can choose to create or mutate a gen: def allowed-symbols (str "abcdefghijklmnopqrstuvwx

Re: Need help to find a bug in a genetic algorithm

2012-04-02 Thread Jim - FooBar();
Shouldn't the line (inside start-evolution) : *(map #(send % a-day-in-the-life-agent-fn) domiciles) * be: *(pmap #(send % a-day-in-the-life-agent-fn) domiciles)* ??? why does it need to happen serially? Jim On 02/04/12 19:06, Goldritter wrote: First there is an error in my code :(

Re: Need help to find a bug in a genetic algorithm

2012-04-02 Thread Jim - FooBar();
and i get the solution in time (roughly 40sec)!!! Jim On 02/04/12 19:06, Goldritter wrote: First there is an error in my code :( These are the allowed symbols from which the creator function can choose to create or mutate a gen: def allowed-symbols (str "abcdefghijklmnopqrstuvwx

Re: Need help to find a bug in a genetic algorithm

2012-04-02 Thread Jim - FooBar();
hronous and so pmap should only add overhead...It seems however that pmap does the ccorrect job here... Jim p.s: Marcus run it for ourself using pmap and 2 domiciles and compare it with previous runs... I 've not changed the code at all apart from adding the missing space... On 02/04

Re: Need help to find a bug in a genetic algorithm

2012-04-03 Thread Jim - FooBar();
of memory...presumably it's the same for you. Jim On 03/04/12 17:16, Marcus Lindner wrote: Maybe the reason is the STM. If I rmember it correctly, then agents and refs are controlled by Clojures STM mechanic. Eventuelly the us of map increase the work for the STM and so it needs more time to s

Re: Need help to find a bug in a genetic algorithm

2012-04-03 Thread Jim - FooBar();
. Weird stuff ... 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 fr

Re: Need help to find a bug in a genetic algorithm

2012-04-03 Thread Jim - FooBar();
; . In all fairness, this is what you're explaining in #1, it's just easy to imagine someone being confused into thinking that this is the preferred way of designing GAs while in fact you disapprove of this yourself (for real-world scenarios)... Anyway, thanks for taking the time to enligh

Re: Boolean

2012-04-09 Thread Jim - FooBar();
the .equals() method for java Objects. That is why the above works "correctly" while the if test condition "fails". Also when you call compareTo I'd expect the .equals() method to be invoked again... Jim -- You received this message because you are subscribed to the Googl

How come (`+ 1 2) => 2 ???

2012-04-09 Thread Jim - FooBar();
Hello everyone... Can somebody please provide some insight as to why (`+ 1 2) => 2 and ('+ 1 2) => 2 ??? Thanks in advance... Jim ps. I understand that symbols are functions that look themselves up in sequences but here i'm not passing a seq - instead i'm passing 2 a

Re: How come (`+ 1 2) => 2 ???

2012-04-09 Thread Jim - FooBar();
Aaaa ok, it makes sense now... Thanks a lot! Jim On 09/04/12 13:00, Aaron Cohen wrote: When symbols and keywords are in function position, (as you say) they look themselves up "in" the second argument. The third argument specifies a not-found value. Since "1" isn

Re: Supporting platform specific code

2012-04-12 Thread Jim - FooBar();
+1 for meta-data...it fits the glove perfectly ;-) On 12/04/12 18:52, Vinzent wrote: First thing which comes to mind is to use metadata for this purpose. Something like (defn ^{:platform :jvm} to-string [x] ...) This doesn't force the user to create a separate file for each platform (althou

Re: Light Table - a new IDE concept

2012-04-13 Thread Jim - FooBar();
I am left speecheless...! Jim On 13/04/12 19:49, sean neilan wrote: I wish there was a link to download it. On Fri, Apr 13, 2012 at 1:34 PM, looselytyped <mailto:raju.gan...@gmail.com>> wrote: This is an awesome implementation of Brett Victors "Inventing On Pr

Re: Boolean

2012-04-13 Thread Jim - FooBar();
wow!!! i wasn't expecting that one... Jim On 13/04/12 21:17, Armando Blancas wrote: It's the other way around: false is boxed into Boolean/FALSE. Here's the if stmt: public Object eval() { Object t = testExpr.eval(); if(t != null && t != Boolean.FALSE) return

Re: ANN: A more fully-featured lein-vimclojure

2012-04-14 Thread Jim - FooBar();
. is this expected? thanks! Jim On 14/04/12 14:20, Daniel Solano Gómez wrote: Hello, I am happy to let you know I have published a new Leiningen plug-in for VimClojure support. I know there are already a number of VimClojure plug-ins out there, some of them called lein-nailgun and others called

Re: Having Problems with excercise noob.

2012-04-26 Thread Jim - FooBar();
ed a macro that tranforms infix arithmetic expressions to prefix expressions i've got the right macro for you 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: Having Problems with excercise noob.

2012-04-26 Thread Jim - FooBar();
esult inside the macro, to simply transform the expression into prefix form and let clojure calculate the result on that...it also would be easier to write than this... Jim ps: the above macro does not handle parenthesis or operator precedenceif you want to go the full way have a look at the i

Re: Having Problems with excercise noob.

2012-04-26 Thread Jim - FooBar();
(cos it is not understandable from clojure's point of view)... Jim ps:also i'm pretty sure you don't need regex for something like thisyou're just making your life difficult! -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: Socket Library in Clojure

2012-04-27 Thread Jim - FooBar();
Yes go with Java interop...sockets are pretty straight forward. Jim On 27/04/12 11:15, Baishampayan Ghose wrote: I was looking for socket libraries in clojure. The requirement is to connect via telnet to a mainframe based system and run commands on it. Can't you use JVM interop dir

Re: simple script using Autodoc to generate a static docs site

2012-04-28 Thread Jim - FooBar();
phone does not like github!!! sorry for the alert. 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

Re: Arithmethic Evaluation

2012-05-01 Thread Jim - FooBar();
thing inside quotes starts and ends with opening/closing paren respectively... 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: Arithmethic Evaluation

2012-05-02 Thread Jim - FooBar();
string you cannot do much unless you get down and dirty... Jim ps: i've got some useful macros on my website including one that transforms infix to prefix (lists) check it out at www.cs.man.ac.uk/~piliourd/ -- You received this message because you are subscribed to the Google G

Re: [ANN] Leiningen 2.0.0-preview3

2012-05-02 Thread Jim - FooBar();
On 02/05/12 20:56, Stuart Sierra wrote: Just want to say thanks to Phil and everyone else who has contributed to Leiningen. It's been pleasing to see the evolution from a limited script to a solid development tool. -S -- You received this message because you are subscribed to the Google Groups

infix-to-prefix macro dead-end!!!

2012-05-02 Thread Jim - FooBar();
o is replace all the parens at each level with values calculated recursively using eval on the returned expressionHowever i can't seem to go any further...I am literally about to give up...I know this may not be necessarily the best approach but i 've worked hard on this and i want to s

Re: infix-to-prefix macro dead-end!!!

2012-05-02 Thread Jim - FooBar();
On 02/05/12 21:33, Aaron Cohen wrote: (if-not (empty? (filter #(list? %)) '~expr)) This looks suspicious. filter is being called with 1st parameter anon function, and no second parameter. How does that compile? I apologise for the typo...it was originally (filter (fn [k] (list? k)) '~

Re: infix-to-prefix macro dead-end!!!

2012-05-02 Thread Jim - FooBar();
sult value back to the list in order to get the effect of 'parenthesis first'? Jim ps: btw thanks for your time :) On 02/05/12 23:14, Sam Ritchie wrote: Hey Jim, what do you think of something like this? (defmacro infix->prefix [form] (loop [[a op b & more :as form] for

Re: new with clojure, need help!

2012-05-05 Thread Jim - FooBar();
de - have you had a look at clooj? It might be exactly what you need... 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 - plea

Re: Best Clojure Learning Resource for Lisper

2012-05-07 Thread Jim - FooBar();
self for a wonderful ride with less parens and truly immutable collections! :-) Have fun... Jim ps: check the clojure wiki and also there are 2 new books out there...the oreilly one is more than 600 pages! On 07/05/12 05:37, HelmutKian wrote: Hey there, I'm a fairly experienced Common

why can i not shut-down my pc from Java?

2012-05-07 Thread Jim - FooBar();
ows") (.exec enviroment (str "shutdown -s -t " minutes-after)) :else (throw (RuntimeException. "Unsupported operating system!" ------

Re: why can i not shut-down my pc from Java?

2012-05-07 Thread Jim - FooBar();
of the process using its :in argument. Now that sounds more sensible but it means that the consumer has to have clojure...what if i was to aot-compile the function with gen-class to pretend it is plain Java? Jim -- You received this message because you are subscribed to the Google Groups

Re: why can i not shut-down my pc from Java?

2012-05-07 Thread Jim - FooBar();
So you mean something like : (str "#!/bin/bash echo " root-pwd " |" " sudo -S shutdown -h +" minutes-after) ? Jim On 07/05/12 16:20, Moritz Ulrich wrote: I'm not familiar with .exec, so this is a guess: What you try to do is piping some text to some oth

<    2   3   4   5   6   7   8   9   10   11   >