Idiomatic equivalent for double dispatch in clojure?

2012-11-19 Thread Thomas Goossens
In a java project last year we had to create a board game. A Board had Piece objects. Some pieces can share position. Some don't. The way i solved this in Java was using double dispatch. http://pastebin.com/brrRtqsS (I just extracted the methods out of their respective classes) But i think it

Re: ANN: Clojure/West - Portland, OR - Mar 18-20, 2013

2012-11-19 Thread Cesar Pinera
I hereby volunteer to organize a welcome party of Portland locals, a goodwill committee of sorts, to plan and orchestrate visits to local landmarks -and by that I mean microbreweries- and highlights. On Sat, Nov 17, 2012 at 9:26 AM, Alex Miller a...@puredanger.com wrote: If you somehow missed

Re: Idiomatic equivalent for double dispatch in clojure?

2012-11-19 Thread Stuart Sierra
A long time ago I posted some macros to do double-dispatch with protocols and records. The link was http://paste.lisp.org/+2023 but it no longer works. The basic idea is you dispatch on the first argument to an intermediate type that then dispatches on the second argument. It's complicated,

Re: Idiomatic equivalent for double dispatch in clojure?

2012-11-19 Thread Brian Marick
Here's an example of using multimethods. (Note: I overrode the Clojure defmulti/defmethod macros with my own that play more nicely with the repl, and for other purposes. It's a straightforward translation.) You can see all the code here:

Re: Idiomatic equivalent for double dispatch in clojure?

2012-11-19 Thread Thomas Goossens
Yes indeed. with multimethods you can doue multi-argument dispatch. But that means that for every possible collision. I have to specify a method? Would it be a good idea to introduce taxonomies here? On Monday, November 19, 2012 4:02:18 PM UTC+1, Stuart Sierra wrote: A long time ago I

Re: A Simple FeedForward NeuralNetwork (using BackPropagation)

2012-11-19 Thread Andreas Liljeqvist
Yes, you are seeding and taking different paths in the problem area. Best case one could model the problem area with some priors and do some minimal-overlapping search of features. I find this one very interesting: http://metacog.org/main.pdf Apparently it produces good results and to me seems

Re: A Simple FeedForward NeuralNetwork (using BackPropagation)

2012-11-19 Thread Andreas Liljeqvist
If you have too many neurons or not a big enough dataset, you risk learning the features of the trainingset but not the generality of the problem. [e1 e2 answer] (def dataset[[1 1 2] [2 2 4] [4 4 8]]) Are you learning addition here or a doubling function? If you have enough neurons, you could

Re: A Simple FeedForward NeuralNetwork (using BackPropagation)

2012-11-19 Thread Timothy Washington
Yes, that's exactly what I found. I did a lot of test runs, varying my learning coefficient each time. The learning coefficients I used, ranged from 0.01 to 1.5. 0.02 seems to be a good coefficient for the data set I've started out with. I'm going to play around with it a little more though -

Re: A Simple FeedForward NeuralNetwork (using BackPropagation)

2012-11-19 Thread Timothy Washington
Hey, thanks for the *COMPETENT PROGRAM EVOLUTION* paper. I'll take a closer look at that. And I too think using reference material is a good start. The only clear outline of the backprop algorithm I found was in this paper: page.mi.fu-berlin.de/rojas/neural/chapter/K7.pdf. I haven't found a paper

Re: Idiomatic equivalent for double dispatch in clojure?

2012-11-19 Thread Jim - FooBar();
for what its worth, I'm building a highly polymorphic board-game engine [1] and I've stayed away from multimethods...I've used every single polymorphism capabillity that clojure provides (records/protocols, map-based, HOFs etc) except multi-methods. Performance is acritical matter for this

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Phil Hagelberg
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sean Corfield seancorfi...@gmail.com writes: Then you can show it with `gpg --export -a $KEY_ID`. $KEY_ID? (again, as I noted at the conj, without good documentation on the Leiningen site for this, folks won't necessarily know what this

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Jeff Heon
As a starting point, the gpg website features native installers for both Windows and Mac OS. http://www.gnupg.org -- 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

need to build clojure myself again?

2012-11-19 Thread Jim - FooBar();
Moving from clojure-1.5-alpha1 to -alpha4 i get this again: NoClassDefFoundError jsr166y/ForkJoinTask clojure.core.reducers/fjinvoke (reducers.clj:61) It took me a minute but eventually I remembered the same thing happened when I moved from 1.4 to 1.5-alpha1 in order to use reducers. There

Re: need to build clojure myself again?

2012-11-19 Thread Sean Corfield
Try -beta1 - I recall a patch recently that was supposed to fix this. On Mon, Nov 19, 2012 at 11:47 AM, Jim - FooBar(); jimpil1...@gmail.comwrote: Moving from clojure-1.5-alpha1 to -alpha4 i get this again: NoClassDefFoundError jsr166y/ForkJoinTask clojure.core.reducers/fjinvoke

[ANN] clj-xpath 1.3.3

2012-11-19 Thread Kyle R. Burton
clj-xpath is a library that makes it easier to with XPath from Clojure. I've never announced this library before (or any for that matter). Someone recently sent me a pull request to fix an issue in the README (during the Conj) so I thought I'd announce it to solicit feedback. The Leiningen

Re: need to build clojure myself again?

2012-11-19 Thread Jim - FooBar();
On 19/11/12 19:48, Sean Corfield wrote: Try -beta1 - I recall a patch recently that was supposed to fix this. thanks it works! :) Jim -- 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

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Sean Corfield
On Mon, Nov 19, 2012 at 9:51 AM, Phil Hagelberg p...@hagelb.org wrote: Perhaps it would be helpful if you could explain in more detail what it is about the provided explanation that you found confusing? In the first step you use an actual example, then switch to $KEY_ID without explanation,

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Lee Hinman
Jeff Heon writes: As a starting point, the gpg website features native installers for both Windows and Mac OS. http://www.gnupg.org And for OSX: https://www.gpgtools.org/ ; Lee -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: [ANN] Clojars Releases repository

