Re: Efficiency of Dijkstra's algorithm

2012-11-21 Thread Dennis Haupt
i used a java priorityqueue for this. it's mutable (but local), and since you're not going to access he queue with more than in thread you can hide this fact and still pretend to be functional. i did it. in reality, cheats are always allowed. 2012/11/21 Sergey Didenko > I have used mutable code

Re: Problems getting Heroku to accept custom bin/build script

2012-11-21 Thread Michael Berg
Hi Phil, the test apps name is: weberest(.herokuapp.com) In this case there's no problem with AOT; I'm just relying on the Heroku output after a git push to show that it used the custom build script and learn what went wrong in the real app. If that would work, I'd try it there (where AOT and

ANN: Parse-EZ 0.3.0

2012-11-21 Thread Panduranga Adusumilli
Parse-EZ is a parser library for Clojure programmers. It allows easy mixing of declarative and imperative styles and does not require any special constructs, macros, monads, etc. to write custom parsers. All the parsing is implemented using regular Clojure functions. README: https://github.co

Re: More ClojureScript questions....

2012-11-21 Thread Thomas
That did the trick David, thanks for pointing out (with hindsight) the obvious to me. Thomas -- 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

Re: Request for a hint

2012-11-21 Thread Milen Ivanov
Dear Mr. Griefer, Thank you! I get it now after reading few more pages. Even the font is different than that of real code and, moreover, it is recommended that the reader gets the code from book's webpage. So, I keep on reading... First of all, I paid for the book, LOL, and, second, I need to

Re: [ANN] clj-xpath 1.3.3

