Re: slow mysql inserts

2011-01-19 Thread Christian Vest Hansen
- please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- Venlig hilsen / Kind regards, Christian Vest Hansen. -- You re

Re: why not change > < type compare functions do a compare on strings as well?

2010-11-29 Thread Christian Vest Hansen
gt; 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 > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com >

Re: Reference Menu sans Transients

2010-10-23 Thread Christian Vest Hansen
from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- Venlig hilsen / Kind regards, Christian Vest Hansen. -- You received this message because you are subscribed to the Google Groups &q

Re: Best practices for protocols

2010-10-16 Thread Christian Vest Hansen
up, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- Venlig hilsen / Kind regards, Christian Vest Hansen. -- You received this message because you are subscribed to the Google Groups "C

Re: Generating "special" classes

2010-10-06 Thread Christian Vest Hansen
t; > On Oct 5, 6:18 pm, nickikt wrote: >> deftype? >> >> On 5 Okt., 17:42, Christian Vest Hansen wrote: >> >> >> >> > I suppose there's no better way to generate classes with custom static >> > initializers and methods with the "nati

Generating "special" classes

2010-10-05 Thread Christian Vest Hansen
I suppose there's no better way to generate classes with custom static initializers and methods with the "native" keyword, other than perusing the innards of gen-class? -- Venlig hilsen / Kind regards, Christian Vest Hansen. -- You received this message because you are subscribe

Re: testing local functions?

2010-09-10 Thread Christian Vest Hansen
cribed 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 > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googl

Re: JSON lib of choice?

2010-09-08 Thread Christian Vest Hansen
unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- Venlig hilsen / Kind regards, Christian Vest Hansen. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: Bug in try/finally?

2010-08-10 Thread Christian Vest Hansen
that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- Venlig hilsen /

Re: Most elegant way of comparing vectors?

2010-05-19 Thread Christian Vest Hansen
s "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 > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more

Re: Problem using count

2010-03-09 Thread Christian Vest Hansen
re" 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 > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more optio

Possible change to launch script in homebrew

2009-12-06 Thread Christian Vest Hansen
mples: -J-server -J-Dname=value -J-Xmx2g My brew formular is located here: http://github.com/karmazilla/homebrew/blob/master/Library/Formula/clojure.rb -- Venlig hilsen / Kind regards, Christian Vest Hansen. -- You received this message because you are subscribed to the Google Groups "Cloj

Re: Closures in java

2009-11-28 Thread Christian Vest Hansen
sit this group at > http://groups.google.com/group/clojure?hl=en -- Venlig hilsen / Kind regards, Christian Vest Hansen. -- 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

Re: locking semantics: queue for the monitor?

2009-10-15 Thread Christian Vest Hansen
o send and send-off? Or are there other considerations? > > I would probably know this if I knew more about Java sync, but quick > web/groups searches don't give a clear answer. Sorry for the basic question. > > Garth > > > > -- Venl

Re: Metadata: something funny

2009-09-20 Thread Christian Vest Hansen
On Sun, Sep 20, 2009 at 7:25 PM, Christian Vest Hansen wrote: > On Sun, Sep 20, 2009 at 6:20 PM, samppi wrote: >> >> I was messing with the REPL when I found this happens: >> >> Clojure 1.0.0- >> user=> (def a #^{:a 5} [1 2 3]) >> #'user/a >>

Re: Metadata: something funny

2009-09-20 Thread Christian Vest Hansen
omething that the REPL is > doing? Where did {:b 2} go? And why does it happen with the reader > macro #^ and not with-meta? > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because y

Re: Ensure and STM: find the bug...

2009-09-17 Thread Christian Vest Hansen
> increased concurrency (i.e., retry only if the invariant doesn't > hold)? Any thoughts? > > Final question. The docs say that 'ensure' permits more concurrency > than promoting the ref to a write. Is there a quick/simple way of > explaining how? (Or do I need to go t

Re: Eval troubles

2009-09-03 Thread Christian Vest Hansen
)) > java.lang.Exception: Unable to resolve symbol: x in this context > (NO_SOURCE_FILE:1) > > (on a freshly downloaded&compiled clojure from github) > > According to my understanding of http://clojure.org/evaluation, my > code should simply return 2.

