Re: EY map reduce contest

2009-07-16 Thread Michael Wood
2009/7/15 John Harrop jharrop...@gmail.com: On Wed, Jul 15, 2009 at 4:53 AM, hosia...@gmail.com hosia...@gmail.com wrote: http://www.engineyard.com/blog/2009/programming-contest-win-iphone-3gs-2k-cloud-credit/ Has anyone got access to hundreds of thousands of machines that I could borrow

Re: Examining performance on the JVM

2009-07-16 Thread Christian Vest Hansen
I haven't tried to look beyond the JIT to see what it does, so I wouldn't know which tools to use, but if you do not already know about it, you might find the HotSpot Internals wiki to be an interesting source of info: http://wikis.sun.com/display/HotSpotInternals/Home On Thu, Jul 16, 2009 at

Re: turn a seq into a list

2009-07-16 Thread Jan Rychter
Jarkko Oranen chous...@gmail.com writes: On Jul 15, 1:54 pm, Jan Rychter j...@rychter.com wrote: I've been looking for a function that would take a seq and create a list (a real clojure.lang.PersistentList), but haven't found one. The closest I got was: (apply list my-seq) Essentially,

Re: Examining performance on the JVM

2009-07-16 Thread Daniel
On Thu, Jul 16, 2009 at 11:00 AM, Glen Stampoultzisgst...@gmail.com wrote: Apparently it's possible to see the assembly instructions if you're running a debug VM [1]. -XX:+PrintOptoAssembly dumps to the console a log of all assembly being generated for JITed methods. The instructions are

Re: easiest JMX API ever, in Clojure...

2009-07-16 Thread Daniel
On Thu, Jul 16, 2009 at 3:18 AM, Michael Woodesiot...@gmail.com wrote: 2009/7/15 Daniel dan.in.a.bot...@gmail.com: On Wed, Jul 15, 2009 at 3:43 AM, Michael Woodesiot...@gmail.com wrote: [...] I've never tried this sort of thing before, but I'm trying to connect to a JBoss instance with it

Re: Clojure vectors

2009-07-16 Thread Daniel
On Thu, Jul 16, 2009 at 1:52 AM, John Harropjharrop...@gmail.com wrote: On Wed, Jul 15, 2009 at 12:58 PM, Mark Engelberg mark.engelb...@gmail.com wrote: It looks like stack-rot is going to be the bottleneck in your app since it requires traversing the whole vector to build the new one, but

Re: easiest JMX API ever, in Clojure...

2009-07-16 Thread Stuart Halloway
Good point, and added to the jmx.clj file comment. The JMX stuff is being built on edge and depends on post-1.0 Clojure, specifically the features added in ticket #131 (http://www.assembla.com/spaces/clojure/tickets/131-Move-Clojure-tests-from-contrib-into-Clojure ). Stu 2009/7/14 Stuart

Re: turn a seq into a list

2009-07-16 Thread jvt
Doesn't apply have a limit on the length of the arguments passed, too? On Jul 16, 7:22 am, Jan Rychter j...@rychter.com wrote: Jarkko Oranen chous...@gmail.com writes: On Jul 15, 1:54 pm, Jan Rychter j...@rychter.com wrote: I've been looking for a function that would take a seq and create a

Clojure contrib in maven?

2009-07-16 Thread Mark Derricutt
'lo all, Now that we have clojure 1.0 in maven central, it'd be great to also have a release of closure contrib ALSO in central. I understand theres a 1.0-compat branch of contrib available, can we roll a release of that? Mark -- Discouragement is a dissatisfaction with the past, a distaste

Re: turn a seq into a list

2009-07-16 Thread Meikel Brandmeyer
Hi, On Jul 16, 1:43 pm, jvt vincent.to...@gmail.com wrote: Doesn't apply have a limit on the length of the arguments passed, too? apply is lazy. user= (defn foo [ args] (take 5 args)) #'user/foo user= (apply foo (iterate inc 0)) (0 1 2 3 4) Sincerely Meikel

Re: turn a seq into a list

