Re: Loading a huge graph

2012-04-13 Thread bOR_
I have this option in my project.clj file, which does the trick if you are developing from emacs+swank+clojure-jack-in, and using large networks :jvm-opts [-Xmx4000m] And yes, one of the things to do when working with the jvm is learning how to use jconsole or visualvm to see why your

Re: mini mud-client for within emacs-swank

2012-02-17 Thread bOR_
Solved it. I had to replace the (print (take.. statement with the following: (doseq [c (remove #{\return} (map char (take-while #(not= % -1) (repeatedly #(.read (.getInputStream avendar))] (print c)) -- You received this message because you are subscribed to the Google Groups Clojure

mini mud-client for within emacs-swank

2012-02-16 Thread bOR_
Started playing with getting an within emacs clojure-based mud client, but puzzling a bit with parsing the incoming stream. The below works (for emacs+swank-clojure 1.4.0), but puts a space between every character. When I try to solve that (for example by swapping (print ... with (print (apply

clojure.core/max and NaN

2011-10-30 Thread bOR_
Hi all, Ran into something unexpected with max. user (sd-age-female 13) [10 NaN 0.746555245613119]

summing shorts vs summing ints

2011-06-04 Thread bOR_
Hi all, Noticed in Clojure 1.3-Alpha8 that there is a large difference in speed when adding two Short/TYPE arrays rather than two Integer/TYPE java arrays. Is that something related to clojure, my code, or just a CPU-related thing when it comes to summing. I'd like to save some memory by using

aset and shorts, aset vs aset-int

2011-05-29 Thread bOR_
Is there something obvious I am missing when aset in clojure 1.3-alpha8 won't work for shorts. aset-shorts does work, but way slower than I'd expect. There is also an order of magnitude difference in speed between aset ^ints and aset-int. I've looked at the source of amap (which was the first

Re: Matrix operation (a la numpy)

2011-05-29 Thread bOR_
Incanter does. Works fine, but I'm not sure how fast it is. -- 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

Re: aset and shorts, aset vs aset-int

2011-05-29 Thread bOR_
Thanks for the help, appreciated! It helped me figuring out where exactly things go haywire. This works: user (let [^ints as (make-array Integer/TYPE 10)] (aset as 0 (+ (aget as 1) (aget as 2

Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread bOR_
user (time (dotimes [i 10] (contribmath-ceil (rand Elapsed time: 4500.530303 msecs

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread bOR_
Because I did not remember Math/ceil :-). Point is, is there any consensus on what math library to use? Is (Math/... in general the fastest? -- 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: Java Agent Based Modeling Systems and Clojure

2011-02-23 Thread bOR_
I've been programming agent-based models in clojure for the last 2 years, and I've found that having a vector full of refs works fine. If two individuals interact (in my case, form a relationship), I use dosync and alter in a parallel environment to ensure that noone is starting more

Re: Oddity: PersistentTreeMap does not implement SortedMap

2011-01-09 Thread bOR_
(type (sorted-map-by 3 1 2 4 5 3)) clojure.lang.PersistentTreeMap user (type (select-keys (sorted-map-by 3 1

bug or misunderstanding intern?

2010-10-27 Thread bOR_
Hi all. This got me puzzled. Intern has trouble with symbols containing periods? user *clojure- version* {:major 1, :minor 2, :incremental 0, :qualifier } user (intern *ns* (symbol orig-0.5) 3) #'user/ orig-0.5 user orig-0.5 ; Evaluation aborted. [Thrown class

Re: take-while2?

2010-08-08 Thread bOR_
Nice! Ran into a blogpost yesterday of someone calculating 'e', and I was fiddling around after reading that with take-while looking for a way to do exactly this. user (time (/ (apply + (repeatedly 1000 (fn [] (inc (count (take- while-acc + #( % 1) (repeatedly #(rand 1000.0))

small gotcha with the helpfile of empty? / seq?

2010-08-03 Thread bOR_
Occasionally, I want to map a collection of seqs to their is-empty or is-not-empty status (e.g. true / false). And the helpfile of empty? puts me on the wrong leg occasionally. clojure.core/ empty? ([coll]) Returns true if coll has no items - same as (not (seq coll)). Please use the idiom

Re: Idea for personal Clojure project

2010-07-29 Thread bOR_
I think there were some talks about this on the conference I went to recently. Keywords might be natural language processing. Linked is the abstracts of the conference, which you might find some use in. http://www.insna.org/PDF/Sunbelt/4_ProgramPDF.pdf One alternative I briefly considered is to

generating a list of random numbers

2010-07-28 Thread bOR_
Hi all, I have the nagging feeling that I'm missing a simple solution. Say I want a list of a 100 rand-int 10 numbers. Currently, I create that by doing (map (fn [_] (rand-int 10)) (range 100)). Is there an easier way? -- You received this message because you are subscribed to the Google Groups

Re: generating a list of random numbers

2010-07-28 Thread bOR_
Ah. A sneaky difference between repeat and repeatedly there then :). Good to remember! On Jul 28, 9:35 am, Laurent PETIT laurent.pe...@gmail.com wrote: Hi, You could do: (repeatedly 100 #(rand-int 10)) HTH, -- Laurent 2010/7/28 bOR_ boris.sch...@gmail.com Hi all, I have

todays project.

2010-07-28 Thread bOR_
Hi all, Todays' project involved modelling what happens if an infected flea enters a burrow of gerbils. The biology is as follows: fleas feed daily on gerbils, and drop off after every meal, only to climb on one of the gerbils again. There is a small chance that a feeding flee infects a gerbil

Clojure-based scientific paper!

2010-07-14 Thread bOR_
Hi all, My first paper with results based on a clojure-build agent-based model is in press! If you have academic access to the journal, you can peek at it here: http://dx.doi.org/10.1016/j.epidem.2010.05.003 , but otherwise it is also available on mendeley:

Re: Does/will clojure run on ARM based smartbook?

2010-03-01 Thread bOR_
Will test once I get my pandora (openpandora.org) :-). On Mar 1, 9:07 am, Alex Osborne a...@meshy.org wrote: reynard atsan...@gmail.com writes: Anyone has first hand experience?  Thanks. I tried it on a cheapo 200Mhz ARM926EJ-S based NAS (WD MyBook World) under JamVM [1] and it runs but

Re: Why recur?

2010-01-17 Thread bOR_
Ugly is in the eye of the beholder :), but anyway, I got curious and dug up some info on scala's recursion: http://blog.richdougherty.com/2009/04/tail-calls-tailrec-and-trampolines.html On Jan 17, 7:39 am, itsnotvalid itsnotva...@gmail.com wrote: Just started learning Clojure a day ago with

Re: and, why does lein try to put clojure.jar on the BOOTCLASSPATH?

2010-01-05 Thread bOR_
Not sure, but wasn't that so that you don't need to compile your project against the same version of clojure as that leiningen was compiled to? On Jan 5, 5:55 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: ...when it is also buried in the leiningen standalone? Stu -- You received this

Re: Renaming 1.1.0-alpha-SNAPSHOT is causing problems with projects on Clojars

2009-12-22 Thread bOR_
hostproxy.somewhere.com/host port8080/port usernameproxyuser/username passwordsomepassword/password nonProxyHostswww.google.com|*.somewhere.com/nonProxyHosts /proxy /proxies . . /settings On Dec 11, 9:31 am, bOR_ boris.sch...@gmail.com wrote: Not sure what

Re: Funding Clojure 2010

2009-12-15 Thread bOR_
I had some trouble trying to explain my university to pay for free software as well. They will much rather pay for a mathematica licence. How about just a printed install CD for clojure. Utterly useless, but very tangible :). On Dec 15, 11:20 pm, Mike Hogye stacktra...@gmail.com wrote: Maybe

Re: Funding Clojure 2010

2009-12-14 Thread bOR_
About the donations. Is there any way we can see how you are doing donation-wise, compared to the target for personal donations you would like to reach? I think people find it easier to donate, if they have insight in how much you've received this month / this calendar year compared to your

Re: Renaming 1.1.0-alpha-SNAPSHOT is causing problems with projects on Clojars

2009-12-11 Thread bOR_
Not sure what was causing it, but leiningen / clojars couldn't get its deps yesterday. I thought it was caused by clojure and clojure-contrib no longer being on clojars.org, but maybe the renaming on build.clojure.org has something to do with it. On Dec 11, 6:18 am, Phil Hagelberg p...@hagelb.org

How to internally refer to other keys in a hashmap?

2009-12-09 Thread bOR_
Hi all, I want to make a hash-map where the value of one key depends on the values of other keys in the hash-map. Is there a way to do this, without needing an external reference to the hash-map? {:a 1 :b 2 :c #(+ :a :b)} Similarly, when filling a struct, I often want to refer to the bits I

Re: How to internally refer to other keys in a hashmap?

2009-12-09 Thread bOR_
alex.tagg...@gmail.com wrote: On Dec 9, 10:20 am, bOR_ boris.sch...@gmail.com wrote: Hi all, I want to make a hash-map where the value of one key depends on the values of other keys in the hash-map. Is there a way to do this, without needing an external reference to the hash-map

Re: How to internally refer to other keys in a hashmap?

2009-12-09 Thread bOR_
. On Dec 9, 8:40 pm, ataggart alex.tagg...@gmail.com wrote: On Dec 9, 10:20 am, bOR_ boris.sch...@gmail.com wrote: Hi all, I want to make a hash-map where the value of one key depends on the values of other keys in the hash-map. Is there a way to do this, without needing an external

Re: How to internally refer to other keys in a hashmap?

2009-12-09 Thread bOR_
Thanks. That is a good solution. There's also some work in dev being done on trans and trans* functions, as Sean Devlin pointed out. see: explanation of trans: http://groups.google.com/group/clojure-dev/browse_thread/thread/4b20e40d83095c67# Chouser commenting on trans:

Re: combining vimclojure, classpaths and leiningen

2009-12-03 Thread bOR_
Second question: how do I access documentation of a lein nailgun plugin? I know how to start it, but to stop it, I now just kill its pid. On Dec 2, 2:16 pm, bOR_ boris.sch...@gmail.com wrote: Q: I noticed that the leinnailgunruns as java -client. Being used to seeing -server everywhere, I

Re: combining vimclojure, classpaths and leiningen

2009-12-03 Thread bOR_
On Dec 3, 3:19 pm, bOR_ boris.sch...@gmail.com wrote: Second question: how do I access documentation of a lein nailgun plugin? I know how to start it, but to stop it, I now just kill its pid. Answered that by just vimming the lein-nailgun.jar file :). Next bit of trivia: There are currently

Re: combining vimclojure, classpaths and leiningen

2009-12-03 Thread bOR_
-0.7.1.pom but these don't seem to have a negative effect. On Dec 3, 3:19 pm, bOR_ boris.sch...@gmail.com wrote: Second question: how do I access documentation of a lein nailgun plugin? I know how to start it, but to stop it, I now just kill its pid. On Dec 2, 2:16 pm, bOR_ boris.sch

clojars and licences

2009-12-01 Thread bOR_
How in clojars do I attach a licence to the jar? I'm about to redistribute a BSD-licensed jarfile to clojars, but I'm not sure how I can make sure that the licence also gets redistributed. Are these things embedded in jar files by default? (the jar in question is automaton-1.11.jar) -- You

combining vimclojure, classpaths and leiningen

2009-11-27 Thread bOR_
Hi All, Is there any obvious way by which you can combine vimclojure and leiningen easily? If I use leiningen to download and arrange all my jar dependencies, they all end up in a ~/.m2/repositories/... etc directory, and in the /lib directory of whatever project. I think I cannot escape

Re: combining vimclojure, classpaths and leiningen

2009-11-27 Thread bOR_
using vimclojures' nailgun, I would have a line like this added to my .vimrc file. Can I still use that? let vimclojure#NailgunClient = /home/boris/opt/vimclojure/ng On Nov 27, 1:43 pm, Alex Osborne a...@meshy.org wrote: bOR_ boris.sch...@gmail.com writes: I think I cannot escape spelling

Re: combining vimclojure, classpaths and leiningen

2009-11-27 Thread bOR_
Hmm. Need a bit of handholding (can't find any documentation yet on this either.) There is a vimclojure coming with adding [[lein-nailgun/lein-nailgun 0.1.0]] to dev-dependencies (org/clojars/gilbert1/vimclojure). Do I add that to the dependencies as well? On Nov 27, 4:16 pm, bOR_ boris.sch

Re: combining vimclojure, classpaths and leiningen

2009-11-27 Thread bOR_
Got it working. The only thing I need next to leiningen to set up my working environment + project is the ng client from vimclojure, the correct lines in .vimrc and the vimclojure vim plugin parts (in .vim) Good! On Nov 27, 4:16 pm, bOR_ boris.sch...@gmail.com wrote: using vimclojures' nailgun

Re: Clojure User Survey, preparation for 1.1

2009-11-24 Thread bOR_
Can we get an option 'leiningen' at how do you get clojure? On Nov 24, 8:27 am, David Brown cloj...@davidb.org wrote: On Mon, Nov 23, 2009 at 09:55:46PM +, the.stuart.sie...@gmail.com wrote: Since the form only lets me answer one answer for each, but reality is much more complicated.

Re: leiningen - a Clojure build tool

2009-11-22 Thread bOR_
Leiningen is very easy to pronounce for the dutch :). We've the word Leningen anyway (Loans), and ei is a common vowel combination in dutch as well (I actually grew up in Leiden). Ontopic: I might be missing something, but is there an obvious way to do something like lein src/chlamydia.clj when

Re: leiningen - a Clojure build tool

2009-11-22 Thread bOR_
Eden, on evolution of the human immune system in response to pathogens), and there will be a third one starting in january on disease spread percolating through a network of gerbil burrows in Kazachstan (unnamed as of yet). On Nov 22, 10:18 am, ajuc aju...@gmail.com wrote: On 22 Lis, 13:09, bOR_

Re: leiningen - a Clojure build tool

2009-11-22 Thread bOR_
. It being a BSD licence, it allows redistribution. Can I just upload it to Clojars? On Nov 22, 10:54 am, bOR_ boris.sch...@gmail.com wrote: I'm currently modeling the spread and prevalence of chlamydia over a dynamic sexual contact network. Hence the name :-). Plotting the graphs etc is done

repeatedly forcing the evaluation of a lazy seq

2009-11-20 Thread bOR_
Hi all, Just ran into a small gotcha: I had an atom which contained a lazyseq (e.g. (filter males world)). Later on I would be repeatedly calling random elements from this atom, using clojure contrib rand-elt. That was surprisingly slow. I figured out that count was the culprit. Apparently, the

Scoopler whispers that clojure is making a nice impression

2009-06-03 Thread bOR_
Having fun watching scoopler these days, and seeing people twitter and whatnot about clojure at javaone. http://www.scoopler.com/search/#clojure --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Clojure at JavaOne

2009-05-18 Thread bOR_
Well, the ant demo does show java interoperability (the whole graphics bit). You could start with a world with the empty square, and a filled square, start with one type of ant that is just lugging the food from the filled to the empty square. This shows off agents. Have four numbers being

Re: Clojure at JavaOne

2009-05-18 Thread bOR_
Well, the ant demo does show java interoperability (the whole graphics bit). You could start with a world with the empty square, and a filled square, start with one type of ant that is just lugging the food from the filled to the empty square. This shows off agents. Have four numbers being

Re: Clojure at JavaOne

2009-05-18 Thread bOR_
Well, the ant demo does show java interoperability (the whole graphics bit). You could start with a world with the empty square, and a filled square, start with one type of ant that is just lugging the food from the filled to the empty square. This shows off agents. Have four numbers being

Re: The Santa Claus Problem

2009-05-06 Thread bOR_
When writing this code, I found the watcher system a bit clunky to use, and a bit too heavyweight for what I needed.  Sometimes, within a dosync block, you want to trigger some sort of side effect once the current transaction is committed.  To make this easy, I would very much like to see

Re: The Santa Claus Problem

2009-05-06 Thread bOR_
Why isn't this enough for the problem? Elves and deer are entering Santa's frontdoor 1 at a time, when there is three elves in the room, santa instantly deals with them (resetting the number of elves to 0), when there is 9 deer in the room, santa goes sleighing. (def santa (agent {:elves 0 :deer

Re: The Santa Claus Problem

2009-05-06 Thread bOR_
at minimum? I see people assuming that santa needs time to fix whatever the 3 elves are bringing to him, for example. On May 6, 10:32 am, bOR_ boris.sch...@gmail.com wrote: Why isn't this enough for the problem? Elves and deer are entering Santa's frontdoor 1 at a time, when there is three elves

difference between vimclojure and slime

2009-05-03 Thread bOR_
Hi Meikel, I've tried running / developing both in vimclojure and slime, and one difference I noticed is that if I manually start a function in the buffer, vimclojure won't show me any output until the function that is completed. Slime would do fine. I could start a (simulation) of 1 years,

Re: Design advice/patterns for Clojure concurrency

2009-04-17 Thread bOR_
I've written individual-based models using agents, and using refs. Currently my decision tree is 'agents, if there are no events which need to be atomically synchronized between individuals**'. In both cases I had a vector full of individuals called 'world'. When the individuals were agents, I

Re: Design advice/patterns for Clojure concurrency

2009-04-17 Thread bOR_
bigfun (comp retire-host slowdown-host infect-hosts naturalrecovery- host pair-host) proc1 (future (doseq [i (subvec world 0 2499)] (bigfun i))) proc2 (future (doseq [i (subvec world 2500 4999)] (bigfun i))) proc3 (future (doseq [i (subvec world 5000 7499)] (bigfun i))) proc4 (future

Re: howto update with a constant when a function is expected?

2009-04-16 Thread bOR_
clojure.lang.Ref...@1758cd1) On Apr 16, 11:54 am, David Sletten da...@bosatsu.net wrote: On Apr 15, 2009, at 11:30 PM, bOR_ wrote: Hi all, some functions (like map, or update-in) expect a function to be applied on a value. In the case where the update I want is merely a constant

Re: VimClojure 2.1.0 released

2009-04-16 Thread bOR_
Worked with the 2.1.0 version today. Impressions so far are more stable than the developmental version of a week ago (no hanging repls), a feeling intense gratitude for the ,ct command. Furthermore a bit of collision with the default keybindings when I try to browse the history with ctrl-p and

Re: A clojure server

2009-04-04 Thread bOR_
Has anyone tried to combine clojure-server and vimclojure yet? I'm still hopping IDEs to see which system I like best, and vim was next on the list :). On Apr 4, 9:56 pm, Konrad Hinsen konrad.hin...@laposte.net wrote: On 04.04.2009, at 19:45, christ...@mvonessen.de wrote: I'm not sure I

Re: Parallel Game of Life

2009-03-16 Thread bOR_
Nice! A few more days of work and I've time to play with these kind of things again. Here are some comments, based on your description. As game of life is a cellular automata, you do not need any blocking at all, so you could use agents, rather than refs. It does become an asynchronous CA then,

Re: Parallel Game of Life

2009-03-16 Thread bOR_
I'm not very used to concurrent programming, so I have a few questions you may find naïve, but well, let's just pretend they're interesting  ... : Learning here as well :). It seems to me that the game of life works in increments of its world. So I don't see at first what can be gained by

Re: Speed issues vs. Python

2009-03-12 Thread bOR_
Setting that one (set! *warn-on-reflection* true) Helped a lot in my simulation model to find out where clojure/java were having trouble. It pointed out that one of my main functions was causing trouble, and could do with a bit of typehinting. (defn #^Short find-all-epi turns the rx and

Re: New mod code is broken

2009-03-12 Thread bOR_
Mod seems to have broken again (mod 9 -3) gives -3 (map #(mod % 3) (range -10 10)) (2 3 1 2 3 1 2 3 1 2 0 1 2 0 1 2 0 1 2 0) svn 1372. Chouser wrote: On Sat, Feb 14, 2009 at 12:45 AM, Stephen C. Gilardi squee...@mac.com wrote: The new mod isn't working properly though:

Re: New mod code is broken

2009-03-12 Thread bOR_
-clojure runs ok too. Frantisek On Mar 12, 10:30 am, bOR_ boris.sch...@gmail.com wrote: Mod seems to have broken again (mod 9 -3)  gives -3 (map #(mod % 3) (range -10 10)) (2 3 1 2 3 1 2 3 1 2 0 1 2 0 1 2 0 1 2 0) svn 1372. Chouser wrote: On Sat, Feb 14, 2009 at 12:45 AM

Re: What is Clojure NOT good for?

2009-03-10 Thread bOR_
Also, how do you think this increase in required effort grows? What if we are talking about a +10.000-line Clojure program? Now add schedule pressure, deadlines and the cost of missed oppotunities and you will find that many companies sees the introduction of a new programming language -

Re: What is Clojure NOT good for?

2009-03-09 Thread bOR_
I'm not from the software engineers field, but how difficult is it for some non-lisp, but java-savvy software writer to pick up a 600-line clojure program and learn to understand it? I mean, everyone in this forum managed to learn clojure to some degree without too much trouble.. including me. If

Re: fitness

2009-03-05 Thread bOR_
Didn't know of the existence of delay yet. Thanks for pointing that out :). Is there a reason why delay needs a force to be calculated?    {:fitness (delay (compute-my-fitness))} And when you access the value use force.    (- my-thing :fitness force)

Re: fitness

2009-03-04 Thread bOR_
If you use hash-maps, or a struct-map as the basis of your individual, you can just make a key 'fitness', and store the once-calculated fitness in there. I'm not sure how, but it might be possible that at the creation of your animals, you assign the key 'fitness' a basic function that upon being

Re: doc suggestion for future function

2009-02-28 Thread bOR_
year with 1) (concurrent: (break and create bidirectional links between refs)) (wait for year to finish) ) I'll try your suggestion and see if it is workable. Thanks! On Feb 28, 10:35 am, Christophe Grand christo...@cgrand.net wrote: bOR_ a écrit : can I call something like (apply await

Re: how to get concurrent - model design question

2009-02-26 Thread bOR_
Thanks for the reply Timothy! I'll look into the future things :). The main reason for using refs was because I am constructing a contact network between different refs (a graph, consisting of nodes and edges.), which changes over time (all the short-term and long-term relations between hosts

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread bOR_
I'm trying to rewrite the wf.bat to a linux version, but I was a bit puzzled what all the ;%~dp0 's mean. Apparently the bash version of it is ${0%/*} java -cp ~/src/clojure/clojure.jar;${0%/*}clj;${0%/*}java - Dnet.sourceforge.waterfront.plugins=${0%/*}clj/net/sourceforge/

Re: Should (pop nil) throw an exception?

2009-02-22 Thread bOR_
Perhaps some context help. Why would you want to continue popping an empty collection? If you are in a loop, when will you stop popping it? Perhaps there is a more logical idiom to use for the case you run into pop nil exceptions (doseq?) On Feb 22, 5:18 pm, Frantisek Sodomka fsodo...@gmail.com

Nice Conversation between hardware lisp and hardware java architects

2009-02-22 Thread bOR_
Here is an interesting read, for those of you that (also) occasionally daydream about having a hardware jvm to play with ;). From Cliff Click Jr.’s Blog's Blog I had an email conversation between myself, David Moon Daniel Weinreb. For the younger readers: David Moon is one of the original

Re: where is contrib?

2009-02-21 Thread bOR_
Note that clojure just changed the lazy branch to be the main version of clojure, so right now clojure-contrib and the latest svn do not play nicely yet. I belief there is a old version of clojure-contrib available and probably also for clojure-main. On Feb 21, 1:15 pm, Emeka

Optimizations

2009-02-21 Thread bOR_
Hi all. Recently started to optimize two models written in clojure, and I could use some tips from you guys. I first enabled the set reflection-warning thing, and removed reflections in the inner loop of my program. That already helped a lot, speeding up the whole thing to about 40% of its

Re: Trojan horse in our Files section

2009-02-14 Thread bOR_
Gone now. Rich but was it written in clojure? =). --~--~-~--~~~---~--~~ 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 To unsubscribe from this group,

Re: How to build tree with nodes that 'point' to each other?

2009-02-12 Thread bOR_
Not a guru here (far from!), but don't get too thrown off by what the word 'immutable' means in your head. In Clojure 'immutable' refers more to how things work in the belly of the beast.. Clojure has 4 constructs (vars, refs, agents and atoms) to faciliate mutating things. Probably the best

Re: My SLIME installation diary

2009-02-11 Thread bOR_
(push /home/boris/.emacs.d load-path) This is actually already on the load-path by default; no need to add it. Standard load-path on ubuntu didn't include ~/.emacs.d for me. Not sure why not. load-path is a variable defined in `C source code'. Its value is (/etc/emacs-snapshot /etc/emacs

Re: My SLIME installation diary

2009-02-11 Thread bOR_
Success! Thank you. Success lasted till I tried to restart emacs. Here is where I am stuck again: 1. It can't find M-x slime clojure-slime-config doesn't seem to be an option either to manually run with M-x clojuretab The solution seems to be to take the functions in clojure-slime-config and

Re: My SLIME installation diary

2009-02-11 Thread bOR_
Spotted an error in clojure-mode.el. Swank-clojure-extra-classpaths needs to be changed from this to the following, in order for people to be able to use contrib. (setq swank-clojure-jar-path (concat clojure-src-root /clojure/ clojure.jar) swank-clojure-extra-classpaths (list

Re: My SLIME installation diary

2009-02-09 Thread bOR_
HI Phil. Tried the clojure-install on a fairly clean ubuntu / emacs23 Here is what went and what went wrong: Had to use a different .emacs. Just autoload and add-to-list didn't seem to load clojure-mode.el. Took a moment to figure out that I had to set clojure-src-root as well, as that isn't

Re: My SLIME installation diary

2009-02-09 Thread bOR_
Slowly wrestling myself through getting to know emacs. Ok. autoload works fine. Didn't realize I have to open emacs with a .clj file for the clojure-mode to load. Now looking where this 'Cannot open load file:slime-repl' is coming from. On Feb 9, 10:36 am, bOR_ boris.sch...@gmail.com wrote: HI

Re: My SLIME installation diary

2009-02-09 Thread bOR_
Thanks for all the explanations. I'll try again this wednesday! --~--~-~--~~~---~--~~ 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 To unsubscribe from this

Re: My SLIME installation diary

2009-02-04 Thread bOR_
As we never can have enough examples, and this one was about the simplest that just worked on Ubuntu, I'll paste my variant of it here. It is slightly different because I'm behind a proxy, and thus my git calls are somewhat different, and I got my slime from a git repository rather than a cvs

Re: Amsterdam.clj

2009-02-03 Thread bOR_
Using Clojure at the RIVM in bilthoven, and at University of Utrecht. Previous projects of my phd were in ruby, last one is in clojure. Postdoc is in Clojure. Amsterdam is closeby. I've about no free time till end of march (finishing thesis!), but might find it fun to join in April. On Feb

Re: Documenting Clojure Code

2009-01-30 Thread bOR_
Related. (defn myfunc a nice description here [coll] (apply + coll)) but no (def myvar ; cant do a nice description here, even though hash-maps can stand in for functions. (hash-map :a 1 :b 3)) On Jan 30, 10:42 pm, Kevin Albrecht onlya...@gmail.com wrote: How are people generating

Re: functional lazy shuffle

2009-01-29 Thread bOR_
Hmm. (time isn't that reliable here. my lazy-shuffle might be quite slow after all. On Jan 26, 10:46 pm, bOR_ boris.sch...@gmail.com wrote: In addition to the functional shuffle thread (can't seem to post to that one anymore, might be too old?), I've written alazy shuffle. Not sure

Re: Clojure for Games/Simluation/Art (Optimization in Clojure)

2009-01-28 Thread bOR_
There is many ways in which you can improve the algorithm. I have seen flocks of 10,000 birds being rendered real-time on a laptop by Hanno Hildenbrandt, theoretical biology Utrecht. http://www.rug.nl/biologie/onderzoek/onderzoekgroepen/theoreticalbiology/peoplePages/hannoPage Also, Craig

Re: Clojure for Games/Simluation/Art (Optimization in Clojure)

2009-01-28 Thread bOR_
Errata: Hanno works in Groningen. As I work in Utrecht, I sort of automatically appended 'Utrecht' after 'Theoretical Biology'. Ontopic: There is a thing called Hilbert curves that you could use. http://en.wikipedia.org/wiki/Hilbert_curve You could define a 1d array, and translate the bird 2d

Re: import doesn't work when jar was loaded with add-classpath ?

2009-01-26 Thread bOR_
Thanks for that solution. Ran into the same problem as well, and right now I don't want to solve it, but just finish something else. On Dec 13 2008, 11:21 pm, Eric Sessoms nubga...@gmail.com wrote: Did you ever get this resolved?  I just had the same thing start happening to me today, after

functional lazy shuffle

2009-01-26 Thread bOR_
In addition to the functional shuffle thread (can't seem to post to that one anymore, might be too old?), I've written a lazy shuffle. Not sure if it is the best way to write it, but I needed a lazy shuffle primarily because I wanted to randomly pair a few agents from a large vector of agents

Dauphin: mona lisa genetic algorithm in clojure

2009-01-26 Thread bOR_
Hope this isn't a double-post, but here is a nice example of a rewrite of some reddit post on a genetic algorithm for generating the mona lisa in clojure by Yann N. Dauphin http://npcontemplation.blogspot.com/2009/01/clojure-genetic-mona-lisa-problem-in.html

Re: Dauphin: mona lisa genetic algorithm in clojure

2009-01-26 Thread bOR_
According to one of the posts beneath the log, the issue has been fixed in the latests svns. I have no clue what the technical problem was in clojure's source. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure

odd error with filter

2009-01-26 Thread bOR_
Here is the error. (filter #(:born \...@%) world) java.lang.IllegalArgumentException: Start must be less than or equal to end: 2147483647, -2147483648 It is probably something I have done wrong in the code (the simulation crashed with a java.lang.RuntimeException: Agent has errors

Re: running Gorilla

2009-01-21 Thread bOR_
Just for posterity: It took me a while to realize that my fresh vim didn't have a maplocalleader defined. Had to add it to the .vimrc so that chimp (and I guess gorilla as well) would actually have some keybindings associated with it. let maplocalleader = , Gracias! On Dec 19 2008, 8:26 am,

Re: Basic about setting upp Clojure and editor enviroment

2009-01-21 Thread bOR_
If you are running windows, clojurebox is the easiest way to set things up. On linux, this guide might help: http://riddell.us/clojure/ On Jan 21, 3:05 pm, anderspe anders.u.pers...@gmail.com wrote: Hello, i am waiting for the book Programming Clojure by Stuart Halloway, I have set upp a

odd error with a dosync (not (empty? @someref))

2009-01-18 Thread bOR_
Hi all. I'm running into an odd error that occasionally pops up. Here is the ugly script and the two functions, one for which it does, and one for which it does not pop up. Anyone has a clue? (defn death [host] (dosync (if (not (empty? @host)) nil))) (defn death [host] (dosync

Re: odd error with a dosync (not (empty? @someref))

2009-01-18 Thread bOR_
Thanks for the pointers both. What still riddles me is why the above script with the first formula (with the deref problem) doesn't always cause a problem, but maybe one in every 5 times I run it. @Timothy - double thanks for your clarifications. I am changing my program from a ref-based to a

Re: when performance matters

2009-01-15 Thread bOR_
I remember from 5 years ago that a collegue of mine improved a diffusion algorithm for a successor of me by some heavy algorithms. My own algorithm was a simple loop-over-the- array once, dump-a-fraction- of-each-cell-into-spatially-neighbouring-cells-in-the-new-array, and sum what is in every

Re: question about understanding/exploring agents

2009-01-15 Thread bOR_
...@mac.com wrote: On Jan 15, 2009, at 2:57 AM, bOR_ wrote: That is, if I understand blocking correctly. Currently assuming that blocking only happens when two things would like to write the same ref? Blocking in this case refers to this definition: http://en.wikipedia.org/wiki/Blocking_

Re: Clojure Box, alpha

2009-01-15 Thread bOR_
Sort of got distracted and stopped paying attention to getting that to run. I'll report when I get to it and learn more :). On Jan 5, 11:43 pm, Shawn Hoover shawn.hoo...@gmail.com wrote: On Mon, Jan 5, 2009 at 4:24 PM, bOR_ boris.sch...@gmail.com wrote: Just downloaded clojurebox

question about understanding/exploring agents

2009-01-14 Thread bOR_
Hi all. I am trying to figure out what the effect of the agent-function is on the efficiency of concurrency. Here is something I do not really understand. I've a fibonacci function and a simple multiplication, both are wrapped in their respective dotimes 100k loop. However, on this 4core

  1   2   >