Re: STM and persistent data structures performance on mutli-core archs

2014-03-29 Thread Andy C
Hi, So this is a follow-up. I claimed that 1 CPU core can saturate the memory but it turns out I was wrong, at least to some extend. Driven by curiosity I decided to do some measurements and test my somewhat older MBP 2.2GHz Inter Core i7. While it obviously all depends on the hardware, I thought

Re: Performance trouble with Processing jar

2014-03-29 Thread tamichan
Thanks Adam (def applet (new PApplet)) -> (def ^PApplet (new PApplet)) results in amazing speed! And, quil certainly uses these type hints, sorry. In this trouble, I learned the principle of using type hints for much java method call. Ideally I wish clojure compiler may automatically add type

Re: Reuse of Java instances that have the same value

2014-03-29 Thread James Reeves
What about memoizing (clojure.core/memoize) the function that creates the leaves? - James On 29 March 2014 11:36, wrote: > Hi all, > > maybe someone here can point me to the right direction. I have a large > lookup tree (millions of entries), but the values in the leafs don't > contain much in

Re: java interop help for beginner calling java class

2014-03-29 Thread bww00amd...@yahoo.com
Thanks I did not set the hierarchy I will give that a whirl Regards Bryan On Saturday, March 29, 2014 1:07:40 PM UTC-5, Chris Shellenbarger wrote: > > Did you move it to the corresponding directory structure? So, > com.example.mystuff would need a directory hierarchy like > com/example/mystuf

Re: test.check, quickcheck concurrency

2014-03-29 Thread Reid Draper
Hi Brian, clojure.test.check does not currently ship with any concurrency support. That being said, I've been working an implementation on Erlang's PULSE, which I hope to have usable in the next couple months [1][2]. John's talk touches on using state machines to test concurrent code, which is

Re: probably a noobie question: apparent memory leak

2014-03-29 Thread Ryan Waters
Nice! I hadn't seen that before. Thank you both. On Sat, Mar 29, 2014 at 3:29 PM, Jonas wrote: > You could give core.rrb-vector[1]. From the docs: > > The main API entry points are clojure.core.rrb-vector/catvec, > performing vector concatenation, and clojure.core.rrb-vector/subvec, which

Re: probably a noobie question: apparent memory leak