2009-07-16 Thread Drew Raines
jvt wrote: Doesn't apply have a limit on the length of the arguments passed, too? Yes. http://groups.google.com/group/clojure/msg/34b9a170d36c5ab5 -Drew --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure

Re: turn a seq into a list

2009-07-16 Thread Laurent PETIT
But in this particular case (calling (apply list seq)) since we want to create a data structure that will hold the whole seq at once, then apply will not prevent seq from being of a great length, it's the memory heap that will. (I think the question was more : does apply have some hard coded

How to achieve indirection?

2009-07-16 Thread Dragan
Hi, This is another one of my newbie questions, so please be patient if this is something out of the FP paradigm. I've noticed that there is a number of duplicate functions, functions that implement the same thing in a different way. In OO systems, I would use an interface to achieve the

Re: How to achieve indirection?

2009-07-16 Thread Laurent PETIT
Certainly multimethods : * introduction : http://clojure.org/runtime_polymorphism * detail : http://clojure.org/multimethods And, also, don't forget the power given to you by first class / higher order functions. With them, a lot of variability can be placed just in functions, where it was a

turn off scientific notation?

2009-07-16 Thread flodel
hello, I have a Clojure script that reads numbers in a normal format like 0.012, but after processing, returns in a scientific format, for example, 8.03E-6 Is there a way to turn this scientific notation off? Thank you. --~--~-~--~~~---~--~~ You received

Re: easiest JMX API ever, in Clojure...

2009-07-16 Thread Michael Wood
2009/7/16 Daniel dan.in.a.bot...@gmail.com: On Thu, Jul 16, 2009 at 3:18 AM, Michael Woodesiot...@gmail.com wrote: [...] By the way, how does twiddle.sh (which appears to be a command line tool for fiddling with JMX stuff in JBoss) work then?  Because it works without having to use the

Re: turn off scientific notation?

2009-07-16 Thread Stephen C. Gilardi
On Jul 16, 2009, at 10:13 AM, flodel wrote: I have a Clojure script that reads numbers in a normal format like 0.012, but after processing, returns in a scientific format, for example, 8.03E-6 Is there a way to turn this scientific notation off? Numbers are stored internally in a binary

Re: turn off scientific notation?

2009-07-16 Thread Laurent PETIT
Hi Stephen, 2009/7/16 Stephen C. Gilardi squee...@mac.com On Jul 16, 2009, at 10:13 AM, flodel wrote: I have a Clojure script that reads numbers in a normal format like 0.012, but after processing, returns in a scientific format, for example, 8.03E-6 Is there a way to turn this

Re: turn off scientific notation?

2009-07-16 Thread Stephen C. Gilardi
On Jul 16, 2009, at 11:50 AM, Laurent PETIT wrote: what do you mean ? For what I know, the output streams have nothing to do with formatting ? You're right, Laurent, thanks for the correction. REPL output is printed using prn which (for Doubles) ultimately calls .toString on the Double

Re: How to achieve indirection?

2009-07-16 Thread Dragan
Thanks for the tip, I meant something else. Let's say that I want to write a function do-something. There could be 2 implementations: do-something-quickly and do-something-elegantly. The parameters are the same and there are no differences in their interface. I would like to be able to call it by

Re: easiest JMX API ever, in Clojure...

