I just remembered that people always ask me what version of clojure
I'm using, 1.3.0-master-SNAPSHOT.
On May 20, 9:41 pm, Jarl Haggerty wrote:
> I'm working on problem 66 at project euler and this is my solution so
> far. It calculates the minimum "x"s just fine but ta
I'm working on problem 66 at project euler and this is my solution so
far. It calculates the minimum "x"s just fine but takes almost a
minute when I turn limit up to 20. It's not going to solve the
problem fast enough but what I find strange it that if I set the limit
to 20 then nothing happens f
ble b]
(set! (.x a) (+ (.x a) (.x b)))
(set! (.y a) (+ (.y a) (.y b]
(time (dotimes [_ (int 1e9)]
(add a b)
On Mar 18, 10:08 pm, David Nolen wrote:
> On Sat, Mar 19, 2011 at 12:26 AM, Jarl Haggerty wrote:
>
>
>
> > Is there a reason I
imes [_ (int 1e9)]
(.getX q)
prints this:
"Elapsed time: 2220.368412 msecs"
"Elapsed time: 2214.941962 msecs"
"Elapsed time: 2168.259558 msecs"
"Elapsed time: 2162.655501 msecs"
"Elapsed time: 2172.560098 msecs"
On Mar 11, 7:05 am, Chouser
sted,
Java Output:
2.263
4.471
4.484
4.452
4.409
I thought it was strange that the first iteration ran so fast, so I
changed 1e9 to (int)1e9 and the speed got better, but I still wonder
why the first iteration before was so fast, the JIT is supposed to
make it faster isn't it?
Old Java Outpu
I should readjust my 5x statement, it's more like 2.25x.
On Mar 10, 8:39 pm, Jarl Haggerty wrote:
> I've been benchmarking java and clojure programs and wanted to make
> sure I was doing this right. I made two fairly similar programs that
> manipulated Vec2 objects from the
I've been benchmarking java and clojure programs and wanted to make
sure I was doing this right. I made two fairly similar programs that
manipulated Vec2 objects from the JBox2D library. At first clojure
was performing pretty poorly, then I tried compiling my clojure
script, and then replacing th
For a while I've been working on a 2D physics engine written in
Clojure. I just recently got to the point where I can run a
simulation(a box falling onto the ground) and it is painfully slow.
I'm shooting for 60 fps but I can barely get 10 when the box is
falling and when it lands on the ground an
seem to be what happens here.
On Dec 30, 9:18 pm, Sunil S Nandihalli
wrote:
> I don't think type hints lead to auto casting .. May be somebody else can
> throw more light on it. And it is this way by design.
> Sunil.
>
> On Fri, Dec 31, 2010 at 9:35 AM, Jarl Haggerty wro
I have this function
(defn floor
^int [^float x] x)
and (floor 1.5) returns 1.5 which confuses me as to how type hints
work, I was expecting the result to be truncated or for the program to
spit out some exception about expecting an int and getting a float.
--
You received this message becaus
that doesn't work reboot, if that doesn't work
I'll just use it for computer games like I did before.
On Dec 30, 5:41 pm, André Thieme wrote:
> Am 30.12.2010 07:54, schrieb Jarl Haggerty:
>
>
>
> > This code,
>
> > (defprotocol Matrix
> > (matrix-
1
>
> Are you sure you are using the latest Clojure 1.2 version and not an
> early beta, etc.?
>
> Process finished with exit code 0
>
> On Dec 29, 11:25 pm, Jarl Haggerty wrote:
>
> > What is wrong with my code(bottom of post)? I keep getting this
> > error.
This code,
(defprotocol Matrix
(matrix-get [this c r]))
(deftype Matrix2D [data height width]
Matrix
(matrix-get [this r c] 1))
Gives me this error
Exception in thread "main" java.lang.IllegalArgumentException: Can't
define method not in interfaces: matrix_get (core.clj:6)
at cloj
What is wrong with my code(bottom of post)? I keep getting this
error. Line 24 is "(get-cell [x r c] 1))" in the Matrix deftype and
36 is "(print (get-cell one r c) " "))" in the first nested "doseq"s.
I'm on Windows 7 with Clojure 1.2.
Exception in thread "main" java.lang.IllegalArgumentExcepti
I always write a function to take varargs because it can also take a
list using apply.
(+ 1 2 3 4 5)
(apply + [1 2 3 4 5])
On Nov 15, 9:52 am, Chris wrote:
> If you have a function that needs to treat multiple arguments as a
> group, what forces drive you to represent this as a single sequence
>
Math/abs won't accept ratios, so I assumed the Java Math functions
only took base number types but all the other methods I tried accept
ratios just fine.
user=> (Math/sin 1/2)
0.479425538604203
user=> (Math/sqrt 1/2)
0.7071067811865476
user=> (Math/pow 1/2 1/2)
0.7071067811865476
user=> (Math/abs
>
> -S
>
> On Nov 10, 10:36 pm, Jarl Haggerty wrote:
>
> > Leiningen was working just fine and I was perfectly happy, and one day
> > I decided I'd like to wrap my head around maven. The instructions for
> > using the maven clojure plugin are very concise and
Leiningen was working just fine and I was perfectly happy, and one day
I decided I'd like to wrap my head around maven. The instructions for
using the maven clojure plugin are very concise and easy to follow,
but they just don't seem to work for me. My pom.xml is at the bottom
of this message.
1
paccum (if (= from daccum)
> > [dotp-paccum [fpoints apoints]]
> > (recur paccum step accum))
> > [dotp-accum [apoints]]
> > [start start-points] (search <=)
>
[dotp-naccum [fpoints apoints]]
> > (recur naccum step accum))
> > dotp-paccum (if (= from daccum)
> > [dotp-paccum [fpoints apoints]]
> > (recur paccum step
I'm not sure what to do here, my program hangs at the following
defmethod. all my brackets seem to be balanced and I'm not receiving
any errors about undefined symbols. This sample prints 2 but never
gets to 3, (my poor man's debugging). This code is for the collision
detection is a physics engi
Should autocomplete work in the swank repl? It works perfectly in a
clj buffer but nothing happens in the repl.
On Aug 19, 7:46 am, Phil Hagelberg wrote:
> On Thu, Aug 19, 2010 at 6:21 AM, Steve Purcell wrote:
> > I guess Phil's very busy, but if he can apply this patch, then the regular
> > s
A slight tangent, is there anyway to represent exact square roots?
I'd like to have an exact closed form fibonacci function.
On Oct 13, 1:28 pm, David Sletten wrote:
> On Oct 12, 2010, at 5:44 PM, Brian Hurt wrote:
>
> > For example, in base 10, 1/3 * 3 = 0.9...
>
> It may seem counterint
I try not to post twice in a row but I thought it was rude of me not
to say thanks for the help.
On Oct 7, 7:42 pm, Jarl Haggerty wrote:
> I was using 1.2, I thought I posted that here but I don't see the
> message. I don't have the same problem in 1.3, but I have some
>
java -jar euler-1.0.0-SNAPSHOT-standalone.jar -Xms2048m -Xmx4096m
On Oct 7, 4:14 pm, Mark Engelberg wrote:
> On Thu, Oct 7, 2010 at 12:29 PM, Jarl Haggerty wrote:
> > I'm using clojure 1.2
>
> OK, I stand corrected. Stuart's right. The problem is that you're
> get
Problem 14 on project Euler is to find the number under 1,000,000 that
is the start of the longest Collatz sequence. My solution is below,
basically it uses a hash map to cache the lengths of collatz
sequences. But when I get to 113383 the collatz function just bounces
between the numbers 1, 2, a
(str "if " "Xbox 360 has all you need to run Clojure"), I was just
trying to emphasize that even if you could emit code you still had
other problems.
On Sep 23, 5:45 am, Timothy Baldridge wrote:
> > Is this still a problem if you compile everything ahead of time? I
> > noticed that if I make a j
Is this still a problem if you compile everything ahead of time? I
noticed that if I make a jar with leiningen my clj files are included
in the jar but I assumed that it was just part of some dogma that I
should share my source code.
Also, I asked a similar question where I was concerned about th
Since there appears to be a version of clojure being made for .Net I
was interested in the possibility of programming Xbox games in
clojure. I imagine the Xbox doesn't have many of the same limitations
that mobile devices have but as I understand it the version of .Net on
the Xbox is a compact ver
I seem to be talking to myself but I've been told that if I find a
solution to a problem I should share it. I understand that deftype,
defprotocol, and defrecord are pretty volatile in development and my
eclipse plugin is simply using an old version of clojure.
On Aug 31, 11:37 am, Jarl Hag
If it's of interest to anyone this isn't a problem for me outside of
Eclipse.
--
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 pati
The full error is
No implementation of method: :arraySet of protocol: #'ndarray.NDArray/
ArrayProtocol found for class: ndarray.NDArray.NDArray (NDArray.clj:0)
and the code is this
(ns ndarray.NDArray
(:import java.lang.Object))
(def ... (reify Object))
(defprotocol ArrayProtocol
(fixIndex
32 matches
Mail list logo