Re: ANN: babbage 1.0.0, a library for easily gathering data and computing summary measures in a declarative way

2013-02-02 Thread john
I would be very interested to learn which kind of practical problems these engines can solve? Any real-world examples would help me understand the benefit of this approach. Many greetings John Am Samstag, 2. Februar 2013 07:44:25 UTC+1 schrieb AtKaaZ: seems a bit similar to

Migrate from IDEs to emacs or vim (already experienced with it) ?

2013-02-02 Thread Ersin Er
Hi all, Just as Colin Yates announced in the thread emacs - how to wean me off the family of Java IDEs I am in the process of moving to emacs or vim for active development with Clojure. My question is a bit different: I am already an experienced vim user. I have been using vim mostly for editing

Re: Migrate from IDEs to emacs or vim (already experienced with it) ?

2013-02-02 Thread Wolodja Wentland
On Sat, Feb 02, 2013 at 12:09 +0200, Ersin Er wrote: Just as Colin Yates announced in the thread emacs - how to wean me off the family of Java IDEs I am in the process of moving to emacs or vim for active development with Clojure. My question is a bit different: I am already an experienced

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

2013-02-02 Thread Leandro Moreira
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)) And I would like to apply the *pmap* over the partitions, something like: (the line bellow doesn't work) *user=* (pmap + (partition-all 5 (range 1 20))) *I would like to

Re: Migrate from IDEs to emacs or vim (already experienced with it) ?

2013-02-02 Thread Jay Fields
If you knew neither, I'm convinced emacs would be the right answer. You'll have more peers to using both that can help you work through problems. You can edit the environment using a language that is similar to clojure... There are many small reasons like that. But, you're desire to stay in vim

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

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 'apply'

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

2013-02-02 Thread Leandro Moreira
Hi Jim, Thanks for your help time, how do I apply instead of reduce? I was looking the documentation of pmap and it says *(pmap fn coll colls)* So I think we can use pmap this way: *(pmap + '(1 2 3) '(4 5 6) '(7 8 9) )* Which gives us the result: *(12 15 18)* My intention it's only to

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

2013-02-02 Thread Leonardo Borges
this works: (apply pmap + (partition-all 5 (range 1 20))) And then reducing the overall result: (reduce + (apply pmap + (partition-all 5 (range 1 20 Leonardo Borges www.leonardoborges.com On Sun, Feb 3, 2013 at 12:35 AM, Leandro Moreira leandro.rhc...@gmail.com wrote: Hi Jim, Thanks

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 Marko Topolnik
no need for macros and stuff...actually apply is a macro... Not really, it's a function. But it does rely on the low-level IFn interface methods. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: *read-eval* vulnerability

2013-02-02 Thread Chas Emerick
Hi Baishampayan, I got such errors when I first started working on the patch; they were caused by the compiler using print-dup'd strings to create namespaces instead of emitting bytecode (which the patched build includes). Is it possible that you have both an org.clojure/clojure jar and the

Re: *read-eval* vulnerability

2013-02-02 Thread Baishampayan Ghose
I put the canonical clojure artefact in a global exclusions vector in my project.clj. The classpath doesn't have any duplicate clojure jar in it. I was testing it out with `lein repl`, since swank-clojure is broken in different ways. Regards, BG On Sat, Feb 2, 2013 at 7:43 PM, Chas Emerick

Re: *read-eval* vulnerability

2013-02-02 Thread Baishampayan Ghose
By the way, this is how swank-clojure 1.4.4 is failing to compile with the patched clojure jar - Exception in thread main java.lang.IllegalArgumentException: No matching ctor found for class clojure.lang.Compiler$CompilerException, compiling:(swank/commands/basic.clj:183:24) at

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

2013-02-02 Thread Leandro Moreira
Thanks all, you were really helpful ! -- -- 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

Re: *read-eval* vulnerability

2013-02-02 Thread Chas Emerick
Ah, I didn't grok that you were reporting two separate breakages (one in swank, one in your app). I think the problem is in how the lein-swank plugin sets up dependencies (or, how Leiningen itself applies :exclusions). If you don't have an org.clojure/clojure dependency in your project, then

Re: *read-eval* vulnerability

2013-02-02 Thread Chas Emerick
One thing that hasn't been mentioned so far is that AOT-compiled classfiles generated using prior builds of Clojure will not load using a build of Clojure that includes a patch like this. Just something to consider for those of you taking the time to test, etc. - Chas -- -- You received

Re: ANN: babbage 1.0.0, a library for easily gathering data and computing summary measures in a declarative way

2013-02-02 Thread Ben Wolfson
On Sat, Feb 2, 2013 at 12:28 AM, john john.vie...@gmail.com wrote: I would be very interested to learn which kind of practical problems these engines can solve? Any real-world examples would help me understand the benefit of this approach. We're using it for (nearly) all of our analytics

Re: clojure web developer job offer

2013-02-02 Thread Denis Labaye
On Fri, Feb 1, 2013 at 12:01 AM, Vagif Verdi vagif.ve...@gmail.com wrote: Our company is looking for a full time or consultant developer. The job is to maintain and continue actively develop web application / internal webservices written in clojure. We use compojure web framework, darcs for

Re: ANN: babbage 1.0.0, a library for easily gathering data and computing summary measures in a declarative way

2013-02-02 Thread Jason Wolfe
Hi -- author of Prismatic's Graph here. (just released last week: https://github.com/prismatic/plumbing) This looks like a very cool library -- thanks for the release! You're right that our fnk and defnk take keyword rather than positional arguments, and in that sense are 'idiosyncratic'.

Re: ANN: babbage 1.0.0, a library for easily gathering data and computing summary measures in a declarative way

2013-02-02 Thread David Powell
I'm sure these libraries do the job better, but just for interest, here is a fun example of using finger-trees to maintain stats for a collection as it gets updated: https://gist.github.com/672592 -- Dave -- -- You received this message because you are subscribed to the Google Groups Clojure

ANN: Simulant: a framework for simulation-based testing

2013-02-02 Thread Stuart Halloway
I am pleased to announce the release of Simulant, an open-source framework for simulation-based testing built using Datomic and Clojure: https://github.com/Datomic/simulant Feedback welcome! Stu -- -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Migrate from IDEs to emacs or vim (already experienced with it) ?

2013-02-02 Thread Kris Jenkins
For what it's worth, I'm a diehard vi user and have been for many years, but Emacs' latest Vim-emulation (called evil-mode) is really very, very good. So good that Emacs is fighting to be my favourite version of Vi yet. You'll be walking a lonely road, but if you want Emacs *and* Vim, it's

Re: Migrate from IDEs to emacs or vim (already experienced with it) ?

2013-02-02 Thread Curtis Gagliardi
I've been using vim pretty exclusively for the last 5 years or so, but in the last few weeks I've been using emacs with evil mode and I couldn't be happier. It's a beautiful thing to have emacs extreme extensibility with vim's vastly superior keybindings. I have my config here if you're

Re: Migrate from IDEs to emacs or vim (already experienced with it) ?

2013-02-02 Thread Gregory Graham
I first learned vi (the predecessor to vim) working on a senior project in college in the early 1980s, and then learned Gosling emacs at my first job in the late 1980s. Since then, I have gone back and forth between the two for various reasons, and I'm about equally comfortable in each of them.

Why is this code so slow?

2013-02-02 Thread Alexandros Bantis
Hello all. I'm working through the Project Euler problems in Java, Scala, Clojure (trying to learn all three?!?). I notice that for one particular problem, I use--more or less--a similar algorithm for all three, but the clojure code runs about 20-30 times slower than the java/scala versions.

ANN: http-kit 2.0.0.RC2, high performance HTTP Server Client for Clojure

2013-02-02 Thread Shen, Feng
Hi, After extensive test, known bugs fixed, documentation ready, http-kit reaches 2.0.0.RC2 [http-kit 2.0.0-RC2] ; Add to your project.clj Documentation: http://http-kit.org Github: https://github.com/http-kit/http-kit The goal of http-kit is to provide a clean, robust HTTP server/client,

Re: ANN: http-kit 2.0.0.RC2, high performance HTTP Server Client for Clojure

2013-02-02 Thread Baishampayan Ghose
Congratulations, Feng. HTTP-Kit is awesome! ~BG On Sun, Feb 3, 2013 at 8:50 AM, Shen, Feng shen...@gmail.com wrote: Hi, After extensive test, known bugs fixed, documentation ready, http-kit reaches 2.0.0.RC2 [http-kit 2.0.0-RC2] ; Add to your project.clj Documentation:

Re: Why is this code so slow?

2013-02-02 Thread Feng Shen
I can only think about a bit faster version: 46555ms = 23846ms for 20 (defn smallest-multiple-of-1-to-n [n] (let [divisors (range 2 (inc n))] (loop [i n] (if (loop [d 2] (cond ( d n) true (not= 0 (mod i d)) false :else (recur (inc d i

Performance issue with hashing records

2013-02-02 Thread Mark Engelberg
I just went through the process of converting my map-based program over to records, hoping it would improve speed. Much to my dismay, it actually slowed my program down substantially. With some profiling, I discovered that one possible explanation is that (at least in RC4) hashing of records is

Re: Performance issue with hashing records

2013-02-02 Thread Leonardo Borges
Are you running these in Clojure 1.5 RC-1 by any chance? That's when I got results similar to yours. In Clojure 1.4, I get this: user (time (dotimes [n 1000] (hash {:x a :y 3}))) Elapsed time: 5993.331 msecs nil user (time (dotimes [n 1000] (hash (A. a 3 Elapsed time: 3144.368 msecs

Re: Performance issue with hashing records

2013-02-02 Thread AtKaaZ
he's in RC4 = *clojure-version* {:major 1, :minor 5, :incremental 0, :qualifier RC4} = (time (dotimes [n 1000] (hash {:x a :y 3}))) Elapsed time: 70.037502 msecs = (time (dotimes [n 1000] (hash (A. a 3 Elapsed time: 5307.93947 msecs On Sun, Feb 3, 2013 at 8:22 AM, Leonardo Borges

Re: Performance issue with hashing records

2013-02-02 Thread Mark Engelberg
Clojure 1.5 RC-4 -- -- 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 group,

Re: Performance issue with hashing records

2013-02-02 Thread AtKaaZ
= (def m {:x a :y 3}) #'runtime.q_test/m = (time (dotimes [n 1000] (hash m))) Elapsed time: 154.650091 msecs nil = (time (dotimes [n 1000] (hash m))) Elapsed time: 164.724641 msecs nil = (time (dotimes [n 1000] (hash m))) Elapsed time: 150.194984 msecs nil = (time (dotimes [n 1000]

Re: Performance issue with hashing records

2013-02-02 Thread AtKaaZ
ok i like this variant: = (def r (memoize (A. a 3))) #'runtime.q_test/r = (time (dotimes [n 1000] (hash r))) Elapsed time: 342.363961 msecs nil = (time (dotimes [n 1000] (hash r))) Elapsed time: 361.66747 msecs nil = (time (dotimes [n 1000] (hash (memoize (A. a 3) Elapsed time:

Re: Why is this code so slow?

2013-02-02 Thread Curtis Gagliardi
I took your version Feng and used rem instead of mod and added a type hint and got down from: 23217.321626 = 11398.389942 No idea where to go from here though. I'm surprised there's such a difference even not using any sort of collection. (defn smallest-multiple-of-1-to-n-hinted-rem [^long