Hope that helps.
Sincerely
Meikel
Thanks! That helped.
--
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 - please be patient with your
On 11 October 2010 22:39, Phil Hagelberg p...@hagelb.org wrote:
On Mon, Oct 11, 2010 at 12:21 PM, Ivan Willig iwil...@gmail.com wrote:
I often run into this issue where I am follow a Java documentation where
they developers fail to explain where they import packages from. In most
Java IDE's
Hello everybody,
I would like some help in writing a macro which accepts the return value
from mathematica and create a function in clojure which can be called. I am
kind of inexperienced writing macros.. I will try to describe what I have
done (does not work ) and request you all to help me
You were right, it was a classpath problem. But since I'm new to
classpaths it took me some time to get it right.
Thanks again, emacs+cdt makes development a lot easier :D
And, in case anyone needs to solve the same problems, these are the
steps to get cdt running for a leiningen-based project:
Hi,
I'm recently having problems where leiningen hangs for like 20
secondes after everything is done (I've added print statements to a
custom task, so I'm pretty sure nothing has to be done anymore). I'm
using Mac OS Snow Leopard, but a friend of mine is experiencing the
same with Ubuntu.
Did
Hello,
I just got the following error back from ssh/scp when copying
something back to clojars.org:
@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@
The RSA host
This works for me under Windows 7. I set all forward slashes paths in
my .emacs file like this:
(progn
(setq cdt-dir c:/msysgit/cdt)
(setq cdt-source-path c:/clj/clojure-1.2.0/src/jvm;c:/clj/
clojure-1.2.0/src/clj;c:/clj/clojure-contrib-1.2.0/src/main/clojure/
clojure/contrib;)
(load-file
I would also recommend using batch-write for this. It's *much* faster.
Regarding your error: Maybe you open too many sockets which don't get
closed and your process runs out of file descriptors.
On Tue, Oct 12, 2010 at 7:13 AM, David Nolen dnolen.li...@gmail.com wrote:
On Tue, Oct 12, 2010 at
On 12 oct, 03:56, Stuart Halloway stuart.hallo...@gmail.com wrote:
I've tried your definition
(def primes
(concat
[2]
(let [primes-from
(fn primes-from
[n]
(if (some #(zero? (rem n %))
(take-while #(= (* % %) n) primes))
On Oct 11, 6:56 pm, Stuart Halloway stuart.hallo...@gmail.com wrote:
When a var's definition has a lazy reference to itself, as primes does
below, then your results will be dependent on the lazy/chunky/strict-ness of
the calls leading to the lazy reference.
While I agree that this sort of
On Tue, Oct 12, 2010 at 5:43 AM, Saul Hazledine shaz...@gmail.com wrote:
I'm guessing the server has been moved/upgraded but I thought it best
to check since I couldn't see a notice of this anywhere.
This is correct; Clojars is now hosted on a new machine. Along with
the change of hardware
I keep running into this type of problem:
user= (- 12.305 12.3049)
9.9976694E-5
The computer (probably the JVM) has just lied to me. Any fourth grade
student will know that this does not equal 0.0001. This would be less
of a problem is the JVM was consistent; if it were consistent then
You could use BigInteger, which was created to work around double's
rounding issues - among other things.
(- 12.305M 12.3049M)
0.0001M
On 12/10/10 18:17, cej38 wrote:
I keep running into this type of problem:
user= (- 12.305 12.3049)
9.9976694E-5
The computer (probably the JVM)
On Tue, Oct 12, 2010 at 12:17 PM, cej38 junkerme...@gmail.com wrote:
I keep running into this type of problem:
user= (- 12.305 12.3049)
9.9976694E-5
http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
David
--
You received this message because you are
The JVM has no choice: it must faithfully implement the IEEE floating-
point spec (http://en.wikipedia.org/wiki/IEEE_754-2008), which
specifies limited precision. By asking it to use floats, you are
demanding that it accept rounding errors. If you want precision, there
are lots of ways to get it;
Thank you all for explaining this to me but I still don't understand
clojures behavior in this case,
Try running this code:
(def nums (drop 2 (range)))
(def primes (cons (first nums)
(lazy-seq (-
(rest nums)
(remove
(fn [x]
This discussion may help:
http://www.gettingclojure.com/cookbook:numbers#comparing-floats
Have all good days,
David Sletten
On Oct 12, 2010, at 12:17 PM, cej38 wrote:
I keep running into this type of problem:
user= (- 12.305 12.3049)
9.9976694E-5
The computer (probably the JVM)
Datatypes that implement a single method can be more simply
represented as ordinary functions, e.g.
(defn real-provider ...)
(defn fake-provider ...)
(defn load-page [provider ...]
(let [foo (provider)]
...))
That being said, you have other options: In clojure.test you can using
`binding`
Also see (rationalize) to simplify my example of using ratios. I
couldn't remember the name of the function off the top of my head, so
I used a hacked-up-by-me version.
On Oct 12, 9:33 am, Alan a...@malloys.org wrote:
The JVM has no choice: it must faithfully implement the IEEE floating-
point
Sorry, that should have been
(def primes
(concat
[2]
(lazy-seq
(let [primes-from
(fn primes-from
[n]
(if (some #(zero? (rem n %))
(take-while #(= (* % %) n) primes))
(recur (+ n 2))
(lazy-seq (cons n
On Oct 12, 2010, at 8:59 AM, Kyle R. Burton wrote:
Does Midje integration with the usual test lifecycle for maven and Leiningen?
If you type 'lein test', it'll run the Midje tests, but it doesn't hook into
the reporting system (so you get 0 tests run, 0 failures reported). I want to
see if
The posts and Midje looks pretty interesting, but I'm not sure if I was
able to follow, being new to Clojure. I'll give it another try later :)
Meanwhile, I've adjourned TDD in my project and wrote some code without
it to see if it makes more sense to me that way. I have to say that,
although I
Um, I meant BigDecimal, not BigInteger.
On 12/10/10 18:24, Felix H. Dahlke wrote:
You could use BigInteger, which was created to work around double's
rounding issues - among other things.
(- 12.305M 12.3049M)
0.0001M
On 12/10/10 18:17, cej38 wrote:
I keep running into this type of
Welcome to floating point math.
As an alternative, try using arbitrary-precision numerics:
user= (- 12.305M 12.3049M)
0.0001M
user= (type *1)
java.math.BigDecimal
On Oct 12, 9:17 am, cej38 junkerme...@gmail.com wrote:
I keep running into this type of problem:
user= (- 12.305 12.3049)
If you want to be really precise, most real numbers are an infinite
number of decimals.
If you encode them as a lazy seq of decimals, + - and other ops are doable.
Comparison is semi-decidable only: it terminates only in certain case
(finite number of decimals)
or when the number are different.
On Oct 12, 12:50 pm, David Sletten da...@bosatsu.net wrote:
This discussion may
help:http://www.gettingclojure.com/cookbook:numbers#comparing-floats
I originally tried something like float= described in the link, I give
the definition here
(defn float=
([x y] (float= x y 0.1))
([x y
Hi, I just started to learn clojure in a more serious way and I am
doing the first level of the greplin challenge.
I made it to work with a short palindrome like the example they give
me, but when it comes to work with the input file, it takes for ever
and I have to stop it.
$ time clj
On Tue, 12 Oct 2010 20:53:16 +0200, cej38 junkerme...@gmail.com wrote:
On Oct 12, 12:50 pm, David Sletten da...@bosatsu.net wrote:
This discussion may
help:http://www.gettingclojure.com/cookbook:numbers#comparing-floats
I originally tried something like float= described in the link, I give
Short comment:
I remember Common Lisp has rational numbers (I'm not sure). Any rational
number library for Clojure?
Angel Java Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez
On Tue, Oct 12, 2010 at 4:14 PM, Luka Stojanovic li...@magrathea.rs wrote:
On Tue, 12 Oct 2010 20:53:16
The more that I think about it, the more I would rather have a set of
equalities that always work. float= was a good try.
--
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
I suggest you read the article a bit more closely. Here are the details of your
specific case.
The number that you are typing as 12.305 is actually being stored in the
computer as this:
1100.010011110100001011110100001011100
This number is actually this fraction:
I actually played with this on Saturday morning while waiting for a friend, and
thought it was an interesting problem.
Your example is spending most of its time filtering with palindrome? across all
682695 items generated by all-combs. To see, try:
(defn tony []
(def source I like racecars
On Tue, 12 Oct 2010 12:35:24 -0700 (PDT)
cej38 junkerme...@gmail.com wrote:
The more that I think about it, the more I would rather have a set of
equalities that always work. float= was a good try.
Then you can't use floats.
As others have explained, floats are imprecise by nature, being
Back to my question: Am I trying to do Java in Clojure? Is there a more
Lisp-y way to do this?
You can hide the types so your client code is more lispy:
(defn load-page [prov] (.loadPage prov))
;;test
(def mp (make-mock-provider)) ... (load-page mp)
;;production
(def prov (make-provider)) ...
So for returns a lazy-seq of the combinations and I am forcing it to
process the values by filtering.
mmm...
I still tried your approach and nothing changed in processing time.
I changed the for form to filter as it is pairing the combinations, I
didn't think it would make any difference since I
2010/10/12 Stephen C. Gilardi squee...@mac.com
That may be related to having compiled code from different versions of
Clojure trying to mix. Do you know what the deps of rosado.processing are?
It may help to use clojure and contrib 1.2.0 rather than snapshots.
Thanks Steve. I've pushed a
The 'palindrome?' function can be made much faster. Your version --
which is idiomatic and fine when perf isn't a factor -- turns the test
string into a sequence, reverses it, turns it back into a string, then
checks for full equality with the original. There are faster (if
uglier) ways to check
I new the palindrome? function wasn't good in performance, but I
didn't think it would be that bad. The type hinting does improve
performance plus a mid way to compare.
Thanks for pointing that out and the max-key function.
On Oct 12, 4:15 pm, Justin Kramer jkkra...@gmail.com wrote:
The
On Tue, Oct 12, 2010 at 3:35 PM, cej38 junkerme...@gmail.com wrote:
The more that I think about it, the more I would rather have a set of
equalities that always work. float= was a good try.
RANT
Every fucking language I've ever worked on has had this problem- floats are
broken! And every
Hello,
I want to create a Clojure wrapper for Minim and push to clojars. So I have
a bunch of jar files from Minim as deps and I want to put them on my lib/.
How can I add a non-clojure jar file on my lein project?
Or I need to create a specific lein project for every jar? Like there's a
On Tue, 12 Oct 2010 17:44:20 -0400
Brian Hurt bhur...@gmail.com wrote:
On Tue, Oct 12, 2010 at 3:35 PM, cej38 junkerme...@gmail.com wrote:
The more that I think about it, the more I would rather have a set of
equalities that always work. float= was a good try.
RANT
Maybe initially, but
Any chance someone could walk us through how this visibility issue
occurs (where the range-based version of primes consumes numbers
before they are visible). This really looks like a case where side
effects and implementation details are causing what appear to be
strange behaviors, based on
a) Assuming all the dependencies are published in a maven repo out there:
If you put all your deps in project.clj, the pom.xml file generated by
leiningen will reference all of them as dependencies to your own lib.
You only need to publish your own library and the pom.xml to Clojars.
On Tue, Oct 12, 2010 at 6:41 AM, Moritz Ulrich
ulrich.mor...@googlemail.com wrote:
Regarding your error: Maybe you open too many sockets which don't get
closed and your process runs out of file descriptors.
Yes, I think that's the problem. I found a blurb on the net about how
to expand the
I'm just replying because I also do this in clojure and my level is
also
really slow:
http://github.com/krsanky/greplin-challenge/blob/master/greplin-challenge/src/greplin_challenge/level1.clj
:)
--paul wisehart
--
You received this message because you are subscribed to the Google
Groups
2010/10/12 lprefonta...@softaddicts.ca
a) Assuming all the dependencies are published in a maven repo out there:
If you put all your deps in project.clj, the pom.xml file generated by
leiningen will reference all of them as dependencies to your own lib.
You only need to publish your own
For each non-clojure jar file you have, you need to create a pom.xml
file using the instructions here,
http://github.com/ato/clojars-web/wiki/POM
and scp the pom file and the jar to clojars, then you can include them
in your project.clj.
So if Minim.jar depends on A.jar, B.jar, upload A.jar and
Normally the people maintaining the Minim project should publish their
stuff in a maven public repo. There are the ones in control of their
releases.
As far a publishing to Clojars, I do not know the policy.
Uploading various jars maintained by other teams not involved in
Clojure may pollute the
Thanks Garth.. That works well .. mathematica-clojure function has been
quiet usefull.
Sorry for the delayed response..
Sunil.
On Fri, Oct 8, 2010 at 9:54 AM, Garth Sheldon-Coulson g...@mit.edu wrote:
Sorry, the Needs call isn't quite right. Do this instead:
ClojurianScopes`
Garth
On
Hello Everybody,
I think I was not clear about things in my previous email.. I am reposting
simplifying things...
Variables is a macro which works in the following way..
(Variables (+ x (* 2 y))
returns
[x y]
now let us say we have a function
(defn f []
'(+ x (* 2 y)))
now I would like
On Oct 13, 5:31 am, lprefonta...@softaddicts.ca wrote:
As far a publishing to Clojars, I do not know the policy.
Uploading various jars maintained by other teams not involved in
Clojure may pollute the repo along the way.
As I understand it, its fine to put jars from other projects on
51 matches
Mail list logo