Re: creating code stubs to use inside an extend-protocol form

2013-02-24 Thread Jim - FooBar();
Thanks to both Atkaaz & Tim... you were both very helpful, albeit for different reasons! Atkaaz pointed me to a promising syntax-quoting library that I didn't even know existed and Tim essentially provided the solution I settled for. Since that code-snippet can be found in core, I'll just assum

creating code stubs to use inside an extend-protocol form

2013-02-23 Thread Jim - FooBar();
I seem to be unable to quote a form and then repeatedly pass it inside the extend-protocol macro...something like this: (def ^:private co-stub '(run [this ^String text] (let [ann (edu.stanford.nlp.pipeline.Annotation. text)] (.annotate this ann) ann))) (extend-protocol IComponent edu.s

protocol granularity

2013-02-23 Thread Jim - FooBar();
Hi everyone, I'm facing a little problem when extending protocols in a mix of inheriting and implementing classes...Let me explain: stanford-corenlp defines a top level interface called "Annotator" (with a single 'annotatate' method signature'). It also defines a class called "AnnotationPipe

Re: Creating a hash-map with conditional keys

2013-02-21 Thread Jim - FooBar();
I think Alex is trying to say that a macro is almost never appropriate when a first-class function would do...therefore, there is no good reason for carrying the complexity of macros all over your code, given that in your case they do nothing special (like postponed evaluation) and can be repla

Re: Using local jar

2013-02-17 Thread Jim - FooBar();
Even though what Aaron said is correct, I'll just add that with lein2 you can get away with not "installing" your jar in ~/.m2/. Just use the :resource-paths key in your project.clj and point to a folder with 'orphan' jars...something like this: :resource-paths ["orphan-jars/*"] ;;all jars un

Re: Why is this so difficult?

2013-02-17 Thread Jim - FooBar();
"clojure-doc.org" ?? OMG, is this new? it seems to have some gorgeous tutorials for newcomers...LIke Bizics, i had no idea this site existed! How come google is not showing this in the first page when typing "Clojure docs" or something like that? I'm definately bookmarking this...

Re: protocol implementation delegating to protocol extension doesn't compile

2013-02-15 Thread Jim - FooBar();
Hi Juan, I have to admit you're a life saver! You didn't say anything that I did not know but you did make a couple of observations that made me have a closer look on my code...For example you noticed that the protocol extension to String was never registered...That is the *real* problem here

protocol implementation delegating to protocol extension doesn't compile

