Re: Change the CCW compile output catalog

2012-12-13 Thread Laurent PETIT
Hey Dave, 2012/12/3 Dave Ray dave...@gmail.com Hey Laurent, For what it's worth, I was a little surprised that CCW used it's own output folder rather than Eclipse's, but I understand why you'd do it that way. One thing that was a little problematic was that CCW automatically created the

Strange behaviour: nested def in proxy method body

2012-12-13 Thread kristianlm
Hello Clojurers! I'm enjoying testing Java code with Clojure and it's been a lot of fun so far. Coming from Scheme, the transit is comfortable. However, I encountered a big surprise when I nested def's and used them with a proxy: (defn new* [] (def i (atom 0)) (proxy [Object] []

Re: Clojure videos deleted from blip.tv?

2012-12-13 Thread Ilshad Khabibullin
On 13.12.2012, at 8:40, Alex Grigorovich alex.grigorov...@gmail.com wrote: Are these videos available elsewhere? Yes, in iTunes podcasts. -- 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

Re: Strange behaviour: nested def in proxy method body

2012-12-13 Thread Marshall Bockrath-Vandegrift
kristianlm krist...@adellica.com writes: I'm enjoying testing Java code with Clojure and it's been a lot of fun so far. Coming from Scheme, the transit is comfortable. However, I encountered a big surprise when I nested def's and used them with a proxy: This is a common surprise for people

how to launch repl and switch to specific namespace programmatically

