Re: help with serializing/deserializing structs

2010-01-26 Thread jleehurt
he easiest way to accomplish what I need is to serialize the structmaps as hashmaps when writing them, and then deserialize the hashmap into a new structmap when reading them. On Jan 26, 9:01 am, Stuart Sierra wrote: > On Jan 26, 11:40 am, jleehurt wrote: > > > Thanks Anders.

Re: help with serializing/deserializing structs

2010-01-26 Thread jleehurt
ct db fname object)) >    (catch Exception e >      (println (format "Caught exception when reading file %s:\n%s" fname > e) > > When writing it first writes to a temporary file and then renames so > that if the power cuts in the middle that you won't be left with

help with serializing/deserializing structs

2010-01-25 Thread jleehurt
Hi all, I am writing a distributed program using Clojure. I am trying to write some code to pass structs around to different nodes on the network by serializing and deserializing strings. I do not fully understand how to use *print-dup* and read to do this. The last line of the following gives th

Re: StackOverflowError Question

2009-04-22 Thread jleehurt
m. > > This may be another way (I didn't test it) to force the realization of > your matrix: > > (defn matrixMultiply [matrixA matrixB] >   (doall >     (map >      (fn [row] >        (apply map >             (fn [& column] >               (apply + (map * row column)

Re: StackOverflowError Question

2009-04-21 Thread jleehurt
0.5)) > user> (time (main 100)) > "Elapsed time: 8314.617 msecs" > ((0.5 50.5)) > user> (time (main 1000)) > ; Evaluation aborted. ;; Actually not stack overflow, but HEAP > overflow (it took a while though) > user> > > Thanks, > Dimiter "m

Re: StackOverflowError Question

2009-04-20 Thread jleehurt
e two other function calls > getAdaptedWeightVector > computeActualResponse > > Are these recursive as well? > > On Sun, Apr 19, 2009 at 11:26 PM, jleehurt wrote: > > > Hi all, I have the following code that trains a perceptron with the > > given inputs and corresponding desired inputs

Re: StackOverflowError Question

2009-04-20 Thread jleehurt
Nolen wrote: > You have two other function calls > getAdaptedWeightVector > computeActualResponse > > Are these recursive as well? > > On Sun, Apr 19, 2009 at 11:26 PM, jleehurt wrote: > > > Hi all, I have the following code that trains a perceptron with the &g

StackOverflowError Question

2009-04-20 Thread jleehurt
Hi all, I have the following code that trains a perceptron with the given inputs and corresponding desired inputs. For input/output vectors, when the size gets to about 2000, I am getting a java.lang.StackOverflowError in the following function: (defn trainPerceptron [beginningWeightVector allInp