Thanks,
That (along with returning the completed path via (list)) nailed it. I
thought I'd tried concat at some point, but that might have been with
another problem I've been tackling.
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this
Thanks, Nathan, that did help.
I'm still stuck, however, figuring out how to return the values as a
flat sequence of vectors. Maybe I'm just missing the right function
from the API.
Here's where I'm at right now:
(defn get-paths
([n] (get-paths n [0 0] '()))
([n point path]
(cond
I've been working through algorithm problems to learn the language a
little better. I'm currently struggling with the question about a
robot traversing a grid. If the grid is completely open, then the
answer to how many possible ways to traverse the grid? is simply the
math for combinations using
The clojure.contrib.combinatorics/combinations does do exactly what I
was trying to do, although I was doing the problem as an exercise in
how to do it, and not in really needing combinations for something
else. The combinatorics library certainly does it in a more generic
way.
Since I knew that
This code doesn't return the value I intuitively expect:
user= (not= 1 2 1)
true
When I write that, I was expecting the equivalent of (and (= 1 2) (= 1
1)), but the macro expansion is essentially (not (= 1 2 1)).
Note: This came out of the :while condition of a (for) expression not
That's what I get for posting a question while feeding a 1-year-old
child and getting ready to leave for lunch.
I was trying to put together a (for) construct to output the
combinations of a set, and my logic was flawed.
Here's what I really wanted [for sets of 3]:
(for [m x n x o x :while (and
The NYTimes article on the class also mentions two other classes being
offered for free:
* Machine Learning, by Andrew Ng
* Introductory course on database software, by Jennifer Widom
I'm not sure of the official website for either of these, but the
Machine Learning class sounds promising and
Can you provide a more detailed review? How did it help you? What
area(s) that it focused on did you find most useful?
I've been playing with Clojure for nearly a year now, but it has just
been on my own. At work, however, it is just Java and C#. Of course,
I've also got several computer books
This is just my copy of something I pulled together from other sources
while working of Project Euler problems and perhaps refined a little:
(defn prime?
[n]
(cond
(or (= n 2) (= n 3)) true
(even? n) false
:else (let [sqrt-n (Math/sqrt n)]
(loop [i 3]
(cond
Sorry for the late response, but I haven't had time to play with
things in a couple days.
First discovery is that I probably cannot use the library path
variable, because some of the DLLs have to be loaded in a specific
order. Specifically, there is a clientswig.dll that has to be loaded
last.
Thanks for the suggestions. I'll look at the JNA soon to see if that
fits. But I already have working examples of Java code which uses the
JNI wrapper classes (generated by swig - by someone else). I'm not
making direct JNI calls myself, but trying to instantiate the Java
classes that are a part
Hmm, I see that the final draft of my question missed an essential
element, I am using Eclipse.
In any case, I've tried something really basic, and it fails:
(try (System/load C:\\app/bin/coms.dll) (println Native code
library failed to load.))
The file is there (I checked with an exists()
Of course not. I mentioned I'm new at this, right?
It seems I was doing that part right before. I'm getting
InvocationTargetException and NoClassDefFoundError, so I tried to work
my way from the start to see if I was missing something (which I
thought was a valid assumption, if exceptions were
Does any familiar with this NIO Watch service know if it handles NFS
issues? We have an in-house log monitoring tool at work (doesn't
everyone) which is written in Java, but the two big issues are message
framing (knowing when a multi-line message has ended) and getting null
bytes when tailing an
Yeah, it has been a good educational resource for working through.
I'm not finished, but I've put the Clojure version of all the code up
here:
https://www.assembla.com/code/little_clojure/subversion/nodes
Looking forward to those last couple chapters.
msd
--
You received this message because
Newbie here, to both LISP and Clojure. A friend has lent me a copy of
The Little LISPer and I've started working through it, using some
web resources to translate it into clojure.
My questions: How relevant are the ten commandments? What modification
need to be made ... either to the commandments
16 matches
Mail list logo