Re: clojure vs scala

2009-08-26 Thread Christian Vest Hansen
On Tue, Aug 25, 2009 at 10:43 PM, npowell wrote: > > On Aug 25, 4:36 pm, Christian Vest Hansen > wrote: >> I think he misrepresents both Scala and Clojure. > > ... > > Not a super helpful assessment. > > I'd like to hear more.  What do you disagree with

Re: clojure vs scala

2009-08-25 Thread Christian Vest Hansen
I think he misrepresents both Scala and Clojure. On Tue, Aug 25, 2009 at 7:11 PM, Emeka wrote: > Hello All, > > This sounds great! > > http://codemonkeyism.com/clojure-scala-part-2/ > > > Regards, > Emeka > > > -- Venlig hilsen /

Re: ANN: clojure-maven-plugin 1.0 released and in maven central

2009-08-25 Thread Christian Vest Hansen
gt; etc. see the project site at: >>>   http://github.com/talios/clojure-maven-plugin >>> Mark >>> -- >>> Discouragement is a dissatisfaction with the past, a distaste for the >>> present, and a distrust of the future >>> - Maree De Jong, Life NZ. &

Re: Clojure with maven - how to?

2009-08-16 Thread Christian Vest Hansen
> Can somebody help by posting a "hello world" example for one of (or >> both :) these issues? :) > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: binary serialization

2009-08-11 Thread Christian Vest Hansen
t; and no "reference inequality", so you must use linear seeks, making > the time complexity of serialization quadratic, where in C/C++ it > could be O(N log N) > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~--

Re: Good memory profilers (program or human)?

2009-07-31 Thread Christian Vest Hansen
final long one.  Also, the >> Java StringBuilder that Clojure's (str ...) function uses probably >> needs to be copied and reallocated periodically as it outgrows its >> current allocation. So I could imagine needing about 3 * 250 Mbytes >> temporarily, but that doe

Re: Examining performance on the JVM

2009-07-16 Thread Christian Vest Hansen
a block of > code. > > I'm just curious here really, but it does seem like there are many > knowledgeable people on this list that might be able to offer some > tips. > > Thanks, > Brad > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-

Re: ANN: FnParse, a functional parsing library

2009-07-15 Thread Christian Vest Hansen
>>>> A sample JSON parser is athttp://wiki.github.com/joshua-choi/ >>>> fnparse/sample-json-parser >>>> . >>>> Online documentation is available at:http://wiki.github.com/joshua- >>>> choi/fnparse >>>> . >>>> The source

Re: Java STM

2009-07-13 Thread Christian Vest Hansen
he refs be immutable. On Mon, Jul 13, 2009 at 2:07 AM, Vagif Verdi wrote: > > Potentially interesting library for clojurians. Java STM > implementation: http://www.deucestm.org/ > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~---

Re: Clojure STM not serializable