2009-07-16 Thread Daniel
On Thu, Jul 16, 2009 at 10:20 PM, Michael Woodesiot...@gmail.com wrote: 2009/7/16 Daniel dan.in.a.bot...@gmail.com: On Thu, Jul 16, 2009 at 3:18 AM, Michael Woodesiot...@gmail.com wrote: [...] By the way, how does twiddle.sh (which appears to be a command line tool for fiddling with JMX

Re: Performance question (newbie)

2009-07-16 Thread Wilson MacGyver
This link reminded me of this discussion. http://www.cnn.com/2009/US/07/15/quadrillion.dollar.glitch/index.html?iref=newssearch as Rich said, unchecked is generally a bad idea. :) On Wed, Jul 15, 2009 at 10:24 PM, Rich Hickeyrichhic...@gmail.com wrote: On Jul 15, 2:22 pm, John Harrop

Algorithm help

2009-07-16 Thread martin_clausen
Can anybody give me some hints on how to translate this: http://bit.ly/lcs_py (the backTrackAll function) from Python into Clojure? I have a pasted my attempt here: http://paste.lisp.org/+1SL7, but it doesn't work. For completeness I have included the functions required to test the

Re: How to achieve indirection?

2009-07-16 Thread Laurent PETIT
Hi, it looks more like a problem of dependency injection (which implementation for the interface, and who's responsible for choosing the implementation), so. (And now that I re-read the subject of your e-mail ... :-) If we're just talking about switching the implementation of one function

Re: How to achieve indirection?

2009-07-16 Thread Garth Sheldon-Coulson
One tactic I've used for this is function-generating functions or, in more complex situations, closure-generating functions. I'd appreciate thoughts from gurus on whether this is idiomatic. For instance: You have functions do-something-quickly and do-something-elegantly. You want to call these

Re: How to achieve indirection?

2009-07-16 Thread John Harrop
On Thu, Jul 16, 2009 at 11:34 AM, Dragan draga...@gmail.com wrote: Thanks for the tip, I meant something else. Let's say that I want to write a function do-something. There could be 2 implementations: do-something-quickly and do-something-elegantly. The parameters are the same and there are

Re: Algorithm help

2009-07-16 Thread Laurent PETIT
Hi, I didn't test what I'll say, but it seems to me there are more than one problem: * when having in cond long conditions followed by a long expression, you should consider switching to miser mode by placing the expression on a new line, indented 2 characters from the condition start column *

Re: Algorithm help

2009-07-16 Thread Mark Triggs
Hi there, I had a bit of a go at converting the Python version into Clojure and removed the need to mutate an array. Because the 'lcs' function was basically just mapping over a list of i/j pairs and accumulating the resulting matrix, it seemed like a good candidate for reduce: (defn lcs [x y]

ANN: clj-mql

2009-07-16 Thread Richard Newman
Following hot on the heels of its dependency, here's clj-mql. http://github.com/rnewman/clj-mql/tree/master clj-mql is a client library for Freebase (or any site that implements its API). It currently allows you to issue unauthenticated version, status, read, search, and reconcile

Experiment with named args

2009-07-16 Thread Mark Addleman
A few days ago, Chouser and I had a discussion on IRC about the viability of named arguments (a la Smalltalk) for Clojure. In clojure- contrib, there is the macro defnk which provides this sort of capability, but it's performance characteristics are worse than than normal function call. I

Re: Experiment with named args

2009-07-16 Thread Richard Newman
Even if the macro isn't all that valuable, I learned a lot about Clojure in the process. If anyone has any suggestions, I'd love to hear them. This is definitely interesting to me. I currently use the keyword arg idiom -- (apply hash-map args) -- but I'm painfully aware of all the

comment macro not ignoring contents

2009-07-16 Thread kkw
Hi folks, Anyone get the following interesting messages? 1:19 com.kkw.ss= (comment 1) nil 1:20 com.kkw.ss= (comment s1) nil 1:21 com.kkw.ss= (comment 1) nil 1:22 com.kkw.ss= (comment s) nil 1:23 com.kkw.ss= (comment s1) nil 1:24 com.kkw.ss= (comment 1s) java.lang.NumberFormatException:

Re: comment macro not ignoring contents

2009-07-16 Thread kkw
That makes really good sense. Thanks for the clear explanation! Kev On Jul 17, 1:56 pm, Richard Newman holyg...@gmail.com wrote: 1:24 com.kkw.ss= (comment 1s) java.lang.NumberFormatException: Invalid number: 1s java.lang.Exception: Unmatched delimiter: ) 1:25 com.kkw.ss=    Kindly

clojure-contrib

2009-07-16 Thread Wilson MacGyver
Can clojure-contrib be used with clojure-1.0? Or in order to use it, I also need to build clojure from github? come to think of it, with various libraries being announced, are people targeting clojure 1.0? Thanks, Mac -- Omnem crede diem tibi diluxisse supremum.