Re: Lessons Learned from Adopting Clojure

2014-02-05 Thread Colin Yates
Interesting - thanks all. My experience of Light Table is quite close to Norman's, although I discounted that *in my case* to not spending enough time with it. Knowing a little about who Sean is (from following your blog/comments/clojure.jdbc, not stalking! :)) I put a lot of weight behind

Re: [ANN] Jig

2014-02-05 Thread Joachim De Beule
Hi Malcolm, I have a follow up question if you don't mind. Suppose I want to define a component that starts a thread and regularly checks a resource. If the resource changes, this has repercussions for other (dependent) components. How would you do that in jig? Maybe this question is too

Re: [ANN] garden-watch

2014-02-05 Thread Timothy Washington
Hey Dave, Thanks for that heads up. I originally wanted auto-compiling for *HAML* and *SCSS*. But then thought why, when I could just use edn with *Hiccup* and *Garden*. Now, a lein-hiccup, or some auto compile tool doesn't exist to my knowledge. So *i)* I had to do that work anyways. Then I

Re: Lessons Learned from Adopting Clojure

2014-02-05 Thread John D. Hume
On Wednesday, February 5, 2014, Sean Corfield wrote: It's one of the things that has me really hooked on LightTable. I have my source and test namespaces both open. I have them both connected to a REPL. I can evaluate any code, in place, in either file. If I grow some code in the source

Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Glen Fraser
(sorry if you received an earlier mail from me that was half-formed, I hit send by accident) Hi there, I'm quite new to Clojure, and was trying to do some very simple benchmarking with other languages. I was surprised by the floating-point results I got, which differed (for the same

RE: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Jon Harrop
IIRC, Java provides unusual trigonometric functions which, I’m guessing, Clojure is using. I think the Java ones are actually more accurate (and slower) so you may well find the answer obtained on the JVM is more precise than the others. Cheers, Jon. From: clojure@googlegroups.com

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Glen Fraser
Thanks for the tip. After reading your comment, I looked and discovered the Java library called StrictMath, and tried it (replacing Math/cos and Math/sin by the StrictMath versions). I did indeed get different results than with the regular library, but unfortunately still not the same answer

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Konrad Hinsen
--On 5 Feb 2014 05:17:13 -0800 Glen Fraser holag...@gmail.com wrote: My benchmark iteratively runs a function 100M times: g(x) -- sin(2.3x) + cos(3.7x), starting with x of 0. A quick look at the series you are computing suggests that it has chaotic behavior. Another quick looks shows that

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Glen Fraser
Thanks, this is a satisfying answer. You're probably right that the other languages are all using the C standard math library (I naïvely assumed Java would too, but I see that's not the case). And yes, as I said, it is a rather contrived (and chaotic) example. Glen. On Feb 5, 2014, at 6:22

JIRA and ticket votes

