Clojure : event listener on domina library

2015-06-10 Thread dimas . saputra
I hope someone can help me on this. I'm using domina https://github.com/levand/domina and clojurescript in my website project. My problem is i try to make 3 click event in 3 different button. I attach the code snippet below, (defn html1 [] (dom/set-inner-html! (dom/by-id idofhtml) h1

Re: Actually using component.

2015-06-10 Thread Dru Sellers
I really am dense at times. :( I was confusing the 'component' for the system map in this line: https://github.com/weavejester/duct/blob/master/duct/src/duct/component/endpoint.clj#L6 #PalmToFace -d On Tuesday, June 9, 2015 at 5:57:48 PM UTC-5, James Reeves wrote: On 9 June 2015 at 23:16,

Re: Question regarding java array

2015-06-10 Thread Andy Fingerhut
Add this line at the top of your file where you try areduce and loop, and look for any reflection warnings that occur when loading the file: (set! *warn-on-reflection* true) If there are none, probably best to post a link to your code, or paste it in a message here if it is short enough, so

Re: using the same middleware (wrap-multipart-params) with different parameters in one app [ring] [compojure]

2015-06-10 Thread Sebastián Moreno
I know this is an old thread, but I came across the same issue today, I ended up with something like: (POST /upload request (multipart/wrap-multipart-params (fn [{{file file} :params}] (handle-updload file Sebastián On Friday, April 4, 2014 at 2:39:23 AM

Question regarding java array

2015-06-10 Thread Ritchie Cai
I'm working on a java array of double with 128 elements. I need the max and min values of the array. So I initially tried areduce and loop, both gives runs around 20 seconds. But when try (apply max (vec array)) I get result under 90 ms. Can anyone explain why there is such a big

Re: Question regarding java array

2015-06-10 Thread Colin Yates
Will guess in the dark but would boxing come into play here? On 10 Jun 2015, at 21:03, Ritchie Cai ritchie...@gmail.com wrote: I'm working on a java array of double with 128 elements. I need the max and min values of the array. So I initially tried areduce and loop, both gives runs

Re: [ANN] Onyx 0.6.0

2015-06-10 Thread Nathan ToddStone
Awesome! On Tuesday, June 9, 2015 at 7:35:33 AM UTC-7, Michael Drogalis wrote: I'm happy to announce that Onyx 0.6.0 is officially out! Blog post: http://michaeldrogalis.github.io/jekyll/update/2015/06/08/Onyx-0.6.0:-Going-Faster.html GitHub: https://github.com/onyx-platform/onyx Website:

Re: Question regarding java array

2015-06-10 Thread Mikera
Consider using core.matrix with vectorz-clj for operations on large numerical arrays / vectors of doubles. It is a *lot* faster than using Clojure vectors for this kind of scenario, plus it has a lot of helpful array operations already defined. (use 'clojure.core.matrix) (def v (array :vectorz

RFC: Collider: Clojure's collections for Java developers

2015-06-10 Thread Ryan Schmitt
I've been developing a library that wraps Clojure's collections for use in Java 8 development: https://github.com/rschmitt/collider http://rschmitt.github.io/collider/javadoc/ Like my other major Java project, DynamicObject http://rschmitt.github.io/dynamic-object/, the goal here is two-fold:

Re: Where should 'if-let-all' macro go?

2015-06-10 Thread Mike Rodriguez
I'll chime in with my opinion on this topic. I think the existing if-let and similar forms that have a limitation of only allowing a single binding is a confusing restriction to place on the familiar binding vector construct. I've always been a little uneasy about repurposing binding vectors

Re: Question regarding java array

2015-06-10 Thread Steven Yi
As mentioned by Colin and Andy, I would guess it would be some form of boxing and reflection going on. I tried the following: (defn array-max [^doubles arr] (let [len (alength arr)] (loop [m Double/NEGATIVE_INFINITY indx 0] (if ( indx len) (recur (max m (aget arr indx))