2012-11-19 Thread jamii
I now have the same problem as Jim (with https://clojars.org/strucjure/versions/0.3.2). I do have a gpg key set up and previous deploys claimed to be signing (although they are list as unsigned now). What was the fix in this case? On Sunday, 18 November 2012 11:27:36 UTC-5, Nelson Morris

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Nurullah Akkaya
Is there a particular reason for not using Bouncy Castle[1]. Instead of forcing users to install gpg lein can generate and/or upload the key. [1] http://www.bouncycastle.org/ -- Nurullah Akkaya http://nakkaya.com On Mon, Nov 19, 2012 at 10:08 PM, Lee Hinman matthew.hin...@gmail.comwrote:

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Phil Hagelberg
Nurullah Akkaya nurul...@nakkaya.com writes: Is there a particular reason for not using Bouncy Castle[1]. Instead of forcing users to install gpg lein can generate and/or upload the key. Yeah, we intended to use that originally, but Bouncy Castle's PGP support is awful beyond words. It's

Re: Idiomatic equivalent for double dispatch in clojure?

2012-11-19 Thread Brian Marick
On Nov 19, 2012, at 9:32 AM, Thomas Goossens wrote: Yes indeed. with multimethods you can doue multi-argument dispatch. But that means that for every possible collision. I have to specify a method? If you read along in `asteroids.clj` file I showed, you'll see an example of a taxonomy. A

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Sean Corfield
On Mon, Nov 19, 2012 at 2:28 PM, Phil Hagelberg p...@hagelb.org wrote: Yeah, we intended to use that originally, but Bouncy Castle's PGP support is awful beyond words. It's effectively undocumented, and the classes it exposes really only make sense if you have the OpenPGP RFC memorized.

Clojure Recursion (loop-recur) Questions

2012-11-19 Thread Curtis
Clojure Koans - Recursion (defn recursive-reverse [coll] (loop [coll coll acc '() ] (if (= (count coll) 0) acc (recur (rest coll) (cons (first coll) acc)) ) ) ) I struggled with this one for a while - I don’t want to admit it, but honestly even though i

Re: ritz / nrepl.el / cljsbuild auto / cljsbuild repl-listen ... in same session?

2012-11-19 Thread Timothy Washington
Hey, just commented on the created issuehttps://github.com/pallet/ritz/issues/59of how to get *cljsbuild auto* and for *cljsbuild repl-listen* setup as nrepl middleware. Is it a matter or passing those as arguments into the nrepl eval

Re: Clojure Recursion (loop-recur) Questions

2012-11-19 Thread Andy Fingerhut
If you are familiar with tail recursion, then loop/recur this is Clojure's way to achieve tail recursion. http://en.wikipedia.org/wiki/Tail_call The general tail call optimization mechanism as implemented in the programming language Scheme, for example, means that tail-position calls must not

Re: [ANN] clj-xpath 1.3.3

2012-11-19 Thread Michael Klishin
2012/11/19 Kyle R. Burton kyle.bur...@gmail.com An introduction and some documentation is available here: http://kyleburton.github.com/clj-xpath/site/ The project is on github here: https://github.com/kyleburton/clj-xpath Dependency information is at the very bottom of the document?

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Sean Corfield
FWIW, after setting up a public key etc and using lein deploy clojars to push congomongo 0.3.3 (successfully with one key), I am also getting the error about transferring the POM: Sending congomongo/congomongo/0.3.3/congomongo-0.3.3.pom.asc (1k) to https://clojars.org/repo/ Sending

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Phil Hagelberg
Sean Corfield seancorfi...@gmail.com writes: Are you saying that all those people who don't have gpg or similar installed are unprofessional? It seems that such a statement would insult a very large number of software developers. It's one thing to not have gotten around to learning something;

Re: [ANN] new book: ClojureScript: Up and Running

2012-11-19 Thread Mark Engelberg
I just received the book today. I was surprised to see how thin it is, but I'm glad the book exists. I had a lot of trouble getting up and running several months ago, using only the scattered install instructions on the web. It's nice to have a clear path to getting started. Unfortunately, I

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Sean Corfield
On Mon, Nov 19, 2012 at 10:32 PM, Phil Hagelberg p...@hagelb.org wrote: Someone who writes software for a living without understanding how to securely share secrets over email *and is perfectly happy with that fact* is doing something wrong. Thanx for that clarification :) That's actually

Re: [ANN] new book: ClojureScript: Up and Running

2012-11-19 Thread George Oliver
On Monday, November 19, 2012 8:18:16 PM UTC-8, puzzler wrote: Then, at the command prompt I typed: lein trampoline cljs-build repl-rhino and got the following error message. I'm running on Windows. Any idea what's going wrong? Thanks. These kinds of errors usually mean a file path

Re: ANN: Clojure/West - Portland, OR - Mar 18-20, 2013

2012-11-19 Thread Alex Miller
Thanks for volunteering! I need you! I'll be in touch... (it might be a few weeks but fear not, I have you in my notes). Alex On Monday, November 19, 2012 12:48:10 AM UTC-6, César Piñera wrote: I hereby volunteer to organize a welcome party of Portland locals, a goodwill committee of

Re: [ANN] new book: ClojureScript: Up and Running

2012-11-19 Thread Sean Corfield
I wonder if it's some aspect of lein trampoline on Windows. As I understand it, trampoline generates a file that is used to fire up the next process and it may well have some *nix-ism that isn't compatible with Windows? On Mon, Nov 19, 2012 at 11:18 PM, Mark Engelberg

Re: [ANN] new book: ClojureScript: Up and Running

2012-11-19 Thread Sean Corfield
Looks like George nailed it with his note about issue 674 which came in while I was writing my (accurate but not particularly helpful) response... On Mon, Nov 19, 2012 at 11:45 PM, Sean Corfield seancorfi...@gmail.comwrote: I wonder if it's some aspect of lein trampoline on Windows. As I

Trouble calling Dojo grid constructor from ClojureScript

2012-11-19 Thread Brian Nelson
Hi, I'm brand new to ClojureScript and have been trying to get myself familiarized with it's javascript interop capabilities by implementing the Dojo toolkit tutorials. I've successfully implemented several of the tutorials, but now I've run into something that I can't figure out and am looking

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Peter Taoussanis
I'd caution anyone against trying to redeploy their libraries right now since there seems to be some serious unresolved issues. I just tried a redeploy myself and am also getting the ReasonPhrase:Forbidden error. Unfortunately this seems to leave the repo in a bad state, since dependency pull

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Sean Corfield
I removed congomongo completely from my local repo and lein repl seemed to pull it back down with no problems. Tested it on two machines. So it seems the repo on Clojars is OK for me - except that I can't redeploy the POM? On Tue, Nov 20, 2012 at 12:22 AM, Peter Taoussanis

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Peter Taoussanis
BTW for those of you running into the ReasonPhrase:Forbidden error, it seems as if the old lein-clojars can be used to restore a repo to a working (unsigned) state. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Wes Freeman
+1 on the checksum validation error and ReasonPhrase:Forbidden on the pom. Using leiningen preview10. I updated my version number to not have SNAPSHOT, so maybe that's why it's not working, compared to Sean's? Regardless of the current bug, thanks for working on this functionality, Phil (and

Re: [ANN] new book: ClojureScript: Up and Running

2012-11-19 Thread Mark Engelberg
Ugh, I should have guessed. My attempts to do clojurescript several months back were foiled by trampolining problems, but that was on lein 1.7. I was under the impression those problems had been fixed in lein 2.0, so I had expected it to work, but it looks like there is still an issue. Any easy

Re: [ANN] new book: ClojureScript: Up and Running

2012-11-19 Thread George Oliver
On Monday, November 19, 2012 9:34:29 PM UTC-8, puzzler wrote: Ugh, I should have guessed. My attempts to do clojurescript several months back were foiled by trampolining problems, but that was on lein 1.7. I was under the impression those problems had been fixed in lein 2.0, so I had

Re: ANN: Clojure/West - Portland, OR - Mar 18-20, 2013

2012-11-19 Thread Cesar Pinera
Sounds good! There's a few more fellow clojurians around. I'll bring the matter during our next meeting. You have my email, and my phone is 503-860-2792. It was good meeting you at the conj. -- Cesar Pinera On Monday, November 19, 2012 at 8:32 PM, Alex Miller wrote: Thanks for