On Jul 5, 3:18 am, fft1976 wrote:
> On Jul 5, 2:31 am, Nicolas Oury wrote:
>
> > After, when I run the benchmark in -server with a big enough CacheCode area
> > (1000m), and enough iterations to have everything JITed, I get more than
> > 860.000 iterations per second. (I benchmarked 100 000 000
Very glad that test is now part of clojure core.
I've run into 2 strange behaviours when trying to write tests where
threads are involved. My case is a little complex so here is a minimal
version which shows what I mean:
test-test.clj:
(ns test-test
(:use clojure.test))
(deftest testathon
(
I second this suggestion to add the video to clojure.blip.tv. It felt
very awkward in 2009 to have to download this thing instead of stream
it. :)
I just watched it and wanted to say it's a very nice show of Clojure's
Java interop in practice. Congrats to Stuart. It was also very nice to
learn th
On Jul 5, 9:02 pm, Tom Faulhaber wrote:
> Parth,
>
> I've created a little wrapper as promised at:http://gist.github.com/141001.
>
> It gives you my-pprint:
>
> user> (binding [*print-base* 2] (my-pprint (range 10)))
> (0 1 10 11 100 101 110 111 1000 1001)
> nil
> user>
>
Thanks Tom. This work
On Sun, Jul 5, 2009 at 8:14 PM, Stephen C. Gilardi wrote:
>
> On Jul 5, 2009, at 8:12 PM, Mark Volkmann wrote:
>
> I'd appreciate it if someone
> could look it over and let me know if I've done anything that isn't
> very idiomatic.
>
> A few recommendations just at the "look and feel" level:
> - u
On Sun, Jul 5, 2009 at 8:05 PM, ataggart wrote:
>
> A set might be better to hold the player-refs, then you can just call
> (disj player-refs player-ref) without doing any extra checking.
Thanks, I llke that much better!
> Also you can access ref values without needing to be in a dosync.
> Thing
I should have been more clear when I said to use (disj ...); I meant
sending that via an alter.
On Jul 5, 6:05 pm, ataggart wrote:
> A set might be better to hold the player-refs, then you can just call
> (disj player-refs player-ref) without doing any extra checking.
>
> Also you can access ref
On Jul 5, 2009, at 8:12 PM, Mark Volkmann wrote:
I'd appreciate it if someone
could look it over and let me know if I've done anything that isn't
very idiomatic.
A few recommendations just at the "look and feel" level:
- use doc strings for functions in place of comments
- global delete of
A set might be better to hold the player-refs, then you can just call
(disj player-refs player-ref) without doing any extra checking.
Also you can access ref values without needing to be in a dosync.
Things being immutable, the value you get from, say, @team-ref won't
change once you have it.
On
Thanks for the tip on looking at clojure.contrib. I keep forgetting to
check there.
On Jul 5, 2009, at 4:20 PM, samppi wrote:
>
> If you need a JSON parser, there's already a good one included with
> clojure.contrib. The one with the FnParse library is just a sample to
> show how it works. Bu
I wrote some fairly simple code to demonstrate use of StructMaps and
Refs. It's 80 lines including comments. I'd appreciate it if someone
could look it over and let me know if I've done anything that isn't
very idiomatic.
The program models sports teams and players. The main functionality is
the
I'm not doing any funny things with load-string. The largest literal
at this time is
[2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79
83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163
167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251
257 263 269 271 277 2
On Jul 5, 10:53 am, igorrumiha wrote:
> I think it's safe to say that once again it's proved that Clojure
> easily matches the Java level of performance.
I think one shouldn't generalize from one [unverified] example.
Personally, I'll wait for Jon Harrop or someone to port the relevant
Shootou
On Sun, Jul 5, 2009 at 5:18 AM,
philip.hazel...@gmail.com wrote:
>
> Hi,
>
> The following code works as expected:
>
> (import 'javax.imageio.ImageIO 'java.io.File
> 'java.awt.image.BufferedImage)
> (defn bi-get-pixels
> [bi]
> (vec (.. bi (getData) (getPixels 0 0 (.getWidth bi) (.getHeight bi)
Hi Phil,
Part of me hopes there's a nicer way of doing this, but I was able to
get it working using:
(defn bi-get-pixels
[#^BufferedImage bi]
(let [raster (.getData bi)
pixels (.getPixels raster 0 0 (.getWidth bi) (.getHeight bi)
(cast (Class/forName "[I")
If you need a JSON parser, there's already a good one included with
clojure.contrib. The one with the FnParse library is just a sample to
show how it works. But please feel free to use it however it can be
useful to you. :)
On Jul 4, 1:45 pm, Wilson MacGyver wrote:
> Very timely, I need to parse
On Jul 5, 2009, at 2:01 AM, John Harrop wrote:
and got:
#32 in class file com/mycompany/myfile$eval__14598 (NO_SOURCE_FILE:0)>
Are there large literals elsewhere in the same namespace?
Here's some info from a previous report of this error:
http://groups.google.com/group/clojure/browse_frm/t
I don't know if it will help, but I used another flag. I have not my
computer at hand but I think it was in the lines of -XX
agressiveoptimizations.
Moreover, the performance goes from 200 000 to 800 000 depending on the size
of the chunks. I tried to launch for 1 or 10 millions iterations to find
I'm on an hp mini. It runs on an Atom processor. I ran ants.clj and it was
frozen for a little while. Then after maybe 30 seconds it looked normal --
a tick every second or half second or so. I'm running a lot of applications
though. On Ubuntu here too.
On Sun, Jul 5, 2009 at 11:17 PM, B Smit
On Tue, Jun 30, 2009 at 18:01, Rich Hickey wrote:
>
> On Tue, Jun 30, 2009 at 7:50 AM, Krukow wrote:
>>
>> On Jun 29, 7:51 pm, B Smith-Mannschott wrote:
>> [snip...]
>>> much on my netbook. The problem seems to be that with only a single
>>> (hyperthreaded) core the render agent is almost constan
On Jul 5, 3:05 pm, Nicolas Oury wrote:
> Actually, that would be so good, that I actually think there is a mistake
> somewhere either in my program or my computation of the speed.
> Let's wait for igorrumiha to check and to test this implementation.
>
OK, I did my tests, I found and fixed two sm
Parth,
I've created a little wrapper as promised at: http://gist.github.com/141001.
It gives you my-pprint:
user> (binding [*print-base* 2] (my-pprint (range 10)))
(0 1 10 11 100 101 110 111 1000 1001)
nil
user>
While doing this, I realized to my horror that ~r doesn't do 0
correctly for non-s
Each iteration contains 266 instructions. So, it is more like 10.5 clock
cycle per instructions.
Probably the cost of the method call, that I had to introduce in order to
have the JIT compile, or the fact that the status register is
not directly in a local variable but with an indirection, because
I had this:
(defn- subexpressions-of-sum** [[n p] terms]
(let-print [sum (cons '+ (map #(factor-term % n p) terms))
prod (rest (make-product* n p))]
(concat [sum] (subexpressions-of-product (cons sum prod)
in a source file with other definitions. Load-file worked. I then
change
Hi,
The following code works as expected:
(import 'javax.imageio.ImageIO 'java.io.File
'java.awt.image.BufferedImage)
(defn bi-get-pixels
[bi]
(vec (.. bi (getData) (getPixels 0 0 (.getWidth bi) (.getHeight bi)
nil
(bi-get-pixels (. ImageIO read (File. "/home/phil/prog/small-
test.png"))
Interesting talk Stuart, thanks for the link.
On Jul 4, 1:12 pm, Stuart Halloway wrote:
> Corey Haines, the touring software journeyman, recently spent a few
> days at Relevance (including a day pairing on a Clojure project). At
> the end, he videoed a conversation with me [1]. In Part 2 of
On Jul 5, 2:31 am, Nicolas Oury wrote:
> After, when I run the benchmark in -server with a big enough CacheCode area
> (1000m), and enough iterations to have everything JITed, I get more than
> 860.000 iterations per second. (I benchmarked 100 000 000 iterations in 121
> sec, on my 2.4GHz comput
You're right, the scenario that I described doesn't need it. In my
actual code I need it because the function actually reads
#(conj (or % #{}) constraint#)
If I don't do that, I get a list instead of a set.
On Jul 5, 5:12 pm, Meikel Brandmeyer wrote:
> Hi,
>
> Am 05.07.2009 um 07:27 schrieb Row
Hello,
Thanks to Rich's advices, I managed to make your ICFP program run very fast.
I have made a few modifications:
- changed the code following Rich's advices in order to have primitive array
access everywhere.
- I didn't managed to do it for booleans, so I used a java object
conataining only a
Hi,
Am 05.07.2009 um 07:27 schrieb Rowdy Rednose:
user=> (dosync (alter gnu-rms update-in [:key1 :key2 :key3] #(conj %
"foo")))
{:key1 {:key2 {:key3 #{"foo"
You actually don't need the anonymous function...
(dosync
(alter gnu-rms update-in [:key1 :key2 :key3] conj "foo"))
Sincerely
M
30 matches
Mail list logo