2014-03-29 Thread Jonas
You could give core.rrb-vector[1]. From the docs: The main API entry points are clojure.core.rrb-vector/catvec, performing vector concatenation, and clojure.core.rrb-vector/subvec, which produces a new vector containing the appropriate subrange of the input vector (in contrast to clojure.co

Re: using contrib functions

2014-03-29 Thread Sean Corfield
On Mar 29, 2014, at 9:39 AM, Sam Ritchie wrote: > defadt defines an algebraic data type - so, imagine a record with a finite > number of implementations (Boolean is an algebraic data type since it only > has "true" and "false", for example. Chess pieces would be another one.) > > Once you defin

Re: probably a noobie question: apparent memory leak

2014-03-29 Thread Ryan Waters
If you do a (count @mem) it reports the length of the atom's vector isn't growing without bounds. It seems counterintuitive that the parts of the old vector wouldn't get garbage collected because the atom no longer points to them. But I guess I need to rtfd. Thank you. On Sat, Mar 29, 2014 at

Re: java interop help for beginner calling java class

2014-03-29 Thread Chris Shellenbarger
Did you move it to the corresponding directory structure? So, com.example.mystuff would need a directory hierarchy like com/example/mystuff. The mystuff directory is where you need to put your java files that are in the com.example.mystuff package. -- You received this message because you ar

Re: using contrib functions

2014-03-29 Thread Sam Ritchie
defadt defines an algebraic data type - so, imagine a record with a finite number of implementations (Boolean is an algebraic data type since it only has "true" and "false", for example. Chess pieces would be another one.) Once you define an ADT you can use that contrib library's "match" macro

Reuse of Java instances that have the same value

2014-03-29 Thread vtekal
Hi all, maybe someone here can point me to the right direction. I have a large lookup tree (millions of entries), but the values in the leafs don't contain much information. That is, the number of unique values stored in leafs is rather small, same values are used over and over again. I load th

Re: probably a noobie question: apparent memory leak

2014-03-29 Thread Aaron Cohen
On Sat, Mar 29, 2014 at 10:09 AM, Ryan Waters wrote: > I have some code that blows up the heap and I'm not sure why. I've > reduced it down to the following. > > I've tried to make sure the atom doesn't have boundless growth and I > didn't think 'while' hangs on to the head of sequences so I'm e

Re: Performance trouble with Processing jar

2014-03-29 Thread Adam Clements
Have you got type hints? If you do a java method call on something which isn't type hinted then clojure has to use reflection to look up a list of the available methods, which is slw. If however you tell it what type you expect it to be, it can better optimise it. So in the above code you would

probably a noobie question: apparent memory leak

2014-03-29 Thread Ryan Waters
I have some code that blows up the heap and I'm not sure why. I've reduced it down to the following. I've tried to make sure the atom doesn't have boundless growth and I didn't think 'while' hangs on to the head of sequences so I'm embarrassed to say I'm stumped. (defn leaks-memory [] (let

Re: Adding multiple entries in a vector with (something like) for.

2014-03-29 Thread Paul Schulz
Ooo.. and Ah-ha! That's (almost) exactly what I was thinking of, and will work very nicely. I was thinking that I could just use a macro in the place of ~@ and somehow avoid the initial quote. Thank you.. On Saturday, 29 March 2014 20:20:57 UTC+10:30, Jozef Wagner wrote: > > Well you can alway

Re: Adding multiple entries in a vector with (something like) for.

2014-03-29 Thread Jozef Wagner
Well you can always abuse syntax quote :) user=> `[:first :second ~@(for [x (range 1 5)] {:name (keyword (str "third-" x))})] [:first :second {:name :third-1} {:name :third-2} {:name :third-3} {:name :third-4}] Jozef On Sat, Mar 29, 2014 at 10:41 AM, Paul Schulz wrote: > Hi Jozef, > > Thank y

Re: Error when starting REPL

2014-03-29 Thread Arie van Wingerden
Thx Niels, that works! 2014-03-29 0:46 GMT+01:00 Niels van Klaveren : > Its a problem with writing to a temp folder. Run Ccw as admin, or take a > look at the counterclockwise group for a solution that doesn't need that. > > -- > You received this message because you are subscribed to the Google

Re: Adding multiple entries in a vector with (something like) for.

2014-03-29 Thread Paul Schulz
Hi Jozef, Thank you. I was hoping for a syntax that I could use inside the structure (similarly to the way that huccup supports embedded 'for' in HTML definitions). On Saturday, 29 March 2014 19:53:06 UTC+10:30, Jozef Wagner wrote: > > How about using 'into'? > > (into [:first :second] (for [x

Re: dependencies from github

2014-03-29 Thread t x
Ray, David, Aaron, Phil, dgrnbrg: Understood. Thanks for clarifying my misunderstandings! On Thu, Mar 27, 2014 at 10:39 AM, dgrnbrg wrote: > Voom is a Lein plugin that lets you depend on a repository and pins you to a > specific commit. It also provides tools manage systems spanning multiple

Re: Adding multiple entries in a vector with (something like) for.

2014-03-29 Thread Jozef Wagner
How about using 'into'? (into [:first :second] (for [x (range 1 5)] {:name (keyword (str "third-" x))})) Jozef On Sat, Mar 29, 2014 at 9:25 AM, Paul Schulz wrote: > Greetings, > I have a vector definition (containing maps), where a lot of them are very > similar. > eg. > [ :first >:seco

Performance trouble with Processing jar

2014-03-29 Thread tamichan
Hi All I'm writing graphic clojure code with Processing jars. When I wrote heavy draw code, I found clojure code is slower than an equivalent of java. Probably, the cause is java method call. I call processing drawing method thousands times per one frame. (.line applet x1 y1 z1 x2 y2 z2) So de

Adding multiple entries in a vector with (something like) for.

2014-03-29 Thread Paul Schulz
Greetings, I have a vector definition (containing maps), where a lot of them are very similar. eg. [ :first :second {:name :third-1} {:name :third-2} ] I would like to use something like the following to replace the iterated rows (for [x (range 1 2)] {:name (keyword (str "thir