2009-06-18 Thread Christian Vest Hansen
p 2000) ; or any slow computation >        (ref-set b (inc old-a)) > > (.start >  (Thread. >    #(dosync >      (let [old-b @b] >        (Thread/sleep 2000) ; or any slow computation >        (ref-set a (dec old-b)) > > (Threa

Re: Clojure goes Git!

2009-06-17 Thread Christian Vest Hansen
; is a github workflow term for when you have a fork (created with the "fork" button on github) with your own changes, and you want Rich to pull in those changes. To do that, you press the "pull request" button and Rich will get a private message, and possibly also an email, with yo

Re: The thread ring problem

2009-05-29 Thread Christian Vest Hansen
would one fix this? With a CountDownLatch? That's what I'm currently trying. > > 2009/5/29 Christian Vest Hansen : >> >> For kicks, I made an implementation* using agents: >> >> http://gist.github.com/119946 >> >> I think that you may not want

Re: The thread ring problem

2009-05-29 Thread Christian Vest Hansen
; by the way, why can't I compile the class? > > Thanks a lot. > > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?

2009-05-28 Thread Christian Vest Hansen
0.0 >  slim > > > I'll submit patches to reflect the changed POM. > > Thank you all for your support! > Stefan Hübner > > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received

Re: Is "apply" slow or am I incorrectly benchmarking this?

2009-05-20 Thread Christian Vest Hansen
not seeing. > > Thanks a lot for the help >  -Patrick > > (let [i [1]] >  (time (dotimes [j 1000] >          (apply #(Math/ceil %) i > > Elapsed Time: 4123.448 msecs > > (let [i 1] >  (time (dotimes [j 1000] >          (Math/

Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?

2009-05-07 Thread Christian Vest Hansen
; - J. > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegr

Re: Is Clojure production ready?

2009-04-16 Thread Christian Vest Hansen
gt; > Thanks, > > Aaron > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Print a Large Lazy Seq - Heap Error

2009-04-02 Thread Christian Vest Hansen
you iterate them. > tks, > PJ > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goo

Re: I feel I'm making an elementary mistake with proxy, but I don't know what...

2009-04-02 Thread Christian Vest Hansen
atching >> field found: preferredLayoutSize for class >> clojure.proxy.java.lang.Object$LayoutManager (NO_SOURCE_FILE:0) >>   [Thrown class clojure.lang.Compiler$CompilerException] >> >> I get the same thing for all its methods, when I try to call them >> manual

Re: Clojure Users Group - Denmark

2009-04-01 Thread Christian Vest Hansen
ke sure you subscribe to the feed - I'll post news/updates > there. Also, if you are arranging talks locally let me know, I'll put > news up on the blog... > > Looking forward to it. Cheers, > - Karl > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --

Re: Scala vs Clojure

2009-03-31 Thread Christian Vest Hansen
anything significant on the JVM so I'm interested in >> picking >> one of these two languages and shipping a product for it. I've done >> a lot of >> commercial work with F# over the past 2 years but all Microsoft- >> related sales >> have died this year

Re: Clojure Users Group - Denmark

2009-03-30 Thread Christian Vest Hansen
scope was broadened to be more like lambda lounge? > > Cheers, > /Karl > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure&

Re: Is there already a function to apply functions to maps by key?

2009-03-26 Thread Christian Vest Hansen
> > (defn update >  [m & keyfuns] >    (let [[key fun & rest] keyfuns] >      (if (and key fun) >        (recur (assoc m key (fun (key m))) rest) >        m))) > > (def foo {:a 5 :b 7}) > (def bar (update foo :a inc :b #(+ 5

Re: Clojure + Java compilation and IntelliJ IDEA plugin

2009-03-26 Thread Christian Vest Hansen
s to be directly and knowingly interacted with in the Java code. So, my *assumption* (because I have no way of knowing for sure) is that this last case is the less common one, and therefor it makes sense to compile the Java code first. This is my reasoning anyway. -- Venlig hilsen / Kind regard

Re: Clojure + Java compilation and IntelliJ IDEA plugin

2009-03-25 Thread Christian Vest Hansen
ents and proposals are appreciated. :) > > With best regards, > Ilya Sergey > > > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: STM and useful concurrency

2009-03-24 Thread Christian Vest Hansen
nce. If I found out that a >> particular transaction was commonly being retried many times, is that >> a sign that I need to write the code differently? How would I find out >> that was happening? I know I could insert my own code to track that, >> but it seems like this may be

Re: ANN: Preliminary Clojure Support in Buildr

2009-03-23 Thread Christian Vest Hansen
with Scala/Java or Groovy/Java does not necessitate > an extra "require", but this first one is necessary to get the process > started and ensure that Clojure's compiler becomes the dominant > selection. > > Daniel > > > -- Venlig hilsen / Kind regar

Re: User contributed packages (Cabel, CPAN, etc)

2009-03-22 Thread Christian Vest Hansen
ill be in the user > community and the code that we can generate.  A good package manager > will help fuel that growth. > > And now I'll cop out & say that I have no idea about how to actually > implement this sort of thing - I'm hoping somebody else will want to > do

Re: Creating Java Objects for Rhino at runtime

2009-03-18 Thread Christian Vest Hansen
ot; without having to restart the > JVM between each change. > > Is there anything I'm missing, or will there be a way in the future to create > dynamic Java objects at runtime? > > -- >           Sverre Johansen > > > > -- Venlig hilsen / Kind regards, Christian

Re: Symbols evaluated at compile time?

2009-03-16 Thread Christian Vest Hansen
cases where this isn't true. > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send e

Re: filter1 interesting?

2009-03-16 Thread Christian Vest Hansen
ra characters. > > "pick" might be good. > > -Stuart Sierra > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cl

Re: Performance tips for Clojure

2009-03-13 Thread Christian Vest Hansen
times [i 100] >        (rest c > >  (timerest (into [] (range 1)))  ==> "Elapsed time: 125.826519 msecs" > > If 'rest' were O(n) on vectors, we should be able to multiply the > length of the vector by 100 and see the time g

Re: filter1 interesting?

2009-03-11 Thread Christian Vest Hansen
On Wed, Mar 11, 2009 at 9:01 AM, Vagif Verdi wrote: > > Is (first (filter ..) lazy like in haskell ? Yes. > I would hate to wait for filter to get all results just to throw them > out and pick the first one. > > > > -- Venlig hilsen / Kind regard

Re: Question about instance?

2009-03-10 Thread Christian Vest Hansen
t 'coerce' instead of 'instance' - I think that name is clearer and fits the intent better. > > > Regards, > Tim. > > > On Mar 10, 7:15 pm, Christian Vest Hansen > wrote: >> On Mon, Mar 9, 2009 at 11:10 PM, Laurent PETIT >> wrote: >&g

Re: What is Clojure NOT good for?

2009-03-10 Thread Christian Vest Hansen
the average stupid programmer can't understand >> virtually guarantees that you'll increase your success chances, since you >> and your team-mates will be of a higher caliber. > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~--

Re: Question about instance?

2009-03-10 Thread Christian Vest Hansen
seen ? What about this case: (when-let [x (instance? java.lang.Boolean false)] (println x)) I think that should print 'true', and therefor I am against this proposal. > > Thanks in advance, > > -- > Laurent > > > > > -- Venlig hilsen / Kind regards,

Re: ANN: Preliminary Clojure Support in Buildr

2009-02-27 Thread Christian Vest Hansen
gt; On Feb 26, 7:59 pm, Daniel Spiewak wrote: >> >> > Crud.  I suspect this is something weird with the way that the GitHib >> > gem server works.  I'll try to repeat the problem on Ubuntu as soon as >> > I get back to my computer.  In the meantime, you could try th

Re: Mathy operations on non-numerics (was "Adding" strings)

2009-02-27 Thread Christian Vest Hansen
er. "10") (Long. "10")) false user=> (= (Integer. "10") (Long. "10")) true Given these consequences, I think the current behavior is the best compromise. > > Allen > > > > -- Venlig hilsen / Kind regards, Christian Vest Hanse

Re: ANN: Preliminary Clojure Support in Buildr

2009-02-26 Thread Christian Vest Hansen
ll about, but you > should still be ok (crazy gems).  Try the following: > >  buildr --version > > Daniel > > On Feb 26, 3:16 pm, Christian Vest Hansen > wrote: >> On Thu, Feb 26, 2009 at 6:17 PM, Daniel Spiewak wrote: >> >> > Odd.  Must be a problem wi

Re: ANN: Preliminary Clojure Support in Buildr

2009-02-26 Thread Christian Vest Hansen
e to generate the docs I can live with, but that "File not found" line looks pretty suspect. > > Daniel > > On Feb 26, 10:58 am, Christian Vest Hansen > wrote: >> Nice initiative! >> >> However, it the net-ssh dependency has problems: >> >

Re: ANN: Preliminary Clojure Support in Buildr

2009-02-26 Thread Christian Vest Hansen
pport is *extremely* experimental and > probably not too reliable at this point.  Also note that while it is > possible that Clojure support will be merged into the Buildr trunk in > future, it has not yet been decided one way or another (see > https://issues.apache.org/jira/browse/B

Re: alternate syntax

2009-02-23 Thread Christian Vest Hansen
persue it any further. > > A translation from standard Clojure syntax to this alternate form > should also be possible. > > Is this a bad idea? It is not inherently bad, but I doubt that a lot of people would prefer it as their primary reader over the standard Clojure reader. It could,

Re: Clojure Questions

2009-02-21 Thread Christian Vest Hansen
uld answer, that would be a great help. > > What is the minimum required JVM version for clojure? > > What versions of Java have been tested? > > What versions of Java are supported? > > Thanks! > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --

Re: map literals, computed keys and side-effects

2009-02-17 Thread Christian Vest Hansen
On Tue, Feb 17, 2009 at 10:07 PM, Rich Hickey wrote: > > > > On Feb 17, 3:30 pm, Christian Vest Hansen > Please don't create issues without getting a nod from me here first. Ok. I won't. I must have overlooked the "Similarly, please confirm a bug before making a

Re: map literals, computed keys and side-effects

2009-02-17 Thread Christian Vest Hansen
an't say what's normal here. > > Christophe > > -- > Professional: http://cgrand.net/ (fr) > On Clojure: http://clj-me.blogspot.com/ (en) > > > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~

Re: map literals, computed keys and side-effects

2009-02-17 Thread Christian Vest Hansen
Just to clarify; I think PersistentArrayMap is too naïve: user=> {1 1 1 1 1 1 2 2} {1 1, 1 1, 1 1, 2 2} Also, this is rev 1286 (just prior to lazy-branch merge thingy). On Tue, Feb 17, 2009 at 8:50 PM, Christian Vest Hansen wrote: > I think I got it :) > > The two (swap! a in

Re: map literals, computed keys and side-effects

2009-02-17 Thread Christian Vest Hansen
key twice, which in turn causes it to evaluate twice; into two different keys with two different associations. On Tue, Feb 17, 2009 at 8:28 PM, Christian Vest Hansen wrote: > That's odd. > > Might you have uncovered a bug regarding: > > user=>

Re: map literals, computed keys and side-effects

2009-02-17 Thread Christian Vest Hansen
gt; 6 7 7 8 8}) > {1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7, 8 8} > > Granted, it's not casual Clojure code but it's surprising. > > Christophe > > -- > Professional: http://cgrand.net/ (fr) > On Clojure: http://cl

Re: do-form swallows exception?

2009-02-17 Thread Christian Vest Hansen
gt; (do >(map (fn [_] (throw (RuntimeException. "fail"))) [1 2]) >"no exception")) > > this however does throw exception: > > (defn foo [] > (map (fn [_] (throw (RuntimeException. "fail"))) [1 2])) > > Is this a bug or am I missing so

Re: Anonymous recursive functions

2009-02-16 Thread Christian Vest Hansen
> I know this is not the best way to write a factorial (it is not tail- > recursive), the point is just to show an example of a recursive call. > > Konrad. > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--

Re: run clojure on 5,832 cores?

2009-02-14 Thread Christian Vest Hansen
On Sat, Feb 14, 2009 at 1:31 AM, Stuart Sierra wrote: > > On Feb 13, 6:13 pm, Christian Vest Hansen > wrote: >> I see no mention of a JVM being available for those CPUs, but perhaps >> the no-asm HotSpot can be build with gcc on it. > > Looks like they run Lin

Re: run clojure on 5,832 cores?

2009-02-13 Thread Christian Vest Hansen
I see no mention of a JVM being available for those CPUs, but perhaps the no-asm HotSpot can be build with gcc on it. Otherwise, cool gear :) On Fri, Feb 13, 2009 at 11:47 PM, Raoul Duke wrote: > > http://sicortex.com/products > > > > -- Venlig hilsen / Kind regards, Chr

Re: A Clojure documentation browser

2009-02-11 Thread Christian Vest Hansen
tribution, but in which jar file? It was added in Java 6. Could you perchance be running Java 5? > > Konrad. > > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you

Re: String/valueOf on char array

2009-02-07 Thread Christian Vest Hansen
e same value? Your "cs" var have type Object and therefor hits the generc String.valueOf(Object) overload. You can fix it with typehints: user=> (def #^{:tag "[C"} cs (.toCharArray "abc")) #'user/cs user=

Re: Type hint Java array of your own Java class

2009-02-05 Thread Christian Vest Hansen
m the left and eats someone :) > > -- > Professional: http://cgrand.net/ (fr) > On Clojure: http://clj-me.blogspot.com/ (en) > > > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message

Re: Clojure speed

2009-02-03 Thread Christian Vest Hansen
significantly in JDK 7: http://markmail.org/message/7conncsespvrlazn -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to t

Re: Queues

2009-02-03 Thread Christian Vest Hansen
end. For queues you need to add > at one end and remove from the other, so one of the two operations is > necessarily expensive. But is there a difference between the two? > > Konrad. > > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-

Re: Clojure speed

2009-02-02 Thread Christian Vest Hansen
gt; microbenchmark! Can anybody explain this to me? (No flame wars, > please, I am really interested in why the things are as they are, is > it considered ok or not, and what can be done to make Clojure faster > on similar tests). > > > > -- Venlig hilsen / Kind regards, C

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Christian Vest Hansen
ed as well. > > Are there alternate strategies for building a large sequence that > would consume less memory per element? Don't keep the head around on any list (well, seq really) unless you really mean/need it. > > Thanks, > Keith > > > > -- Venlig hilsen /

Re: what does -> mean?

2009-02-02 Thread Christian Vest Hansen
On Mon, Feb 2, 2009 at 1:34 PM, wubbie wrote: > > any concrete example? http://github.com/karmazilla/textjure/blob/cf4ac457358e02f1d1d46d14a2885da0544dbd46/textjure.clj#L342 > > thanks, > -sun > > > On Feb 2, 5:13 am, Christian Vest Hansen wrote: >> On Sun, Fe

Re: what does -> mean?

2009-02-02 Thread Christian Vest Hansen
gt; those. I >> > > will have to study maps more, I guess, to understand the last one. I >> > > don't >> > > know where 'x' came from: >> > >> > >> user=> (-> x :one :b) >> > >> 2- Hide quoted text -

Re: possible compiler bug

2009-01-29 Thread Christian Vest Hansen
nding > something. In other words, the class certainly does exist within the > com.X.Y.Z package, so the code should be correct. > > I think what's going on is that while the then-branch is not really > evaluated, the parser walks over the AST and then som

Re: nested maps

2009-01-29 Thread Christian Vest Hansen
:address :city]) >> >> Is this the best way to get a new map where the city is changed? >> (update-in person [:employer :address :city] (fn [old & args] "Clayton")) >> I can't get this to work with #("Clayton") in place of the anonymous >> functio

Re: repeat and replicate

2009-01-28 Thread Christian Vest Hansen
y. More likely, I think one of them could take multiple arities and make the other obsolete. > > -- > R. Mark Volkmann > Object Computing, Inc. > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You

Re: dispatch macros that are new to me

2009-01-27 Thread Christian Vest Hansen
> (Well, you can but it won't do what you want). But what you can do is put your "clj" script in /usr/local/bin and then invoke it with "#!/usr/bin/env clj" :) > > -- > Cosmin Stejerean > http://offbytwo.com > > > > > -- Venlig hilsen / K

Re: Multi-CPU on Mac Not Exploited?

2009-01-27 Thread Christian Vest Hansen
gt;> >>> What is the correct interpretation of these results? Does one need >>> more than 2 CPU's to see a benefit? Or is the Mac JVM only using one >>> CPU instead of two? Or...? >>> >>> ...and is there something wrong with my setup tha

Re: Dauphin: mona lisa genetic algorithm in clojure

2009-01-27 Thread Christian Vest Hansen
s of the function. When the function is no longer live, both it and its ClassLoader become legible for garbage collection. > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are su

Re: an example where locking is appropriate?

2009-01-26 Thread Christian Vest Hansen
e. However, I think your double-check scheme, while safe, is of limited value. Uncontended locks, as would be the case in lancet, are pretty cheap. > > Stuart > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~---

Re: NewBie Q: doall forces eval and dorun not; but why?

2009-01-26 Thread Christian Vest Hansen
get into your way. Whenever you end up with "But in this other >> field/language we do/have/can ....", you should take a step >> back and forget about the other field/language and look >> simply at Clojure. We cannot cater all the previous experiences >> of all the Cloj

Re: PermGen growth

2009-01-25 Thread Christian Vest Hansen
> being defined, The expression to call your function was being defined over and over, causing new classes to be generated. This is a side-effect of eval, which the REPL is based upon. > why would this evaluation use any PermGen? > > On Jan 25, 5:57 am, Christian Vest Hansen > wrote: &

Re: PermGen growth

2009-01-25 Thread Christian Vest Hansen
, Jan 25, 2009 at 3:08 PM, Greg Harman wrote: > > I believe you, but I don't understand why. I'm doing nothing but > evaluate my test function over and over. Since no new functions are > being defined, why would this evaluation use any PermGen? > > On Jan 25, 5:57 am, Ch

Re: Binding values in a list of symbols and evaluating as code

2009-01-25 Thread Christian Vest Hansen
ch in turn have references to all Classes that it has loaded. So, if an Object whose Class was loaded by loader A holds a reference to any Object whose Class was loaded by loader B, then you will not be able to GC loader B or any of its classes. -- Venlig hil

Re: PermGen growth

2009-01-25 Thread Christian Vest Hansen
unction. > > I don't have any anonymous function definitions in my function, so > what is causing the used PermGen growth? > > thanks, > Greg > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You rece

Re: Regarding (.keySet {:a :map})

2009-01-23 Thread Christian Vest Hansen
On Fri, Jan 23, 2009 at 11:06 PM, Rich Hickey wrote: > > > > On Jan 23, 1:47 pm, Christian Vest Hansen > wrote: >> I type this expression in the REPL (trunk 1228): >> >> user=> (let [s (.keySet {:a 1})] [(set? s) (ifn? s)]) >> [false false] &g

Regarding (.keySet {:a :map})

2009-01-23 Thread Christian Vest Hansen
I type this expression in the REPL (trunk 1228): user=> (let [s (.keySet {:a 1})] [(set? s) (ifn? s)]) [false false] But I expected it to return [true true]. Is this an oversight, or is there a good reason for this behavior? -- Venlig hilsen / Kind regards, Christian Vest Han

Re: Streams work

2009-01-22 Thread Christian Vest Hansen
MT safety of ordinary iters, and I don't know enough to prefer one approach over the other. > > For those looking to experiment with such things, feel free to try it > now and provide feedback. > > Thanks, > > Rich > > > > -- Venlig hilsen / Kind regards,

Re: Agent as a processing queue

2009-01-22 Thread Christian Vest Hansen
ould get something >> > like this: >> > C:\java>clj job-queue.clj >> > (4 3) >> > (0 nil Hi mum) >> > Which are the results of multiple queued computations taken at two >> > subsequent points in time. >> >> > From your po

Re: Unexpected binding behavior

2009-01-20 Thread Christian Vest Hansen
user=> (binding [*num* 1024] (h *num*)) (1024) -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

Re: JScrollPane + JTextPane trouble.

2009-01-19 Thread Christian Vest Hansen
Excellent! The getScrollableTracksViewportWidth() trick did it :) On Mon, Jan 19, 2009 at 3:26 PM, MikeM wrote: > > This might be helpful: > > http://os-lists.sun.com/thread.jspa?messageID=457986 > > > -- Venlig hilsen / Kind regards,

JScrollPane + JTextPane trouble.

2009-01-18 Thread Christian Vest Hansen
tjure/blob/b184f842686861a3b4a947a24ea92a610edd8b46/textjure.clj#L318 [3]: http://github.com/karmazilla/textjure/blob/b184f842686861a3b4a947a24ea92a610edd8b46/textjure.clj#L627 -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this message becau

Re: Mysterious performance anomalies

2009-01-16 Thread Christian Vest Hansen
> user> (first (time (loop [i (int 0)] (if (< i (int 6000)) (recur > (inc i)) [i] > "Elapsed time: 8576.649 msecs" > 6000 > > user> (time (loop [i (int 0)] (if (< i (int 6000)) (recur (inc i)) > [i]))) > "Elapsed time: 250.407 msecs&

Re: Synchronization Benchmarks

2009-01-16 Thread Christian Vest Hansen
2. Optimism + MVCC + persistence fall down when faced with a majority of > writes. (see the 100% write case in the writes graph.) > > Thanks, > Stu > > > On Thu, Jan 15, 2009 at 2:52 PM, Christian Vest Hansen > wrote: >> >> On Thu, Jan 15, 2009 at 8:47 PM, Christ

  1   2   >