Re: loneclojurian at ICFP programming contest

2009-06-30 Thread Nicolas Oury
Hello, That is an interesting blog post. I am not a clojure specialist, but if I was to try to change your program to get towards C-like speed (or better), I would : - Use java arrays for memory. You don't seem to use the vectors in a persistent way, and there does not seem to be easy parallelizat

Re: ants.clj and render thread starvation

2009-06-30 Thread Daniel Lyons
On Jun 30, 2009, at 11:50 PM, Krukow wrote: > I like the pragmatics of :min-history, and I believe it would be > sufficient for many scenarios. However, I suspect we are now moving > closer to the situation that Cliff Click was predicting [1] where as a > programmer you need more precise knowledg

Re: Problem with clojure code on .net.

2009-06-30 Thread Daniel Lyons
Manoj, In case this helps, I've had a bit longer to dwell on this problem and I have a couple of ideas. I do think this raises the general question of, are Clojure .NET and Clojure Java two different languages or two implementations of the same language? Normally in a situation like this

Re: ants.clj and render thread starvation

2009-06-30 Thread Krukow
On Jun 30, 6:01 pm, Rich Hickey wrote: > MVCC history in Clojure's STM is dynamic, created by need. There is no > read tracking, and more important for this case, no transaction > tracking. So, if a read transaction is unable to satisfy its snapshot > view from history, it will flag the offendin

Re: loneclojurian at ICFP programming contest

2009-06-30 Thread Jeff Foster
I looked at the ICFP Contest too. I didn't even get as far as solving the first problem, but I did implement a virtual machine that appeared to work. I really enjoyed the coding, though I didn't get very far with the physics! I tried a couple of approaches but settling on the functional side.

Re: Problem with clojure code on .net.

