Constructing java classes from a string containing the class name

2013-03-17 Thread Dave Snowdon
I need the ability to create one of a number of java classes which have constructors taking a known list of parameters. There are a large enough number of classes that having a set of conditions testing for each class name would be unmanageable. The classes are from a third-party jar file so I cann

Re: Constructing java classes from a string containing the class name

2013-03-17 Thread Dave Snowdon
gt; You can get the constructor and instance it: >> >> (-> klassname (Class/forName) (.getDeclaredConstructors String int) >> (.newInstance host port)) >> >> >> 2013/3/17 Dave Snowdon > >> >>> I need the ability to create one of a number of

Native library not found after upgrade to leiningen 2.0

2013-03-21 Thread Dave Snowdon
I just upgraded from leiningen version 1.5.2 to 2.0.0 and noticed that the native library path no longer seems to be set correctly. Here is my project file: (defproject naojure "0.1.0-SNAPSHOT" :description "Clojure wrapper for Aldebaran Robotics java NAOQI binding. Depends on the Aldebaran jar

Re: Native library not found after upgrade to leiningen 2.0

2013-03-23 Thread Dave Snowdon
to it as normal from > project.clj, no need to set native path manually... > > On 22 March 2013 02:17, xumingmingv > > wrote: > > Have a look at this: > > > http://nakkaya.com/2010/04/05/managing-native-dependencies-with-leiningen/ > > > > 在 2013-3-22

Newbie style question - implementing binary search

2010-07-27 Thread Dave Snowdon
Hi folks I've just started teaching myself clojure and for lack of a "real" project to use it on I've been using the "code kata" on pragprog.com as example problems to solve. I've implemented the binary search as described here: http://codekata.pragprog.com/2007/01/kata_two_karate.html however I'm

Re: Newbie style question - implementing binary search

2010-07-28 Thread Dave Snowdon
Thanks. That does look clearer. Dave On Jul 27, 4:15 pm, Joost wrote: > > I think the main thing that's confusing here is that you're messing > with offsets and split collections at once. At least is was confusing > to me. :) > > I think for binary search (which implies random lookup is ~ O(n) >

Any best practices for clojure + java mixed language projects?

2011-05-01 Thread Dave Snowdon
Hi folks I'm a long time Java/C++ developer who's been experimenting with toy clojure programs for a few of months. I've at last decided to give clojure a try for a more significant project but, given this will incorporate components written in java I'm not sure about the way to structure and bui

Re: Any best practices for clojure + java mixed language projects?

2011-05-02 Thread Dave Snowdon
Thanks. Will give that a go. cheers Dave On May 1, 8:29 pm, gaz jones wrote: > you can set the source path in leiningen to be whatever you like. the > sample file is quite useful for finding these things out: > > https://github.com/technomancy/leiningen/blob/master/sample.project.clj > > they key