2013-02-14 Thread Jim - FooBar();
let me explain with an example: ;;in some namespace x (defprotocol IStemmable (stem [this token] [this token lang]) (getRoot [this token dictionary])) (defprotocol IDistance (getDistance [this s1 s2] [this s1 s2 m-weight])) ;;in some namespace y that refers all vars from x (extend-type Strin

Re: constructing matrix-like structures with list-comprehension

2013-02-06 Thread Jim - FooBar();
Hi Mike, thanks for your reply...I've actually been keeping a very close eye on core.matrix since day 1 and I have to admit I am very very tempted to start contributing...My research is on Text-mining which as you probably know is machine-learning on text (mainly sequence-labelling, HMM based

Re: constructing matrix-like structures with list-comprehension

2013-02-05 Thread Jim - FooBar();
Ok, I think I cracked it but as usual someone else might come up with a cleaner approach...:-) (defn matrix [dim & dim-lengths] {:pre [(not (nil? dim))]} ;;cannot accept (let [bindings (map #(vector (gensym) `(range ~%)) dim-lengths) symbols (mapv first bindings) counts (inc (coun

Re: How to use pmap over a partition-all list of list?

2013-02-02 Thread Jim - FooBar();
apply does exactly what you're describing...it treats a collection as several arguments: (apply + [1 2 3 4]) is equivalent to: (+ 1 2 3 4) => 10 so (pmap + '(1 2 3) '(4 5 6) '(7 8 9) ) is equivalent to: (apply pmap + ['(1 2 3) '(4 5 6) '(7 8 9)]) no need for macros and stuff...actually apply

Re: How to use pmap over a partition-all list of list?

2013-02-02 Thread Jim - FooBar();
aaa you want a scalar as the result? then use an outer reduce as well: (reduce + (pmap #(reduce + %) (partition-all 5 (range 1 20 =>190 Jim On 02/02/13 13:10, Jim - FooBar(); wrote: Use this: (pmap #(reduce + %) (partition-all 5 (range 1 20))) OR as you yourself said you can use &#x

Re: How to use pmap over a partition-all list of list?

2013-02-02 Thread Jim - FooBar();
Use this: (pmap #(reduce + %) (partition-all 5 (range 1 20))) OR as you yourself said you can use 'apply' instead of reduce Jim On 02/02/13 12:31, Leandro Moreira wrote: Hi there, I have this: *user=>* (partition-all 5 (range 1 20)) ((1 2 3 4 5) (6 7 8 9 10) (11 12 13 14 15) (16 17 18 19)

Re: SIGBUS : A fatal error has been detected by the Java Runtime Environment

2013-01-28 Thread Jim - FooBar();
On 28/01/13 18:58, larry google groups wrote: Interesting. My app leans heavily on (reduce). I think in some places I might call reduce from inside of another reduce. This is the problem then? No no I don't mean plain old 'reduce' but the new 'reducers' library in 1.5... Jim -- -- You re

Re: SIGBUS : A fatal error has been detected by the Java Runtime Environment

2013-01-28 Thread Jim - FooBar();
n 28/01/13 18:29, AtKaaZ wrote: Hi Jim, did you try a 32bit jvm? I wonder if it still happens with that On Mon, Jan 28, 2013 at 7:28 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote: I feel obliged to come in and say that using this flag did not cure my problem completel

Re: SIGBUS : A fatal error has been detected by the Java Runtime Environment

2013-01-28 Thread Jim - FooBar();
I feel obliged to come in and say that using this flag did not cure my problem completely...This error is still thrown whenever i use ^:const and reducers to traverse tree of moves deeper than 6...It doesn't happen always but most of the times! If i don't use ^:const it seems to not happen. Not

Re: Is there a better way to update a map atom?

2013-01-21 Thread Jim - FooBar();
ll the way, skipping reset! completely: (swap! game-objects (fn [objects] (reduce-kv #(assoc % %2 (update-object %3)) {} objects) )) Jim ps: I've not tested this but i don't see why this approach wouldn't work... On 21/01/13 20:24, Jim - FooBar(); wrote:

Re: Is there a better way to update a map atom?

2013-01-21 Thread Jim - FooBar();
...or you can go all the way, skipping reset! completely: (swap! game-objects (fn [objects] (reduce-kv #(assoc % %2 (update-object %3)) {} objects) )) Jim ps: I've not tested this but i don't see why this approach wouldn't work... On 21/01/13 20:24, Jim - FooBar(); wrote: u

Re: Is there a better way to update a map atom?

2013-01-21 Thread Jim - FooBar();
use reduce-kv on the original map to save some intermediate vector allocation...something similar has come up recently... (reduce-kv #(assoc % %2 (update-object %3)) {} @game-objects) Jim On 21/01/13 20:21, JvJ wrote: I'm updating a set of objects stored in a map, and I feel like the way I'm

Re: unboxed primitives and *print-dup* odd exception!

2013-01-21 Thread Jim - FooBar();
ka -XX:-UseCompressedOops (note the minus) or the enabled(as is the default) compressed oops aka -XX:+UseCompressedOops Does it happen even if you use eval ? On Mon, Jan 21, 2013 at 7:19 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote: our happiness was short-lived...I st

Re: unboxed primitives and *print-dup* odd exception!

2013-01-21 Thread Jim - FooBar();
but the returned class seems to be the same that PersistenVector - anyway I'm just guessing around, doesn't help :) On Mon, Jan 21, 2013 at 6:17 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote: On 21/01/13 17:07, Jim - FooBar(); wrote: On 21/01

Re: unboxed primitives and *print-dup* odd exception!

2013-01-21 Thread Jim - FooBar();
On 21/01/13 17:07, Jim - FooBar(); wrote: On 21/01/13 16:47, AtKaaZ wrote: Could you retry using this -XX:-UseCompressedOops surprisingly this worked! I don't get that error anymore... I used to have it but i thought it was completely unnecessary...I don't understand how this a

Re: unboxed primitives and *print-dup* odd exception!

2013-01-21 Thread Jim - FooBar();
On 21/01/13 16:47, AtKaaZ wrote: Could you retry using this -XX:-UseCompressedOops surprisingly this worked! I don't get that error anymore... I used to have it but i thought it was completely unnecessary...I don't understand how this affects the runtime of my program! Jim -- You received

Re: unboxed primitives and *print-dup* odd exception!

2013-01-21 Thread Jim - FooBar();
On 21/01/13 01:24, AtKaaZ wrote: yes, your code works if you don't use the "^:const", but why doesn't it work with ^:const when you just use the return of mapv (something with reify?)? Well, I just came home and tried a couple of things out...It appears that my code *doesn't* work if I don't

Re: unboxed primitives and *print-dup* odd exception!

2013-01-20 Thread Jim - FooBar();
tln xam0) (let [ xam (translate 1 2 mappings-8x8) ]);this one throws: can't embed even before Wrong number of args (3) ///end ignore Maybe someone can explain... This was enjoyable ;) On Mon, Jan 21, 2013 at 12:03 AM, Jim - FooBar();

Re: unboxed primitives and *print-dup* odd exception!

2013-01-20 Thread Jim - FooBar();
master/src/Clondie24/games/chess.clj#L238 On Sun, Jan 20, 2013 at 7:58 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote: Hi everyone, I came back to a project of mine after a couple of months only to be surprised by some cryptic exception! Imagine a 2d vector: (d

Re: ArrayVector for small vectors?

2013-01-20 Thread Jim - FooBar();
n 20, 2013 at 2:03 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote: I've recently noticed this: http://dev.clojure.org/jira/browse/CLJS-453 It is for cljs but it makes sense right? We do have them for maps - how hard can it be to make them for small vect

ArrayVector for small vectors?

2013-01-20 Thread Jim - FooBar();
I've recently noticed this: http://dev.clojure.org/jira/browse/CLJS-453 It is for cljs but it makes sense right? We do have them for maps - how hard can it be to make them for small vectors as well? In fact I'm surprised we don't have them already but perhaps I'm missing crucial details... dest

unboxed primitives and *print-dup* odd exception!

2013-01-20 Thread Jim - FooBar();
Hi everyone, I came back to a project of mine after a couple of months only to be surprised by some cryptic exception! Imagine a 2d vector: (def coords [[0 0] [0 1] [1 0] [1 1]]) ;;vector of vectors of longs ;;but let's try ints which are cached: (def coords (mapv #(apply vector-of :int %

Re: resolving a var when AOT-ed returns nil?

2013-01-16 Thread Jim - FooBar();
On 16/01/13 18:57, Aaron Cohen wrote: My first guess would be *ns* is different when you try it at the repl. Thanks a million Aaron...That was very helpful. I can't believe I wasted 2 more than 2 hours for something like this! Jim -- You received this message because you are subscribed to t

resolving a var when AOT-ed returns nil?

2013-01-16 Thread Jim - FooBar();
Hi everyone, Does anyone have a clue why this would perfectly run on the repl but will throw NPE when run from the jar or via lein2 run (aot-ed)? ;;there exist global vars of the form 'xxx-NER-tags' ;;first the repl everything works as expected...I get the map back PAnnotator.core=> (var-ge

Re: pool-map - a more disciplined version of pmap on top of executors

2013-01-14 Thread Jim - FooBar();
On 14/01/13 22:15, Marko Topolnik wrote: But... you were quite clear in stating that your function isn't lazy, and you were right to say that: /doall/ will not return until *all* the tasks have completed. Maybe you did want laziness, after all? I'm not entirely sure what you mean here...The on

Re: replacing specific symbols in arbitrary expressions

2013-01-14 Thread Jim - FooBar();
wow! this looks very useful... thanks Alan - knowledgeable as always! :-) Jim On 14/01/13 19:41, Alan Malloy wrote: (clojure.tools.macro/symbol-macrolet [P +, M -, T *] ...) The tools.macro code-walker is much smarter and more careful than any that you or I will ever write. On Monday, Jan

Re: pool-map - a more disciplined version of pmap on top of executors

2013-01-14 Thread Jim - FooBar();
On 14/01/13 21:27, Jim - FooBar(); wrote: On 14/01/13 20:47, Marko Topolnik wrote: What exactly is the value provided by ExecutorCompletionService? To my eyes, this function is quite similar to (comp doall pmap), but with shuffled result. There is no advantage to using the lazy approach to

Re: pool-map - a more disciplined version of pmap on top of executors

2013-01-14 Thread Jim - FooBar();
On 14/01/13 20:47, Marko Topolnik wrote: What exactly is the value provided by ExecutorCompletionService? To my eyes, this function is quite similar to (comp doall pmap), but with shuffled result. There is no advantage to using the lazy approach to submitting tasks: you could have simply used i

pool-map - a more disciplined version of pmap on top of executors

2013-01-14 Thread Jim - FooBar();
First of al let me say that pmap is NOT useless at all...I've encountered cases where I've had to accumulate a collection of 'pmap'-ed elements (say Strings) before the final task (say 'spit'-ing them) where having laziness is a big win in terms of memory footprint...On the other hand there are

Re: String wrapper that supports meta-data...

2013-01-09 Thread Jim - FooBar();
hehehe...I'm really stupid aren't I?:-[ thanks Stuart... Jim On 09/01/13 21:11, Stuart Sierra wrote: You could also do: (defrecord MString [string]) -S -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@g

Re: Idiom for transforming a map

2013-01-09 Thread Jim - FooBar();
On 09/01/13 18:20, Jim - FooBar(); wrote: Alex's solution is also quite idiomatic and it takes care of the transient/peristent conversion as well...It seems slightly heavier though cos you're building an intermediate vector. CORRECTION: you'd be building MANY intermediate ve

Re: Idiom for transforming a map

2013-01-09 Thread Jim - FooBar();
)) old-map)) ;;% is the initial value %2 is the key of the old-map & %3 is the value of the old-map Alex's solution is also quite idiomatic and it takes care of the transient/peristent conversion as well...It seems slightly heavier though cos you're building an intermediate vector. Jim

Re: Idiom for transforming a map

2013-01-09 Thread Jim - FooBar();
you can use reduce-kv...This is exactly its purpose - to be able to reduce maps without the need of destructuring example: (reduce-kv some-fn-with-3-args {} old-map) Jim On 09/01/13 18:09, Jonathon McKitrick wrote: I have a map derived from JSON data where the keys are strings. I want to bu

suggestions to improve my little queue-helper-functions?

2013-01-05 Thread Jim - FooBar();
Hi everyone, Since i was reading about queues these days i decided to write a couple of functions that would include the basic queue functionality that I might need when working with queues in Clojure. They are pretty basic and I've not thoroughly tested them but they seem to behave well...I'm

Re: What would you use a #[] data literal for?

2013-01-04 Thread Jim - FooBar();
od certain things...back to reading! :-) [1] http://briancarper.net/blog/449/ Jim On 04/01/13 19:20, Jim - FooBar(); wrote: Greetings and all best wishes for 2013 to everyone!!! :-) First of all, forgive me for hijacking this thread but I what I started to do originated from this thread and so I

Re: What would you use a #[] data literal for?

2013-01-04 Thread Jim - FooBar();
Greetings and all best wishes for 2013 to everyone!!! :-) First of all, forgive me for hijacking this thread but I what I started to do originated from this thread and so I feel it is related. So, for the fun (and the learning) of it, I thought to create a queue literal myself as suggested in

Re: Call namespace's functions from a record

2012-12-24 Thread Jim - FooBar();
r with the "." came from the fact Component is a compiled class and I believed I had to follow the Java standard writing. Thank for your help. On 12/24/2012 01:42 PM, Jim - FooBar(); wrote: Lose the "." - call children? like this: (children? c) and make sure you can see the t

Re: Call namespace's functions from a record

2012-12-24 Thread Jim - FooBar();
Lose the "." - call children? like this: (children? c) and make sure you can see the test-record.component namespace from your user ns (apart from importing the record class). HTH, Jim On 24/12/12 11:55, Christian Sperandio wrote: Hi, I'm testing the use of records in Clojure and I have som

Re: gen-interface and deftype with types, compilation problem

2012-12-18 Thread Jim - FooBar();
On 18/12/12 18:46, Vladimir Matveev wrote: Well, it is news for me since it is not documented anywhere. Why is this so? it is at least mentioned here in an example...look at line 6 http://clojuredocs.org/clojure_core/clojure.core/definterface Jim -- You received this message because you ar

Re: Using functions from Java packages

2012-12-16 Thread Jim - FooBar();
Java methods are not first-class...you cannot use them like that...you need an object to call the method on...by wrapping the java call with an anonymous fn you are able to use Math/sqrt as 1st-class... Hope it is clearer now... Jim On 16/12/12 19:33, Larry Travis wrote: It almost certainly h

Re: Need ideas for carving project into namespaces

2012-12-15 Thread Jim - FooBar();
r foo=> (ns user) ;;back to user ns (doesn't depend on foo) nil user=> ((record-factory "foo.Bar") 1 2) #foo.Bar{:x 1, :y 2} user=> (Bar. 1 2) CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: Bar, compiling:(NO_SOURCE_PATH:1) Jim On 12/12/12

Re: Need ideas for carving project into namespaces

2012-12-15 Thread Jim - FooBar();
I know my reply is a bit delayed but the past 2-3 days have been frantic! On 12/12/12 18:00, Michał Marczyk wrote: @Jim: That function generates factory functions which themselves use no reflection and incur no performance penalty at all. The only performance hit visible at runtime comes from t

Re: Need ideas for carving project into namespaces

2012-12-12 Thread Jim - FooBar();
On 12/12/12 17:37, Mark Engelberg wrote: Yes and no. That's basically what I'm trying to do, but I only have a handful of concrete implementations to choose from, so I don't mind writing a hard-coded cond that chooses between them based on some sort of keyword that the user passes in. So the

Re: Multiple java class import

2012-12-09 Thread Jim - FooBar();
Rich explains why here: https://groups.google.com/forum/?fromgroups=#!msg/clojure/-gCg_0wmT5o/H7WobsV-yt0J Jim On 09/12/12 15:06, Yinka Erinle wrote: Thanks Jim. I wonder why. On Sunday, December 9, 2012 2:43:54 PM UTC, Jim foo.bar wrote: Unfortunately you have to import each class separ

Re: Multiple java class import

2012-12-09 Thread Jim - FooBar();
Unfortunately you have to import each class separately...no wild-cards in ns declarations :-( Jim On 09/12/12 14:21, Yinka Erinle wrote: Hi, Is it possible to import multiple java classes using import? e.g (import '(java.naming.*)) Or will I have to import each class separately? Thanks, Yin

Re: Exception when loading clojure.core.reducers

2012-12-09 Thread Jim - FooBar();
Use java 7 with clojure 1.5.0-beta1 or use java6 with the jsr166.jar already in your classpath...Alternatively, if you use some clojure version older than 1.5.0-beta1 with Java 7 you may need to build clojure on your system... Hope that helps... Jim On 09/12/12 12:44, Alex Baranosky wrote:

Re: abysmal multicore performance, especially on AMD processors

2012-12-09 Thread Jim - FooBar();
Hi Lee, Would it be difficult to try the following version of 'pmap'? It doesn't use futures but executors instead so at least this could help narrow the problem down... If the problem is due to the high number of futures spawned by pmap then this should fix it... (defn- with-thread-pool* [

Re: abysmal multicore performance, especially on AMD processors

2012-12-08 Thread Jim - FooBar();
Even though this is very surprising (and sad) to hear, I'm afraid I've got different experiences... My reducer-based parallel minimax is about 3x faster than the serial one, on my 4-core AMD phenom II and a tiny bit faster on my girlfriend's intel i5 (2 physical cores + 2 virtual). I'm suspecti

Re: (def some? (comp not nil? some))

2012-12-02 Thread Jim - FooBar();
Its perfectly fine to use some as a predicate as far as I know...works excellent with if-let/when-let - what is the problem? Jim On 02/12/12 19:47, Tom Hall wrote: Hi Guys, We seem to have not-any? but not an any? function, I know we have some but it is not a predicate and I found myself def

amap, areduce ... hopefully afilter, aremove , aconcat, amapcat etc

2012-11-23 Thread Jim - FooBar();
Hi all, For the past 2 hours I've been trying to write 'afilter' or 'aremove' on top of 'areduce' but I'm totally failing...something goes wrong with the type hints I suspect...I started with the simplest case possible: (defn aremove [pred ^longs ns] (areduce ns i ret (long-array (alen

Re: Deserialization of a Record

2012-11-21 Thread Jim - FooBar();
I'm having the same problem as Chris... Serialization and deserialization from a REPL works fine whereas from the GUI it doesn't...ClassNotFoundException... binding *use-context-classloaders* to false did not help and invoking a future or an agent from the event handler doesn't work either...Th

Re: GPU programming (with calx) to parallise a reducer?

2012-11-21 Thread Jim - FooBar();
On 21/11/12 16:22, Timothy Baldridge wrote: If you are running pure arithmetic code over primitive arrays, and not doing allocation (so no seqs, higher order functions, etc.) then it's pretty straight forward to translate Clojure code to GPU code. Now notice that all the above qualifications ar

GPU programming (with calx) to parallise a reducer?

2012-11-21 Thread Jim - FooBar();
Hi all, I just came back from a seminar at Manchester University where the speaker from ARM spent an hour talking about GPUs, OPENCL etc etc. The thing that is stuck in my head is that, apparently ARM is trying to create this language (PENCIL) which at the moment is a c-variant but they are

Re: printing for non-human consumption but want *read-eval* false

2012-11-20 Thread Jim - FooBar();
aaa ok I see... so I can have my cake and eat it too? :-) I'm just surprised cos slurp/spit has never failed me before and I've tried with maps, vectors & lists but everyone is suggesting it is wrong practice... anyway, thanks for taking the time... Jim On 20/11/12 19:58, Stuart Sierra wro

printing for non-human consumption but want *read-eval* false

2012-11-20 Thread Jim - FooBar();
Until recently I was using the following snippet for writing a map on a file...basically I was using spit/slurp. Nothing easier (defn data->string "Writes the object b on a file f on disk as a string." [b fname] (io! (spit fname b))) (defn string->data "Read the file f back on memory safely (

Re: Run Counterclockwise nREPL on specific port

2012-11-20 Thread Jim - FooBar();
On 20/11/12 18:08, Vladimir Tsichevski wrote: I've started a nREPL process embedded into some Java application. I can successfully connect to it and execute code remotely from other Clojure process. I'd be very interested if you could share some code...I want to do something similar in one of

Re: defpromise?

2012-11-20 Thread Jim - FooBar();
On 20/11/12 17:45, Moritz Ulrich wrote: How often do you need a top-level promise? Where are the advantages over the def-only example? if you consider (defn x...) to have an advantage over (def x (fn...)), then this is the same case...People don't often need top-level promises but sometimes t

Re: need to build clojure myself again?

2012-11-19 Thread Jim - FooBar();
On 19/11/12 19:48, Sean Corfield wrote: Try -beta1 - I recall a patch recently that was supposed to fix this. thanks it works! :) 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 Not

need to build clojure myself again?

2012-11-19 Thread Jim - FooBar();
Moving from clojure-1.5-alpha1 to -alpha4 i get this again: NoClassDefFoundError jsr166y/ForkJoinTask clojure.core.reducers/fjinvoke (reducers.clj:61) It took me a minute but eventually I remembered the same thing happened when I moved from 1.4 to 1.5-alpha1 in order to use reducers. There s

Re: Idiomatic equivalent for double dispatch in clojure?

2012-11-19 Thread Jim - FooBar();
for what its worth, I'm building a highly polymorphic board-game engine [1] and I've stayed away from multimethods...I've used every single polymorphism capabillity that clojure provides (records/protocols, map-based, HOFs etc) except multi-methods. Performance is acritical matter for this pro

Re: Can't define method not in interfaces...what is this?

2012-11-18 Thread Jim - FooBar();
? K. On 18 November 2012 21:16, Jim - FooBar(); wrote: I'm struggling to find an explanation for this... what on earth is this? what does it mean? Can anyone clarify where this exception comes from? Jim -- You received this message because you are subscribed to the Google Groups "Cl

Can't define method not in interfaces...what is this?

2012-11-18 Thread Jim - FooBar();
I'm struggling to find an explanation for this... what on earth is this? what does it mean? Can anyone clarify where this exception comes from? Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

Re: [ANN] Clojars Releases repository

2012-11-18 Thread Jim - FooBar();
On 18/11/12 15:14, Nelson Morris wrote: enclog 0.5.8 appears in the releases repo, so everything is ok. No, unfortunately everything is not ok...fetching the jar from a project results in: Could not transfer artifact enclog:enclog:pom:0.5.8 from/to clojars (https://clojars.org/repo/): Check

Re: [ANN] Clojars Releases repository

2012-11-18 Thread Jim - FooBar();
rase:Forbidden. Failed to deploy artifacts: Could not transfer artifact enclog:enclog:pom:0.5.8 from/to clojars (https://clojars.org/repo/): Access denied to: https://clojars.org/repo/enclog/enclog/0.5.8/enclog-0.5.8.pom, ReasonPhrase:Forbidden. Is this important? Jim On 18/11/12 14:46, Jim

Re: [ANN] Clojars Releases repository

2012-11-18 Thread Jim - FooBar();
artifacts: Could not transfer artifact enclog:enclog:pom:0.5.8 from/to clojars (https://clojars.org/repo/): Access denied to: https://clojars.org/repo/enclog/enclog/0.5.8/enclog-0.5.8.pom, ReasonPhrase:Forbidden. Is this important? Jim On 18/11/12 14:46, Jim - FooBar(); wrote: On 18/11/12 14:39

Re: [ANN] Clojars Releases repository

2012-11-18 Thread Jim - FooBar();
On 18/11/12 14:39, Nelson Morris wrote: The previous one was a bit strict on the whitespace I just pasted the same with no wxtra white-space and now I'm getting Invalid anti-forgery token my god what is happening? Jim -- You received this message because you are subscribed to the Google

Re: [ANN] Clojars Releases repository

2012-11-18 Thread Jim - FooBar();
Followed the instructions below exactly but clojars says 'Invalid PGP public key'... any clues? Jim On 18/11/12 13:56, Phil Hagelberg wrote: If you don't have a key yet, generate one with `gpg --gen-key`. The default settings are pretty good, though I'd recommend making it expire in a year or

Re: "explicit progression-of-time constructs"? (wikipedia)

2012-11-18 Thread Jim - FooBar();
The constructs it means are probably reference-types. Jim On 18/11/12 13:42, Hank wrote: According to Wikipedia, Clojure provides "explicit progression-of-time constructs": http://en.wikipedia.org/wiki/Clojure Anyone any clue which constructs are meant by that? The term doesn't even resolve

Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-15 Thread Jim - FooBar();
Oops! I can use :dispose instead of :exit. If it does what it implies, it should do the job... Jim On 15/11/12 23:29, Jim - FooBar(); wrote: Wow! Unbelievable ! So there is nothing wrong with my code? After reading this thread, it seems like a serious issue...the entire repl becomes

Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-15 Thread Jim - FooBar();
oups.google.com/forum/?fromgroups=#!topic/leiningen/QLcZIK2e5C0 I agree, it's annoying, but not sure how to workaround it? Maybe with a heartbeat between nrepl client/server with the client closing the repl session if the heartbeat been missing for x seconds... Hth! K. On 13 November 2012

Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-13 Thread Jim - FooBar();
all lein2 project on github with what you previously pasted in this thread correctly spread over files, etc., so that it's really quick to reproduce the error? Thanks, Laurent Sent from a smartphone, please excuse the brevity/typos. Le 13 nov. 2012 ą 22:52, "Jim - FooBar();" a éc

Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-13 Thread Jim - FooBar();
On 13/11/12 21:45, Dave Ray wrote: Dump the JVM's threads [1] and see what it's stuck on? What am I looking for? I don't see anything related with my project...IT is pretty obvious from the output though that everything is waiting! No clue what though... Jim

Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-13 Thread Jim - FooBar();
On 13/11/12 20:36, Dave Ray wrote: Just a wild guess, but if something's shown on the screen, #'draw-tiles will probably get invoked to paint the canvas and it might end up blocking on the #'curr-game promise. thanks for your response Dave, even though I'm not entirely sure what you mean, I can

code waiting on something - cannot debug - driving me insane!!!

2012-11-13 Thread Jim - FooBar();
Hi all, I've had this unbelievable problem for some time now but I'm sick and tired of ignoring it! It is literally driving nuts...Due to the nature of the problem my terminal hangs and Eclipse crashes altogether (potentially losing work)! So what is the problem...Well I really don't have a

Re: [Ann] Kibit 0.0.6

2012-11-11 Thread Jim - FooBar();
Kibit is probably looking for syntactic patterns not for types or anything like that... but still, why is it suggesting this? Jim On 11/11/12 15:58, Jim - FooBar(); wrote: Kibit says: Consider using: (vec (:children (game-tree dir b next-level))) instead of: (into [] (:children (game

Re: [Ann] Kibit 0.0.6

2012-11-11 Thread Jim - FooBar();
Kibit says: Consider using: (vec (:children (game-tree dir b next-level))) instead of: (into [] (:children (game-tree dir b next-level))) why is that? Does it make a difference if '(:children (game-tree dir b next-level))' returns a reducer? Jim On 11/11/12 15:08, Jonas wrote: Hi Tod

does core.logic use core.match?

2012-11-11 Thread Jim - FooBar();
Hi all, looking at core.logic on github I can see no dependencies on the optimized pattern-matching lib 'core.match', however David implies that does core.logic uses core.match under the hood in one of his talks [ http://www.infoq.com/presentations/The-Mapping-Dilemma]... have I misunderstoo

Re: transient/persistent! not worth for less than 7-8 operations

2012-11-09 Thread Jim - FooBar();
e constant time operations, but it would not surprise me if in practice transients aren't universally faster than persistent. Performance in different environments varies wildly, so I would doubt results from a small benchmark on a single machine are universally applicable. Benchmarking is hard,

Re: transient/persistent! not worth for less than 7-8 operations

2012-11-09 Thread Jim - FooBar();
No I'm on Ubuntu 12.04 64bit, oracle-java 7, clojure 1.4... Jim On 09/11/12 03:36, Herwig Hochleitner wrote: Hmm, this is the second (unverified) report of transients being slower than persistents. Jim, are you on OSX too, by chance? Which JVM? -- You received this message because you are su

Re: transient/persistent! not worth for less than 7-8 operations

2012-11-08 Thread Jim - FooBar();
to and from transients should be constant time operations, but it would not surprise me if in practice transients aren't universally faster than persistent. Performance in different environments varies wildly, so I would doubt results from a small benchmark on a single machine are u

transient/persistent! not worth for less than 7-8 operations

2012-11-08 Thread Jim - FooBar();
Some quick benchmarking that I did, showed that it is actually more expensive to convert to transient, conj/assoc and convert back to persistent than the regular conj/assoc unless you want to do more than 8 operations at a time (preferably more than that). My experiments were on vectors and the

Re: Coding Standard - ns usage

2012-11-08 Thread Jim - FooBar();
I'm pretty sure this is still valid :) Jim On 08/11/12 16:57, David McNeil wrote: I notice the following item at http://dev.clojure.org/display/design/Library+Coding+Standards "Be explicit and minimalist about dependencies on other packages. (Prefer the :only option to use and require)."

Re: with-open and line-seq

2012-11-07 Thread Jim - FooBar();
This is exactly the approach I'm taking...'doall' retains the head so with massive files it will break...'doseq' will not. at least this is my understanding... Jim On 07/11/12 19:25, Sean Corfield wrote: I suspect it's considered more idiomatic to do: (defn process-records [process file-nam

Re: with-open and line-seq

2012-11-07 Thread Jim - FooBar();
ay. It seems like the simplest approach is to just adjust my instincts and always make sure the sequence is fully consumed within the with-open. Cheers, Dave On Wed, Nov 7, 2012 at 10:56 AM, Jim - FooBar(); wrote: I know I'm coming a bit late in this thread but i did not have the chance t

Re: with-open and line-seq

2012-11-07 Thread Jim - FooBar();
I know I'm coming a bit late in this thread but i did not have the chance to reply earlier... Can somebody elaborate briefly what is the problem with the combination of with-open/doseq/line-seq? In a project of mine I'm dealing with files larger than 200MB (which of course will not even open o

Re: thinking in data, polymorphism, etc.

2012-10-25 Thread Jim - FooBar();
You say that from the safe standpoint of being able to enumerate all OSes in advance...I can imagine a world where anyone can have his own OS. :-) Seriously now, this is not production code obviously! just a demo... Jim On 25/10/12 21:04, Brandon Bloom wrote: |(||fn||[||_ _||]||;dispatch

Re: Generating permutations in core.logic

2012-10-25 Thread Jim - FooBar();
On 25/10/12 20:57, Jordan Lewis wrote: Jim, thanks for the suggestion. I am trying to get a feel for how core.logic works, not reinvent code from the combinatorics library. Fair enough... :-) Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

Re: thinking in data, polymorphism, etc.

2012-10-25 Thread Jim - FooBar();
On 25/10/12 20:33, Laurent PETIT wrote: Wow, this kind of decision is not for the faint of heart. Not to be taken lightly, that's for sure! Because then, your code becomes non pure, harder to test, etc. not saying that it was not appropriate in your case, but rather than used as a demonstration

Re: Generating permutations in core.logic

2012-10-25 Thread Jim - FooBar();
I think you want to have a look at clojure.math.combinatorics Jim On 25/10/12 20:10, Jordan Lewis wrote: Hi, I'm new to core.logic and logic programming in general. I tried to write a small program to generate all permutations of any size for an input list with unique elements. To start, I h

Re: thinking in data, polymorphism, etc.

2012-10-25 Thread Jim - FooBar();
On 25/10/12 19:49, Brian Craft wrote: heh. I see. Thanks! No problem...;-) Jim ps: It goes without saying that you shouldn't sprinkle your code with multi-methods just because you can! Trust me, I know they are nice and very tempting to use but save them for when you truly need multiple-di

Re: what is the modern equivalent of clojure.contrib.java-utils/file?

2012-10-25 Thread Jim - FooBar();
On 25/10/12 19:57, Sean Corfield wrote: On Thu, Oct 25, 2012 at 11:39 AM, larry google groups wrote: How do you know this? Where is this documented? I find myself baffled as to what is a dependency and what is not. http://clojure.github.com If it's listed separated there, it's a contrib you n

Re: what is the modern equivalent of clojure.contrib.java-utils/file?

2012-10-25 Thread Jim - FooBar();
On 25/10/12 19:39, larry google groups wrote: How do you know this? Where is this documented? I find myself baffled as to what is a dependency and what is not. OK I'll grant you this...Documentation is not the strong part of Clojure. There have been/still are efforts to improve on this but ge

Re: thinking in data, polymorphism, etc.

2012-10-25 Thread Jim - FooBar();
On 25/10/12 19:38, Brian Craft wrote: Multimethods seem like a convenience layer over duck typing: probe the object to see what it is, then dispatch. Is that a fair description? Not exactly...MUlti-methods have no limitations with regarding dispatch. You can dispatch on anything...I mean ANYTH

<    1   2   3   4   5   6   7   8   >