2012-12-13 Thread stone
I tried the following way: java -Xmx1G -cp $CLASSPATH clojure.main -i src/my-repl/repl.clj -r where src/repl/repl.clj is : (ns my-repl.repl)(def my-var hi) (in-ns 'my-repl.repl) but after clojure repl launched, I am always in the default user namespace not 'my-repl.repl'. How to

Re: how to launch repl and switch to specific namespace programmatically

2012-12-13 Thread stone
seems that the repl start up namespace is hard coded in RT: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L437 static void doInit() throws ClassNotFoundException, IOException{ load(clojure/core); Var.pushThreadBindings(

Re: how to launch repl and switch to specific namespace programmatically

2012-12-13 Thread juan.facorro
The following code will start a repl in the my-repl.repl namespace: (ns my-repl.repl (:require [clojure.main])) (def my-var hi) (clojure.main/repl) So you'll be able to acces the vars defined in it. my-repl.repl= my-var hi Cheers, Juan On Thursday, December 13, 2012 2:25:44 PM UTC-3, stone

Re: how to launch repl and switch to specific namespace programmatically

2012-12-13 Thread juan.facorro
I forgot to add the modified command line for this to work as described: $ java -Xmx1G -cp $CLASSPATH clojure.main src/my-repl/repl.clj Juan On Thursday, December 13, 2012 3:15:36 PM UTC-3, juan.facorro wrote: The following code will start a repl in the my-repl.repl namespace: (ns

Re: (#({:a %}) :b)

2012-12-13 Thread Gary Verhaegen
I've found this gem in The Joy of Clojure : #(- [%]) which would work similarly for any literal, I guess : #(- {:a %}) in this case. Much nicer than identity, IMHO. On 4 June 2012 15:28, Steven Obua ste...@obua.de wrote: Jay's example has convinced me that redefinition is not a good idea

Re: abysmal multicore performance, especially on AMD processors

2012-12-13 Thread Wm. Josiah Erikson
OK, I did something a little bit different, but I think it proves the same thing we were shooting for. On a 48-way 4 x Opteron 6168 with 32GB of RAM. This is Tom's Bowling benchmark: 1: multithreaded. Average of 10 runs: 14:00.9 2. singlethreaded. Average of 10 runs: 23:35.3 3. singlethreaded, 8

Re: abysmal multicore performance, especially on AMD processors

2012-12-13 Thread Wm. Josiah Erikson
Ah. We'll look into running several clojures in one JVM too. Thanks. On Thu, Dec 13, 2012 at 1:41 PM, Wm. Josiah Erikson wmjos...@gmail.comwrote: OK, I did something a little bit different, but I think it proves the same thing we were shooting for. On a 48-way 4 x Opteron 6168 with 32GB of

Re: abysmal multicore performance, especially on AMD processors

2012-12-13 Thread Andy Fingerhut
I'm not saying that I know this will help, but if you are open to trying a different JVM that has had a lot of work done on it to optimize it for high concurrency, Azul's Zing JVM may be worth a try, to see if it increases parallelism for a single Clojure instance in a single JVM, with lots of

Re: Strange behaviour: nested def in proxy method body

2012-12-13 Thread Alan Malloy
On Thursday, December 13, 2012 4:14:23 AM UTC-8, Marshall Bockrath-Vandegrift wrote: kristianlm kris...@adellica.com javascript: writes: I'm enjoying testing Java code with Clojure and it's been a lot of fun so far. Coming from Scheme, the transit is comfortable. However, I

Re: abysmal multicore performance, especially on AMD processors

2012-12-13 Thread Wm. Josiah Erikson
Cool. I've requested a free trial. On Thu, Dec 13, 2012 at 1:53 PM, Andy Fingerhut andy.finger...@gmail.comwrote: I'm not saying that I know this will help, but if you are open to trying a different JVM that has had a lot of work done on it to optimize it for high concurrency, Azul's Zing JVM

Long response time after a clojure process was inactive for some time

2012-12-13 Thread Trastabuga
A while ago I created a small web site based on Clojure. I noticed that when there was no requests to the site for some period of time (a few hours) it may take up to 20-30 seconds to process an incoming request. I only thought that it has something to do with a particular web framework, but

Re: STM - a request for war stories

2012-12-13 Thread Ryan Kelker
@Paul Butcher I would argue that Clojure's STM implementation is very similar or based on the design of Apache CouchDB's Multi-Version Concurrency Model. 1. Immutable by default. 2. You can't corrupt a completed transaction. 3. Conflict resolution essentially gives the previous revision before

Re: abysmal multicore performance, especially on AMD processors

2012-12-13 Thread cameron
On Friday, December 14, 2012 5:41:59 AM UTC+11, Wm. Josiah Erikson wrote: Does this help? Should I do something else as well? I'm curious to try running like, say 16 concurrent copies on the 48-way node Have you made any progress on a small deterministic benchmark that reflects your

Re: Need ideas for carving project into namespaces

2012-12-13 Thread Timo Mihaljov
On 12.12.2012 02:16, Mark Engelberg wrote: Hi Mark, Here's my take on the problem. I hope you can adapt it to your situation. (ns example.canvas A canvas is an abstract interface to a graphics API. The canvas namespace does not build new functionality on top of the APIs, that's a job for

Re: Need ideas for carving project into namespaces

2012-12-13 Thread Mark Engelberg
On Thu, Dec 13, 2012 at 1:31 PM, Timo Mihaljov t...@mihaljov.info wrote: (ns example.patron The patron doesn't have an artistic vision (that's the artist's job), nor does it know how to talk to a graphics API (that's what the canvases are for). What it *does* know is how many triangles and

big atoms (was Re: STM - a request for war stories)

2012-12-13 Thread Ben Mabey
Datomic stores the entire database in an atom (not an STM ref), and updates it with a call to swap! It is literally no more complex than a trivial hackneyed book example. :-) A lot of my systems have evolved into something similar and I've wondered what the implications of this approach

Re: way to test if a coll is a record?

2012-12-13 Thread Jamie Brandon
A2. (instance? clojure.lang.IRecord (Foo.)) On 12 December 2012 14:53, Andy Fingerhut andy.finger...@gmail.com wrote: I haven't dug into the details, but this Clojure ticket looks like it might be related, if not the same issue: http://dev.clojure.org/jira/browse/CLJ-1105 It has been

Re: abysmal multicore performance, especially on AMD processors

2012-12-13 Thread Lee Spector
On Dec 13, 2012, at 4:21 PM, cameron wrote: Have you made any progress on a small deterministic benchmark that reflects your applications behaviour (ie. the RNG seed work you were discussing)? I'm keen to help, but I don't have time to look at benchmarks that take hours to run. I've

Re: STM - a request for war stories

2012-12-13 Thread Raoul Duke
the design of Apache CouchDB's Multi-Version Concurrency Model. because haskell got it from apache, i'm sure ;-) -- 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

Re: (#({:a %}) :b)

2012-12-13 Thread JvJ
Clever, but I always thought - had to take more than one parameter. Maybe that's only for - On Thursday, 13 December 2012 13:35:33 UTC-5, Gary Verhaegen wrote: I've found this gem in The Joy of Clojure : #(- [%]) which would work similarly for any literal, I guess : #(- {:a %}) in

Help: instance? always false for record type (in tomcat but not in jetty)

2012-12-13 Thread CGAT
I have a frustrating situation and would appreciate any help. The call (instance? A an-A-record) is returning false when an-A-record is in fact an instance of A. This is in a noir/compojure/ring server. But the problem *only* *occurs *when run under tomcat, *not* when run under

Re: Slime and heroku setup question

2012-12-13 Thread Jonathon McKitrick
So anything that's a heroku add-on will translate to a lein profile entry, correct? Yes, my project is a simple server app that will take POST data, save it, and return it as JSON when queried. Humble beginnings. On Wednesday, December 12, 2012 8:59:04 PM UTC-5, Sean Corfield wrote: You

Re: STM - a request for war stories

2012-12-13 Thread Wei Hsu
To add to the conversation, I wrote an agent-based website load tester earlier this year for work. Happy to share my thoughts with Paul offline if he thinks it's useful, although I wouldn't be able to share the code itself. On Dec 11, 2:25 am, Marko Topolnik marko.topol...@gmail.com wrote: To

Re: Slime and heroku setup question

2012-12-13 Thread Phil Hagelberg
On Wed, Dec 12, 2012 at 4:09 PM, Jonathon McKitrick jmckitr...@gmail.com wrote: So basically, I need to get used to editing in emacs, uploading to heroku, and (perhaps) interactively testing via a remote repl, correct? Sorry to belabor the point, but I'm trying to flatten the learning curve.

Re: Clojure videos deleted from blip.tv?

2012-12-13 Thread Leonardo Borges
Are these videos available elsewhere? Yes, in iTunes podcasts. Really? I tried finding them in itunes but no luck. Would you be able to point me to one of them? Cheers, Leo -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

STM - a request for war stories

2012-12-13 Thread Patrick Logan
Paul, Another concurrency model I've used a great deal is the tuplespace model, specifically javaspaces. This is an often forgotten model that has a lot to offer with a high expressiveness to complexity ratio. Not closure specific, so feel free to contact me again directly if you're

Re: STM - a request for war stories

2012-12-13 Thread kovas boguta
My recommendation is either Persistent Datastructures or Database as a Value Its shocking and amazing that an entire database (eg, the most concurrent stateful thing you can imagine) requires just a handful of atoms. Check out http://www.infoq.com/presentations/Datomic-Database-Value Persistent

re: tuple spaces (was Re: STM - a request for war stories)

2012-12-13 Thread Raoul Duke
Another concurrency model I've used a great deal is the tuplespace model, specifically javaspaces. This is an often forgotten model that has a lot to offer with a high expressiveness to complexity ratio. otish: in the back of my mind i seem to recall hearing that tuplespaces sounded nifty

Re: Clojure videos deleted from blip.tv?

2012-12-13 Thread Sean Corfield
When I tried to go to the Clojure videos link inside iTunes (from the set of videos that I already have downloaded), it went to an unknown podcast with no image and no episodes - and I can't find the actual list of blip.tvepisodes in iTunes... On Thu, Dec 13, 2012 at 3:59 PM, Leonardo Borges

Re: Help: instance? always false for record type (in tomcat but not in jetty)

2012-12-13 Thread Chris Jeris
In the Tomcat uberwar setting, is ns1 AOT-compiled? Are (.getClassLoader A) and (.getClassLoader (.getClass an-A-record)) different class loaders? That's what the problem was when this one bit me. I never did track down exactly why it happens or how to fix it. peace, Chris Jeris On Thu, Dec

Re: Need ideas for carving project into namespaces

2012-12-13 Thread dgrnbrg
I've written a large application that uses this approach. You can see it applied with protocols and multimethods in types.clj and protocols.clj, and the remainder of the code in types/*.clj. I used this to manage over 10 different extensions, and it's been simple enough to keep organized. I

Re: STM - a request for war stories

2012-12-13 Thread Rick Moynihan
On 12 December 2012 16:21, Warren Lynn wrn.l...@gmail.com wrote: Although I am convinced that STM can solve things that locks cannot (See the claim *lock-based programs do not compose *on Wikipedia page http://en.wikipedia.org/wiki/Software_transactional_memory), I feel this feature is so

Re: how to launch repl and switch to specific namespace programmatically

2012-12-13 Thread Stone
cool. it works great. Thanks! On Fri, Dec 14, 2012 at 2:19 AM, juan.facorro juan.faco...@gmail.comwrote: I forgot to add the modified command line for this to work as described: $ java -Xmx1G -cp $CLASSPATH clojure.main src/my-repl/repl.clj Juan On Thursday, December 13, 2012 3:15:36 PM

Re: Change the CCW compile output catalog

2012-12-13 Thread Dave Ray
On Thu, Dec 13, 2012 at 12:08 AM, Laurent PETIT laurent.pe...@gmail.com wrote: Laurent, Hey Dave, 2012/12/3 Dave Ray dave...@gmail.com Hey Laurent, For what it's worth, I was a little surprised that CCW used it's own output folder rather than Eclipse's, but I understand why you'd do it

Re: Help: instance? always false for record type (in tomcat but not in jetty)

2012-12-13 Thread CGAT
I did not AOT compile it, though I can try that. I'll check the ClassLoader as well, thanks. I do know that (class an-A-record) is A, suitably ns-qualified. Thanks for the ideas. What did you finally do when this happened to you? On Thursday, December 13, 2012 8:19:48 PM UTC-5, cjeris

Re: Help: instance? always false for record type (in tomcat but not in jetty)

2012-12-13 Thread CGAT
Without AOT, the classLoader's are not the same (str (.getClassLoader A)) WebappClassLoader delegate: false repositories: /WEB-INF/classes/ -- Parent Classloader: org.apache.catalina.loader.StandardClassLoader@790bc49d (str (.getClassLoader (class

Re: Help: instance? always false for record type (in tomcat but not in jetty)

2012-12-13 Thread CGAT
I've now put :aot [ns1] in the projects.clj, did lein compile, then lein ring uberwar. There was no difference. The class loaders are distinct and instance? still returns false. 1. Did I do the AOT compile incorrectly? Is it even necessary? (The class files are in the war file but *all*

Re: [ANN]First toy-project : CYASUS

2012-12-13 Thread Yakulu
Thanks for your answers. I've pushed some little changes according to your remarks. It should now compiles and launches. Have a nice day. -- 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

Re: Need ideas for carving project into namespaces

2012-12-13 Thread Mark Engelberg
It's interesting that most of the solutions presented here involve something along the lines of immigrate / potemkin / redefine (in your piplin code). With so many people reinventing the same wheel, it would seem that this really is a key piece to solving the problem of putting a friendly API on

Re: STM - a request for war stories

2012-12-13 Thread Paul Butcher
On 14 Dec 2012, at 00:22, Patrick Logan patrickdlo...@gmail.com wrote: Another concurrency model I've used a great deal is the tuplespace model, specifically javaspaces. This is an often forgotten model that has a lot to offer with a high expressiveness to complexity ratio. Ah! That brings

Re: STM - a request for war stories

2012-12-13 Thread Paul Butcher
On 14 Dec 2012, at 00:30, kovas boguta kovas.bog...@gmail.com wrote: My recommendation is either Persistent Datastructures or Database as a Value Interesting. I'd be interested to hear others thoughts on this. In particular Rich's Rich - what is the soundbite description of Clojure's

Re: STM - a request for war stories

2012-12-13 Thread Ryan Kelker
I don't really care where good ideas come from. Feel free to expand your mind. 2012年12月14日金曜日 6時58分54秒 UTC+9 raould: the design of Apache CouchDB's Multi-Version Concurrency Model. because haskell got it from apache, i'm sure ;-) -- You received this message because you are subscribed

Re: Need ideas for carving project into namespaces

2012-12-13 Thread Meikel Brandmeyer (kotarak)
Hi, playing devil's advocate: Am Freitag, 14. Dezember 2012 06:51:43 UTC+1 schrieb puzzler: It's interesting that most of the solutions presented here involve something along the lines of immigrate / potemkin / redefine (in your piplin code). With so many people reinventing the same

Re: Countdown numbers game in clojure.core.logic

2012-12-13 Thread Adam Clements
Hi, so I chose this problem as my first foray into core.logic too My solution is here https://github.com/AdamClements/countdown/blob/master/src/countdown/core.clj My solution is a little slow, depending on how tricky a problem it is, it can take from milliseconds to seconds. I ran [75 9 1 3 4]

Moving away from Noir

2012-12-13 Thread Anthony Grimes
Just posting this here to make sure as many people as possible have seen it. http://blog.raynes.me/blog/2012/12/13/moving-away-from-noir/ Associated HN thread for you masochists: http://news.ycombinator.com/item?id=4918720 -- You received this message because you are subscribed to the Google