2014-02-05 Thread Alex Miller
Hello, as we approach the end game for Clojure 1.6 and start looking forward to the next release, now is a good time to look at the existing ticket backlog and vote on things that are important to you. Andy's weighted ticket vote report is a good place to start - it includes all tickets currently

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Mark Engelberg
Ah, I see now that you are doing (g x) in your loop, not (g i), so scratch what I said about the loop running the wrong direction. On Wed, Feb 5, 2014 at 9:23 AM, Mark Engelberg mark.engelb...@gmail.comwrote: Looks to me like your Clojure loop runs in the opposite direction (counting

GSoC 2014: We need ideas and mentors

2014-02-05 Thread Daniel Solano Gómez
Hello, all, It's time once again to prepare our application for Google Summer of Code, a program where Google pays students from around the world to work on open source projects. Clojure has successfully participated in the program for two years now, and I would love to make it a third. GSoC

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Mark Engelberg
Looks to me like your Clojure loop runs in the opposite direction (counting downwards) versus the other languages. Since your code only returns the result of the last iteration of the loop, it's not too surprising that they return completely different results -- the last iteration of the Clojure

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread r
I'd agree here. This is actually a very nice example of a system that might be called chaotic, though chaos is, even mathematically, a very vague term: 1) the iteration will never leave [-2, 2] 2) it won't converge because all 3 fixed points are unstable ( |f'(x_s)|1 ) So, your example is

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Alex Miller
Others have answered with many useful bits but I would mention that it would possibly make a significant performance difference if you added this to your code: (set! *unchecked-math* true) On Wednesday, February 5, 2014 7:17:13 AM UTC-6, Glen Fraser wrote: (sorry if you received an earlier

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread David Nolen
Also: (defn g ^double [^double x] (+ (Math/sin (* 2.3 x)) (Math/cos (* 3.7 x On Wed, Feb 5, 2014 at 2:07 PM, Alex Miller a...@puredanger.com wrote: Others have answered with many useful bits but I would mention that it would possibly make a significant performance difference if you added

Re: Lessons Learned from Adopting Clojure

2014-02-05 Thread Sean Corfield
On Feb 5, 2014, at 5:39 AM, John D. Hume duelin.mark...@gmail.com wrote: Could you clarify the difference between LightTable's M-) and using C-M-x* in Emacs jacked into an nrepl session with Cider? M-) is paredit-forward-slurp-sexp in both LightTable and Emacs. The key difference here is that

diagram of clojure interfaces and objects

2014-02-05 Thread Andy Smith
Hi, Does anyone know of a class diagram of all the java interfaces and classes that exist in clojure, including their inheritance relationships. Im trying to get a handle on all the many collection/sequence interfaces, but ideally I would like to visually grok the whole fundamental clojure

Re: diagram of clojure interfaces and objects

2014-02-05 Thread Ben Mabey
On Wed Feb 5 13:16:01 2014, Andy Smith wrote: Hi, Does anyone know of a class diagram of all the java interfaces and classes that exist in clojure, including their inheritance relationships. Im trying to get a handle on all the many collection/sequence interfaces, but ideally I would like to

Re: Lessons Learned from Adopting Clojure

2014-02-05 Thread James Trunk
As a TDD practitioner and Expectationshttps://github.com/jaycfields/expectationsuser, I've been following this thread with great interest! @Jay: Will your change in thinking have any impact on Expectations? My experience with TDD in Clojure has been an overwhelmingly positive one, and it

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Glen Fraser
Thanks to both of you for these suggestions, they're good to know. In my specific case, setting the *unchecked-math* flag true did indeed speed things up slightly (by about 6%). The other change, though, with the double type hints (I assume that's what those are), actually ran notably slower

Re: Lessons Learned from Adopting Clojure

2014-02-05 Thread Angel Java Lopez
+100 My English is bad, but you expressed my position about TDD in general (I'm not a clojurian, yet, but I really appreciate TDD workflow in other technologies). On Wed, Feb 5, 2014 at 6:35 PM, James Trunk james.tr...@gmail.com wrote: As a TDD practitioner and

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread David Nolen
(set! *unchecked-math* true) (defn g ^double [^double x] (+ (Math/sin (* 2.3 x)) (Math/cos (* 3.7 x (time (loop [i 1 x 0.0] (if (pos? i) (recur (dec i) (g x)) x))) This is nearly 50% faster than the original version on my machine. Note that x is bound to 0.0 in the loop, which allows

Re: Lessons Learned from Adopting Clojure

2014-02-05 Thread John D. Hume
On Wed, Feb 5, 2014 at 1:27 PM, Sean Corfield s...@corfield.org wrote: On Feb 5, 2014, at 5:39 AM, John D. Hume duelin.mark...@gmail.com wrote: Could you clarify the difference between LightTable's M-) and using C-M-x* in Emacs jacked into an nrepl session with Cider? M-) is

Re: ANN: Reagent 0.3.0 - now with async rendering

2014-02-05 Thread David Simmons
Hi Dan First of all thank you for Reagent - I'm enjoying playing with the library. Do you have a simple example of passing child components and then rendering them as I cannot get this to work - I fairly new to Clojure so it could be user error. cheers Dave -- You received this message

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Glen Fraser
Thanks, yes, the version starting with 0.0 in the loop (rather than 0) does run faster. In my case, about 13% faster (19.7 seconds -- for the code you pasted below, with *unchecked-math*, type hints and starting x of 0.0 -- vs 22.7 seconds for my original version). But if you start with x of

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread David Nolen
You need to make sure that you are running with server settings. If you are using lein, it's likely that this is not the case unless you have overridden lein's defaults in your project.clj. On Wed, Feb 5, 2014 at 5:30 PM, Glen Fraser holag...@gmail.com wrote: Thanks, yes, the version starting

Re: ANN: Reagent 0.3.0 - now with async rendering

2014-02-05 Thread Dan Holmsand
On 5 feb 2014, at 23:28, David Simmons shortlypor...@gmail.com wrote: Do you have a simple example of passing child components and then rendering them as I cannot get this to work - I fairly new to Clojure so it could be user error. Yeah, that is apparently a bit tricky: see

Re: ANN: Reagent 0.3.0 - now with async rendering

2014-02-05 Thread David Simmons
Thanks Dan I'll give this a go. cheers Dave -- 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: Lessons Learned from Adopting Clojure

2014-02-05 Thread Jay Fields
On Wed, Feb 5, 2014 at 4:35 PM, James Trunk james.tr...@gmail.com wrote: As a TDD practitioner and Expectations user, I've been following this thread with great interest! @Jay: Will your change in thinking have any impact on Expectations? I don't anticipate making any changes to expectations,

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Alex Miller
To override the default tiered compilation, add this to your project.clj: :jvm-opts ^:replace [] I would also recommend using a newer JDK (preferably 7, but at least 6). On Wednesday, February 5, 2014 4:34:12 PM UTC-6, David Nolen wrote: You need to make sure that you are running with

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Colin Yates
Did I see a thread a while ago where doing this caught some people out because it wiped out some other performance switches? I can't find the thread. Apologies if I am spreading FUD On Wednesday, 5 February 2014 23:05:18 UTC, Alex Miller wrote: To override the default tiered

Re: How to transform one data structure to another data structure?

2014-02-05 Thread Paul Mooser
This is very similar to Sean's solution, but all values will be vectors: (reduce (fn [acc [k v]] (update-in acc [k] #(conj (or %1 []) v))) {} [[:a 123] [:b 124] [:a 125] [:c 126] [:b 127] [:a 100]]) -- You received this message because you are subscribed to the

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Daniel
He is running 7. -- 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: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Lee Spector
On Feb 5, 2014, at 6:05 PM, Alex Miller wrote: To override the default tiered compilation, add this to your project.clj: :jvm-opts ^:replace [] I was under the impression that one can get the same effect by running your program with: lein trampoline with-profile production run [etc] True?

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Bruce Adams
Modern JVM's pick default heap sizes based on the physical memory in your machine. With more than 1GB of physical memory, initial heap is 1/64 and maximum heap is 1/4 of physical memory.[1] For OpenJDK and Oracle, this command: java -XX:+PrintFlagsFinal -version | grep HeapSize will show the

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Lee Spector
On Feb 5, 2014, at 8:50 PM, Bruce Adams wrote: Modern JVM's pick default heap sizes based on the physical memory in your machine. With more than 1GB of physical memory, initial heap is 1/64 and maximum heap is 1/4 of physical memory.[1] For OpenJDK and Oracle, this command: java

Re: ANN: [lein-describe 0.1.0] plugin for displaying detailed information about Clojure projects

2014-02-05 Thread Atamert Ölçgen
The project URL is https://github.com/noprompt/lein-garden;. (Sorry, if this was mentioned before, I joined recently.) On Wed, Feb 5, 2014 at 12:28 PM, da...@dsargeant.com wrote: Looks cool. I'll be sure to check it out. -- You received this message because you are subscribed to the Google

Re: How to transform one data structure to another data structure?

2014-02-05 Thread James Reeves
If you're not worried about order, you could also write: (reduce (fn [m [k v]] (update-in m [k] conj v)) {} values) - James On 6 February 2014 00:40, Paul Mooser taron...@gmail.com wrote: This is very similar to Sean's solution, but all values will be vectors: (reduce (fn [acc [k v]]

Re: Lessons Learned from Adopting Clojure

2014-02-05 Thread Sean Corfield
FWIW, I find the language of Expectations to be much better suited to describing the desired behaviors of a system I want to build than the assertion-based language of clojure.test - so for me it's about test-before, not test-after. Sean On Wed, Feb 5, 2014 at 2:52 PM, Jay Fields

diagram of clojure interfaces and objects

2014-02-05 Thread Daniel
I'd start here: http://www.clojureatlas.com -- 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: Lessons Learned from Adopting Clojure

2014-02-05 Thread Sean Corfield
On Wed, Feb 5, 2014 at 1:56 PM, John D. Hume duelin.mark...@gmail.com wrote: The misconception I hope is disappearing is that REPL-driven development in Emacs necessarily involves lots of switching and copy-pasting back and forth between source file buffers and a REPL buffer. The video in Jay's

Re: [ANN] garden-watch

2014-02-05 Thread Joel Holdbrooks
The idea to watch edn or garden files was a consideration of lein-garden but decided against it because, personally, I felt it was giving up a lot. However, some folks may prefer this approach and, hopefully, it suits them just as well. On Wednesday, February 5, 2014 4:45:43 AM UTC-8, frye

Re: ANN: [lein-describe 0.1.0] plugin for displaying detailed information about Clojure projects

2014-02-05 Thread Joel Holdbrooks
Wat? I think you may have meant to post this comment somewhere else. That's certainly not the case. But I think I did forget to share the link which is: https://github.com/noprompt/lein-describe On Wednesday, February 5, 2014 6:23:25 PM UTC-8, Atamert Ölçgen wrote: The project URL is

Re: ANN: [lein-describe 0.1.0] plugin for displaying detailed information about Clojure projects

2014-02-05 Thread Atamert Ölçgen
I posted to the correct thread. Check the project.clj please. On Thu, Feb 6, 2014 at 12:05 PM, Joel Holdbrooks cjholdbro...@gmail.comwrote: Wat? I think you may have meant to post this comment somewhere else. That's certainly not the case. But I think I did forget to share the link which is:

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Michał Marczyk
This returns (.getTotalPhysicalMemorySize (java.lang.management.ManagementFactory/getOperatingSystemMXBean)) You could use this in your project.clj, perhaps by including ~(str -Xms (quot (.getTotalPhysicalMemorySize ...) appropriate-number)) in :jvm-opts. Also, you can absolutely use your own

Re: [ANN] garden-watch

2014-02-05 Thread Joel Holdbrooks
Clojure. On Feb 5, 2014, at 8:42 PM, Timothy Washington twash...@gmail.com wrote: Ok, that's fine. Definitely good to have both ways to tackle the problem. But I'm curious. What do you feel is being given up by watching garden files? Thanks Tim Washington Interruptsoftware.com

Re: ANN: [lein-describe 0.1.0] plugin for displaying detailed information about Clojure projects

2014-02-05 Thread Joel Holdbrooks
Check which project.clj? You posted a link to lien-garden. Am I missing something here? On Wednesday, February 5, 2014 8:29:35 PM UTC-8, Atamert Ölçgen wrote: I posted to the correct thread. Check the project.clj please. On Thu, Feb 6, 2014 at 12:05 PM, Joel Holdbrooks

Documentation, tips on chunked sequence functions?

2014-02-05 Thread Mars0i
It's easy to find information on the net about the general concept of a Clojure chunked sequence, and about the effects of using chunked sequences. I would like to understand the code that deals with chunked sequences in the Clojure source, in functions such as map and doseq. Any suggestions

Re: Documentation, tips on chunked sequence functions?

2014-02-05 Thread Mars0i
Just to be completely clear, I want to understand the source code for map and doseq. The parts that deal with chunked sequences are confusing to me. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: ANN: [lein-describe 0.1.0] plugin for displaying detailed information about Clojure projects

2014-02-05 Thread Joel Holdbrooks
Oh, hey, thanks. I didn't catch that. Great copy/paste fail, eh. Maybe next time post an issue to the Github. :-) On Feb 5, 2014, at 8:29 PM, Atamert Ölçgen mu...@muhuk.com wrote: I posted to the correct thread. Check the project.clj please. On Thu, Feb 6, 2014 at 12:05 PM, Joel

having trouble with lein-ring :auto-refresh?

2014-02-05 Thread boz
Hi, I've set up lein-ring with ring :auto-refresh? true but don't see updates in the browser unless I refresh manually. It seems I have something configured wrong but I can't see it. Does this look right?... (defproject mystuff 0.1.0-SNAPSHOT :description experiment :url