2012-11-21 Thread Alex Osborne
On 21/11/12 3:10 AM, John Gabriele wrote: Oh, thanks. My understanding was that current best practice was to choose a good name, and then if you're the original author, your project's group-id = artifact-id (and thus you get the https://clojars.org/my-proj url). The thought behind Clojars' conv

Re: Primitive function boxes and unboxes result value

2012-11-21 Thread Christophe Grand
I created an issue and attached a patch http://dev.clojure.org/jira/browse/CLJ- Now the 5 last lines of bytecode are: 52: goto9 55: goto61 58: pop 59: dload 5 61: dreturn Christophe On Tue, Nov 20, 2012 at 10:27 PM, Christophe Grand wrote: > I think CLJ-701 is

feeding leiningen a local JAR file

2012-11-21 Thread Dick Davies
I've got a couple of projects that need a newer version of a JAR than is available in Maven. Is there any support/syntax in project.clj that will allow me to point at a local JAR file? Also, is it possible to 'override' a given dependency to favour a local JAR over the 'official' maven one? [ sp

deserialising records from Swing...

2012-11-21 Thread Jim foo.bar
Hi all, I discovered yesterday that records cannot be deserialised from the EDT using the normal way (prn/read-string)... NoClassDefFound Exception trying the same thing from a bare repl (no swing), works just fine!!! Googling "deserialisng clojure records" pointed me to [1] where Stuart

Re: lein 2.x not working on Mac OS X 10.7.5 -- Exception in thread "main" java.lang.ClassNotFoundException:

2012-11-21 Thread Dick Davies
Glad it's not me who keeps hitting this :0 "lein new app hello" seems to be more helpful for setting you up as I'd expect, just need to wait for my fingers to learn to type it now. On 14 November 2012 21:44, Marek Šrank wrote: > Yep, leiningen now doesn't create -main function in the default tem

Re: feeding leiningen a local JAR file

2012-11-21 Thread Jim foo.bar
On 21/11/12 11:47, Dick Davies wrote: Also, is it possible to 'override' a given dependency to favour a local JAR over the 'official' maven one? just install the jar into your local maven repo (~/.m2/) (with identifiable name) and then pull it from whatever project you want. I think Leininge

macroexpand-1 for "clojurescript" macros

2012-11-21 Thread László Török
Hi, How can I use macroexpand et. al to check an output of a clojurescript macro? As far as I know, clojurescript macros are clojure macros. However if I start script/repl and enter => (require 'cljs.compiler) => (require 'cljs.core) => (macroexpand-1 (cljs.core/gen-apply-to)) CompilerException

Re: macroexpand-1 for "clojurescript" macros

2012-11-21 Thread Herwig Hochleitner
Try quoting the code you want to macro expand, like: (macroexpand-1 '(cljs.core/gen-apply-to)) Otherwise clojure would try to macroexpand the result of (gen-apply-to) Am 21.11.2012 13:07 schrieb "László Török" : > Hi, > > How can I use macroexpand et. al to check an output of a clojurescript > ma

Re: macroexpand-1 for "clojurescript" macros

2012-11-21 Thread László Török
damn, stupid mistake of mine, thanks! 2012/11/21 Herwig Hochleitner > Try quoting the code you want to macro expand, like: (macroexpand-1 > '(cljs.core/gen-apply-to)) > > Otherwise clojure would try to macroexpand the result of (gen-apply-to) > Am 21.11.2012 13:07 schrieb "László Török" : > >> H

Re: Primitive function boxes and unboxes result value

2012-11-21 Thread Gunnar Völkel
I think Cristophe is on the right path. But it is possible that there is another Bug concerning primitive functions. Consider the following two functions: (defn fib ^long [^long n] (if (<= n 1) 1 (+ (fib (dec n)) (fib (- n 2) (defn fib2 ^double [^double n] (if (<= n 1) 1 (+ (fib2 (dec n)

Re: feeding leiningen a local JAR file

2012-11-21 Thread Shantanu Kumar
On Wednesday, 21 November 2012 17:17:40 UTC+5:30, Dick Davies wrote: > > I've got a couple of projects that need a newer version of a JAR > than is available in Maven. > > Is there any support/syntax in project.clj that will allow me to point > at a local JAR file? > > Also, is it possible to

Re: Primitive function boxes and unboxes result value

2012-11-21 Thread Christophe Grand
Hi Gunnar, The only thing I fixed is related to recur (whose type was null and thus not unifiable with a primitive type). Concerning your fib2, I think the proble comes from the "then" being a long (1) and the else a double. Thus boxing is required to return either a long or double (well a Long a

Re: feeding leiningen a local JAR file

2012-11-21 Thread Dick Davies
Thanks, that's helpful to know (I was a java dev a long time ago, before Maven took over the world), but really I wanted to isolate this hack to a specific project directory, rather than globallly. On 21 November 2012 12:00, Jim foo.bar wrote: > On 21/11/12 11:47, Dick Davies wrote: >> >> Also, i

Re: A Simple FeedForward NeuralNetwork (using BackPropagation)

2012-11-21 Thread Anthony McClure
Brian Ripley wrote and maintains the nnet package for R which is the basic neural net package. He also wrote a book "Pattern Recognition and Neural Networks" that is somewhat known by statisticians. I only have read the first chapter but it appeared he would work out simple examples. Also, the book

GPU programming (with calx) to parallise a reducer?

2012-11-21 Thread Jim - FooBar();
Hi all, I just came back from a seminar at Manchester University where the speaker from ARM spent an hour talking about GPUs, OPENCL etc etc. The thing that is stuck in my head is that, apparently ARM is trying to create this language (PENCIL) which at the moment is a c-variant but they are

Re: ANN Some backwards-incompatible changes in Cheshire 5.0.0

2012-11-21 Thread Lee Hinman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Michael Klishin writes: > Cheshire [1] is a mature and fast Clojure JSON serialization library by Lee > Hinman. > > I am posting this here for the community to not go through the story > we recently had with another popular JSON serializer that intro

Re: How to add an URL into the classpath?

2012-11-21 Thread Vladimir Tsichevski
Hi Yoshinori, after (unsuccessfully) struggling with Clojure dynamic ClassLoaders in clojure-1.4, I ended up with the 'brute force' solution--just add URL entries to the Java system classloader. Here is a simple example on how to do it from clojure: (defn add-system-classpath "Add an url pat

Re: GPU programming (with calx) to parallise a reducer?

2012-11-21 Thread Timothy Baldridge
If you are running pure arithmetic code over primitive arrays, and not doing allocation (so no seqs, higher order functions, etc.) then it's pretty straight forward to translate Clojure code to GPU code. Now notice that all the above qualifications are directly opposite to "normal" Clojure practice

Re: GPU programming (with calx) to parallise a reducer?

2012-11-21 Thread Neale Swinnerton
On Wed, Nov 21, 2012 at 4:07 PM, Jim - FooBar(); wrote: > > The entire talk brought back to my mind some thoughts i was having a couple > of months ago: isn't it possible to do a parallel 'fold' using GPUs? We > already have reducers fork-join ready (Rich took care of that :)), why not > deploy th

Re: GPU programming (with calx) to parallise a reducer?

2012-11-21 Thread Jim - FooBar();
On 21/11/12 16:22, Timothy Baldridge wrote: If you are running pure arithmetic code over primitive arrays, and not doing allocation (so no seqs, higher order functions, etc.) then it's pretty straight forward to translate Clojure code to GPU code. Now notice that all the above qualifications ar

Re: Deserialization of a Record

2012-11-21 Thread Jim - FooBar();
I'm having the same problem as Chris... Serialization and deserialization from a REPL works fine whereas from the GUI it doesn't...ClassNotFoundException... binding *use-context-classloaders* to false did not help and invoking a future or an agent from the event handler doesn't work either...Th

Re: [ANN] clj-xpath 1.3.3

2012-11-21 Thread Phil Hagelberg
Michael Klishin writes: > Please use a group-id, it is not that hard to come up with, even if > you end up using org.clojars.[username]. No, please do not use org.clojars.* unless you are publishing a fork. That convention has a specific meaning already; if you use it you will be signaling to yo

Re: How to add an URL into the classpath?

2012-11-21 Thread Alex Ott
You can also use https://github.com/cemerick/pomegranate - it works fine... On Wed, Nov 21, 2012 at 5:14 PM, Vladimir Tsichevski wrote: > Hi Yoshinori, > > after (unsuccessfully) struggling with Clojure dynamic ClassLoaders in > clojure-1.4, I ended up with the 'brute force' solution--just add UR

[Jobs] Big Data Engineer Position at Google-backed SF Startup

2012-11-21 Thread Nathan Visconti
The Climate Corporation is Google Ventures backed big data startup with a mission to help people adapt to climate change . We make sense of huge amounts of complicated data and run simulations to determine the risk of adverse weather, which influences 25% of GDP. We are cu

Re: Primitive function boxes and unboxes result value

2012-11-21 Thread Gunnar Völkel
Of course. You are right. I did forget about the long constant. I hope your patch will be included in Clojure 1.5. -- 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 m

Re: ClojureCLR: StackOverflowException when evaluating cond with large number of clauses

2012-11-21 Thread dmiller
The compiler uses recursive descent in its analysis. Given a VM call stack that does not grow, there will always been some input that causes the compiler to blow stack. In the case of cond, the macro expands into a nested if statements. Given enough clauses, you get the result you have exper

Arity problem with multi-methods

2012-11-21 Thread Christian Sperandio
Hi, I try to define multi-methods but when I call one I get an exception. I declared the multi-methods like below: (defmulti new-food-item (fn [food expiration] (if (number? expiration) ::duration ::expiration-date

Re: [ANN] Clojars Releases repository

2012-11-21 Thread John Gabriele
On Sunday, November 18, 2012 4:46:51 PM UTC-5, Sean Corfield wrote: > > On Sun, Nov 18, 2012 at 5:56 AM, Phil Hagelberg > > wrote: > >> If you don't have a key yet, generate one with `gpg --gen-key`. The >> default settings are pretty good, though I'd recommend making it expire >> in a year or two

nREPL status

2012-11-21 Thread Chas Emerick
FYI, an updated cut of high-level nREPL documentation is now available: https://github.com/clojure/tools.nrepl There's a fair bit more I plan on adding, but I think some reorganization into different pages for different topics is warranted at this point before the README gets any more u

Re: Can CLJS functions have metadata?

2012-11-21 Thread Brandon Bloom
Fixed: http://dev.clojure.org/jira/browse/CLJS-359 On Saturday, August 25, 2012 12:49:47 AM UTC-7, Shantanu Kumar wrote: > > Hi, > > I noticed that `with-meta` is not working on function objects in CLJS. > Compilation fails with the following error: > > Error: No protocol method IWithMeta.-with-m

Re: Arity problem with multi-methods

2012-11-21 Thread grinnbearit
Hi Chris, If you change multimethod arities you'll have to def the multimethod to nil or restart the swank/nrepl server. It doesn't update that on recompilation. Sidhant On Thursday, November 22, 2012 3:44:10 AM UTC+5:30, Christian Sperandio wrote: > > Hi, > > I try to define multi-methods but

priority-map pop issue

2012-11-21 Thread JvJ
I'm not sure if this is an error or not, but priority-maps behaves strangely when given a function like <=. (pop (priority-map-by <= :a 1 :b 2 :c 3)) => {:a 1 :b 2 :c 3} ;; First element isn't popped. Is this supposed to happen? -- You received this message because you are subscribed to the Go

Re: priority-map pop issue

2012-11-21 Thread Mark Engelberg
As per the other thread, remember that in Clojure sorted collections only function properly when given a function that obeys the trichotomy property (exactly one of the following hold: a wrote: > I'm not sure if this is an error or not, but priority-maps behaves > strangely when given a function l

Re: priority-map pop issue

2012-11-21 Thread JvJ
Thanks. I wasn't sure if that applied to priority maps as well. On Wednesday, 21 November 2012 21:35:54 UTC-5, puzzler wrote: > > As per the other thread, remember that in Clojure sorted collections only > function properly when given a function that obeys the trichotomy property > (exactly one

Fail to run `lein bootstrap` in ClojureScript One

2012-11-21 Thread Satoru Logic
HI, all. I'm following the instructions on http://clojurescriptone.com/getting-started.html, and run `lein bootstrap` in the `one` directory, but `lein` complains that *'bootstrap' is not a task*. How can I install this `bootstrap` task? -- You received this message because you are subscri

Closure Accordion Widget

2012-11-21 Thread J Elaych
I'm designing a web interface that I hope to implement in Clojurescript. I've been looking at the underlying Closure framework to make sure I have all the functionality I need, and I'm not finding any examples of an Accordion widget, like the one available in Jquery-ui. So if Google doesn't

Re: Fail to run `lein bootstrap` in ClojureScript One

2012-11-21 Thread Sean Corfield
ClojureScript One still requires Leiningen 1.x - it hasn't been updated to Leiningen 2.x yet. On Wed, Nov 21, 2012 at 10:06 PM, Satoru Logic wrote: > HI, all. > > I'm following the instructions on > http://clojurescriptone.com/getting-started.html, > and run `lein bootstrap` in the `one` directo

Re: Fail to run `lein bootstrap` in ClojureScript One

2012-11-21 Thread Satoru Logic
Got it. Thanks. On Thursday, November 22, 2012 3:12:53 PM UTC+8, Sean Corfield wrote: > > ClojureScript One still requires Leiningen 1.x - it hasn't been updated to > Leiningen 2.x yet. > > > On Wed, Nov 21, 2012 at 10:06 PM, Satoru Logic > > > wrote: > >> HI, all. >> >> I'm following the instr

Re: Arity problem with multi-methods

2012-11-21 Thread Christian Sperandio
Thank you ! I became crazy because I didn't see the problem in my code. Why is there this issue with multi-methods? (and not with standard functions) Chris Le 22 nov. 2012 à 02:34, grinnbearit a écrit : Hi Chris, If you change multimethod arities you'll have to def the multimethod to nil or

Re: Arity problem with multi-methods

2012-11-21 Thread Baishampayan Ghose
Christian, defmulti has defonce-like semantics which I guess is to prevent the associated defmethods from being wiped out when the form is recompiled. Cite - https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L1622 -BG On Wed, Nov 21, 2012 at 11:45 PM, Christian Sperandio