2009-06-30 Thread Daniel Lyons
Manoj, On Jun 30, 2009, at 8:55 PM, mmwaikar wrote: > I am learning clojure these days, but on .Net. I have the following > code - > > (import '(System.IO Path Directory File DirectoryNotFoundException)) > > (defn starts-with-hmorx [name] > (if (or (= (.ToUpper (.ToString name)) "H") >

Problem with clojure code on .net.

2009-06-30 Thread mmwaikar
Hi, I am learning clojure these days, but on .Net. I have the following code - (import '(System.IO Path Directory File DirectoryNotFoundException)) (defn starts-with-hmorx [name] (if (or (= (.ToUpper (.ToString name)) "H") (= (.ToUpper (.ToString name)) "M")

Re: subvec drops metadata

2009-06-30 Thread Glen Stampoultzis
I couldn't say whether it should or not but I've faced similar issues with attaching metadata to various collections. It becomes very easy to lose the metadata when you're dealing with collections since many high level functions tend to return new seqs. I found myself having to reappy the metadat

Re: loneclojurian at ICFP programming contest

2009-06-30 Thread fft1976
On Jun 30, 3:02 pm, igorrumiha wrote: > Greetings everyone, > > I didn't actually plan it but I ended up participating in the ICFP > programming contest (http://www.icfpcontest.org). This year the task > was to move satellites from one orbit to another, to meet with other > satellites etc. Quit

Re: send versus send-off

2009-06-30 Thread Stephen C. Gilardi
On Jun 30, 2009, at 5:30 PM, Kai wrote: From scheduling I know that there are CPU-bound and IO-bound processes. Perhaps send-off tends to hold off on yielding for longer durations since it expects frequent interrupts. If this is the case, I think it would be useful to elaborate on that in the d

NoClassDef Issue, possibly my fault with the classloaders

2009-06-30 Thread BerlinBrown
Pre Notes: I put most of the code for my unit testing here: http://groups.google.com/group/clojure/web/MostCodeIssue.java http://groups.google.com/group/clojure/web/NoClassDefIssue.zip http://clojure.googlegroups.com/web/MostCodeIssue.java?gsc=XGm71ws6-FUP8n2vUln2lQc9yyLJ This is t

loneclojurian at ICFP programming contest

2009-06-30 Thread igorrumiha
Greetings everyone, I didn't actually plan it but I ended up participating in the ICFP programming contest (http://www.icfpcontest.org). This year the task was to move satellites from one orbit to another, to meet with other satellites etc. Quite interesting, and to start it all you need to imple

Re: send versus send-off

2009-06-30 Thread Meikel Brandmeyer
Hi, Am 30.06.2009 um 23:30 schrieb Kai: Why is there a distinction between an action and a blocking action? What kind of concerns arise when you send a potentially blocking action to an agent and why is send-off better accommodated to deal with it? send serves the agent from a fixed ThreadPoo

Re: Interest in creating a NYC Clojure user group?

2009-06-30 Thread Andrew Stein
Count me in At Stuart's presentation to LispNYC, someone took down an email list for a proposed ClojureNYC group - if only I could remember who . --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To

send versus send-off

2009-06-30 Thread Kai
I can't imagine that this hasn't been asked before, so please direct this post to an appropriate link if you know of it. (send a f & args) Dispatch an action to an agent. Returns the agent immediately. Subsequently, in a thread from a thread pool, the state of the agent will be set to the value o

Re: Interest in creating a NYC Clojure user group?

2009-06-30 Thread Rich Hickey
On Tue, Jun 30, 2009 at 4:47 PM, Kai wrote: > > I would be interested in meeting in NYC. > Me too! Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@g

Re: Interest in creating a NYC Clojure user group?

2009-06-30 Thread Jonah Benton
Not sure if I could make it on a regular basis, but on a related note, those in NYC may be interested in: http://bits.blogs.nytimes.com/2009/06/29/new-york-city-starts-contest-for-big-apple-apps/?ref=technology Could be an interesting use case for clj + cloud resources On Thu, Jun 4, 2009 a

Re: Interest in creating a NYC Clojure user group?

2009-06-30 Thread Kai
I would be interested in meeting in NYC. On Jun 6, 11:38 am, "John D. Hume" wrote: > On Thu, Jun 4, 2009 at 12:09 PM, Eric Thorsen wrote: > > what kind of interest there might be in creating a Clojure user group > > in the NY metro area to meet up in Manhattan once a month to discuss > > all thi

Re: Displaying Clojure code on a Website

2009-06-30 Thread Kai
Hey Sam, I'm glad you were able to refactor the code, I had a fear that it was too unreadable. There were several other bugs in that version that you should know of: - First version didn't use StringBuilder, which accounted for very slow times. - Semicolons aren't handled correctly in code and c

subvec drops metadata

2009-06-30 Thread bayerf
The subject says all: Should subvec keep the parent vector's metadata (it currently doesn't) or not? Similar functions like conj, assoc, dissoc DO keep the metadata of the collection. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: clueless hash-map question

2009-06-30 Thread Raoul Duke
> -Mr. Not Yet With The Programme. thanks to all for the helpful replies. i might actually be 'getting it' now. (well, at least minimally :-) sincerely. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: Clojure for Scientific and other CPU-intensive Computing

2009-06-30 Thread Mark Engelberg
On Tue, Jun 30, 2009 at 12:29 AM, Konrad Hinsen wrote: > What is particularly nice about Clojure is that in most situations > you don't need to switch to Java for speed. You can optimize your > code by adding type hints and switching to low-level data structures > (unboxed ints and floats, arrays,

Re: Clojure for Scientific and other CPU-intensive Computing

2009-06-30 Thread Luc Prefontaine
On Tue, 2009-06-30 at 01:55 -0600, Daniel Lyons wrote: > > On Jun 29, 2009, at 12:41 PM, fft1976 wrote: > > > > > Based on the recent survey "What are people using Clojure for?", > > people are mostly using it for non-CPU-intensive work, like parsing, > > report generation, GUIs, "glue" code. >

Re: pprint

2009-06-30 Thread Tom Faulhaber
Hi Laurent, I think that pprint might be a good foundation for what you are doing, but there are a couple of issues that need to be dealt with first. First, pprint works directly on Clojure objects and not strings, so the code will need to be read first. Second, the Clojure reader is lossy - it

Re: ants.clj and render thread starvation

2009-06-30 Thread Rich Hickey
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 constantly interrupted >> by some pesky ant while attempting to sn

Re: ants.clj and render thread starvation

2009-06-30 Thread B Smith-Mannschott
On Tue, Jun 30, 2009 at 10:10, Daniel B Lucraft wrote: > > I didn't think it was possible for the render agent to be interrupted > like that. Isn't the point of the MVCC system that the render agent > will see a consistent view of the world as it was when the render > started? And that the ants ca

Re: Clojure only (in-memory) database / locking granularity

2009-06-30 Thread Chouser
On Tue, Jun 30, 2009 at 8:37 AM, Rowdy Rednose wrote: > > Would it be easy to implement an in-memory database in clojure that > allows concurrent access? > > It sounds pretty easy, as most of the features are already provided by > Clojure. I'm not sure though about the "locking granularity". > Of

pprint

2009-06-30 Thread Laurent PETIT
Hi all, I want to add source code formatting / auto-indenting to the clojure plugin for eclipse. I had asked other IDE plugin creators, and it seems that they leveraged the specifics of their respective platforms to do so. So I have nothing substantial to "steal from them" not requiring a fair a

Re: ants.clj and render thread starvation

2009-06-30 Thread John Newman
I think I remember running the ants.clj demo on my netbook and it running normally. I'll check again this evening. On Tue, Jun 30, 2009 at 12:40 PM, Daniel B Lucraft wrote: > > I didn't think it was possible for the render agent to be interrupted > like that. Isn't the point of the MVCC system

Re: Displaying Clojure code on a Website

2009-06-30 Thread Sam Griffith
Thanks for doing this. I think I fixed one bug so wanted to mention it. In your html-post- format function, you have a string that creates the first . It has a explicit style set to have a font-family: courier new and a font- size of 14px. I took those styles out so that the style sheet contro

Re: ants.clj and render thread starvation

2009-06-30 Thread Daniel B Lucraft
I didn't think it was possible for the render agent to be interrupted like that. Isn't the point of the MVCC system that the render agent will see a consistent view of the world as it was when the render started? And that the ants can continue modifying the world during the render's processing but

Clojure only (in-memory) database / locking granularity

2009-06-30 Thread Rowdy Rednose
Would it be easy to implement an in-memory database in clojure that allows concurrent access? It sounds pretty easy, as most of the features are already provided by Clojure. I'm not sure though about the "locking granularity". Of course you don't pessimistically lock in Clojure, but if you have a

Re: ClassNotFoundException turn up randomly at compilation

2009-06-30 Thread Michael Wood
2009/6/29 C. Florian Ebeling : > >>> I randomly get ClassNotFoundExceptions when I try to compile a file. >>> This is a paste from the repl: >>> >>> Clojure 1.0.0- >>> user=> (compile 'app.hello) >>> java.lang.RuntimeException: java.lang.ClassNotFoundException: >>> app.hello$exec__4 (NO_SOURCE_FIL

Re: ants.clj and render thread starvation

2009-06-30 Thread Krukow
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 constantly interrupted > by some pesky ant while attempting to snapshot the world, forcing the > render agent to automati

Re: Binary Tree

2009-06-30 Thread Emeka
(defn depth [tree] (if (nil? tree) 0 (+ 1 (max (depth (left tree)) (depth (right tree) This looks close to what I need. Let me see if I can't get my head around it. Regards, Emeka On Tue, Jun 30, 2009 at 8:28 AM, Daniel Lyons wrote: > > On Jun 30, 2009, at 1:05 AM, Emeka wrote: > >

Re: ANN: clj-forms - a wrapper DSL for JGoodies Forms

2009-06-30 Thread Nicolas Oury
On Tue, 2009-06-30 at 13:10 +0200, Meikel Brandmeyer wrote: > I'm not sure agents are the right idea here. The forms > are used in dialogs. So when the dialog closes I need > the result immediately. So updating the IRef needs to > be synchronous. agents cannot assure that. > Then it could be gre

Re: ANN: clj-forms - a wrapper DSL for JGoodies Forms

2009-06-30 Thread Meikel Brandmeyer
Hi, Am 30.06.2009 um 11:57 schrieb Nicolas Oury: It seems a very nice idea. I would suggest the use of agents, for the states, rather than atom. Especially, the possibility to have watchers seems good. I'm not sure agents are the right idea here. The forms are used in dialogs. So when the dia

Re: ANN: clj-forms - a wrapper DSL for JGoodies Forms

2009-06-30 Thread Meikel Brandmeyer
Hi, Am 30.06.2009 um 11:32 schrieb Laurent PETIT: Yes, what I have in mind is that, in some point in time, parts of clojuredev (ouch, still not decided on a new name :) will be implemented in clojure, and so I'll have to somewhat create the same kind of dsl for swt based "forms". Ah! I see th

Re: Clojure for Scientific and other CPU-intensive Computing

2009-06-30 Thread Daniel Lyons
On Jun 30, 2009, at 3:53 AM, fft1976 wrote: > > On Jun 30, 12:55 am, Daniel Lyons wrote: > >> I don't see why that wouldn't be the case, if you were using Java's >> native multidimensional arrays. I don't think it would be as much >> fun, > > That's my point. It's often argued that you can ju

Re: Binary Tree

2009-06-30 Thread Daniel Lyons
On Jun 30, 2009, at 3:50 AM, Nicolas Oury wrote: > > If you use depth/size a lot, it might be faster to store them in the > nodes. (it is pseudo code) > > (defstruct bintree :head :left :right :size :depth) > > (defn make-tree [head left right] > (struct bintree head left right >

Re: ANN: clj-forms - a wrapper DSL for JGoodies Forms

2009-06-30 Thread Nicolas Oury
Hi Meikel, > (make-panel >[{:label "Flogiston Pressure" :constraints "1, 1"} > {:editor Integer :initial 0 :min 0 :max 5 :atom flogiston- > pressure :constraints "2, 1"} > {:label "Security Override" :constraints "1, 3"} > {:editor Boolean :initial false :atom sec-override :const

Re: Clojure for Scientific and other CPU-intensive Computing

2009-06-30 Thread fft1976
On Jun 30, 12:55 am, Daniel Lyons wrote: > I don't see why that wouldn't be the case, if you were using Java's   > native multidimensional arrays. I don't think it would be as much fun,   That's my point. It's often argued that you can just optimize the teeny "bottleneck" by adding type declara

Re: Binary Tree

2009-06-30 Thread Nicolas Oury
If you use depth/size a lot, it might be faster to store them in the nodes. (it is pseudo code) (defstruct bintree :head :left :right :size :depth) (defn make-tree [head left right] (struct bintree head left right (+ (left :size) (right :size))

Re: ANN: clj-forms - a wrapper DSL for JGoodies Forms

2009-06-30 Thread Laurent PETIT
Hi, 2009/6/30 Meikel Brandmeyer : > Hi Laurent, > > Am 30.06.2009 um 10:56 schrieb Laurent PETIT: > >> the name of the library is very general, while when reading its >> description it seems that it handles just a particular kind of >> implementation forms (JGoodies). I can also see that the use

Re: ANN: clj-forms - a wrapper DSL for JGoodies Forms

2009-06-30 Thread Meikel Brandmeyer
Hi Laurent, Am 30.06.2009 um 10:56 schrieb Laurent PETIT: the name of the library is very general, while when reading its description it seems that it handles just a particular kind of implementation forms (JGoodies). I can also see that the use by a user requires the explicit usage of swing co

Re: ANN: clj-forms - a wrapper DSL for JGoodies Forms

2009-06-30 Thread Laurent PETIT
Hi Meikel, the name of the library is very general, while when reading its description it seems that it handles just a particular kind of implementation forms (JGoodies). I can also see that the use by a user requires the explicit usage of swing constructors. So I was wondering whether you could

Re: ClassNotFoundException turn up randomly at compilation

2009-06-30 Thread C. Florian Ebeling
>>> I randomly get ClassNotFoundExceptions when I try to compile a file. >>> This is a paste from the repl: >>> >>> Clojure 1.0.0- >>> user=> (compile 'app.hello) >>> java.lang.RuntimeException: java.lang.ClassNotFoundException: >>> app.hello$exec__4 (NO_SOURCE_FILE:0) It doesn't happen under lin

Re: Binary Tree

2009-06-30 Thread Daniel Lyons
On Jun 30, 2009, at 1:05 AM, Emeka wrote: > Hello All, > > I have a BinaryTree Nodes that I want to resolve it's depth and the > BinaryTree may be unbalanced. How do I do this? Can't just figure it > out on my own? > It is in the form of vector of vectors, and from one cell of any > vector

ANN: clj-forms - a wrapper DSL for JGoodies Forms

2009-06-30 Thread Meikel Brandmeyer
Dear Clojurians, I herewith announce a new library: clj-forms. It provides a small embedded DSL to allow easy creation of forms by providing a sequence of maps giving the necessary information. The boilerplate is hidden in the Forms driver. Here you can find an example: http://kotka.de/projec

Re: Troll in our midst - please ignore them

2009-06-30 Thread Daniel Lyons
On Jun 29, 2009, at 8:21 AM, Andrew Garman wrote: > I'd also suggest that folks rate the posts that are exceptionally good > or exceptionally bad. If a user account is noted predominately for > bad posts, a moderator - whether in this group or another - will think > twice about allowing the use

Re: Binary Tree

2009-06-30 Thread Meikel Brandmeyer
Hi, Am 30.06.2009 um 09:05 schrieb Emeka: I have a BinaryTree Nodes that I want to resolve it's depth and the BinaryTree may be unbalanced. How do I do this? Can't just figure it out on my own? It is in the form of vector of vectors, and from one cell of any vector I can move to the next r

Re: Clojure for Scientific and other CPU-intensive Computing

2009-06-30 Thread Daniel Lyons
On Jun 29, 2009, at 12:41 PM, fft1976 wrote: > > Based on the recent survey "What are people using Clojure for?", > people are mostly using it for non-CPU-intensive work, like parsing, > report generation, GUIs, "glue" code. > > It's been argued by some that Clojure is as fast as Java, because a

Re: Clojure for Scientific and other CPU-intensive Computing

2009-06-30 Thread Konrad Hinsen
On 29.06.2009, at 20:41, fft1976 wrote: > It's been argued by some that Clojure is as fast as Java, because at > worst, you can implement your bottlenecks in Java. I have a problem > with this argument, because the data structures that your Java has to > work with are still (wasteful) Clojure one

Binary Tree

2009-06-30 Thread Emeka
Hello All, I have a BinaryTree Nodes that I want to resolve it's depth and the BinaryTree may be unbalanced. How do I do this? Can't just figure it out on my own? It is in the form of vector of vectors, and from one cell of any vector I can move to the next row however the column index has to be

Re: clueless hash-map question

2009-06-30 Thread Laurent PETIT
2009/6/30 Meikel Brandmeyer : > Hi, > > Am 30.06.2009 um 08:22 schrieb Laurent PETIT: > >> Here would be the function returning a lazy seq of the map entries : >> >> (def #^{:docstring "Returns a lazy seq of java.util.Map.MapEntry for >> the map given as an argument." } mapentries (partial map ide

Re: clueless hash-map question

2009-06-30 Thread Meikel Brandmeyer
Hi, Am 30.06.2009 um 08:22 schrieb Laurent PETIT: Here would be the function returning a lazy seq of the map entries : (def #^{:docstring "Returns a lazy seq of java.util.Map.MapEntry for the map given as an argument." } mapentries (partial map identity)) (mapentries {:a 1 :b 2}) => ([:a 1] [