Re: ANN: Clojure web application using NHPM for server push

2010-12-26 Thread Anders Rune Jensen
On Thu, Dec 23, 2010 at 1:53 AM, rob levy r.p.l...@gmail.com wrote: Hi Anders, thanks.  If I understand what you are asking, in fact the server in my case does not care if anyone is listening, however you can set how long the messages live in the queue.  The client holds the responsibility of

complex number performance enhancement...

2010-12-26 Thread Sunil S Nandihalli
Hello everybody, I have a numerically intensive code. after getting it to work I started profiling the code .. and zeroed down that my complex number operations are the most called functions and probably among the slowest due to my naive implementation. The code I am using is in the following

Re: Let's see how fast we can make this

2010-12-26 Thread Ivan
I don't know why I thought Java used UTF-8, thank you for the correction. So yeah, would be interesting to see the tests on C done with wide char in UTF-16. On Dec 26, 1:54 am, Glen Stampoultzis gst...@gmail.com wrote: On 26 December 2010 03:00, Ivan ivankob...@gmail.com wrote: Would be

Question about when to use protocol+record and compilation warnings

2010-12-26 Thread Damon Snyder
Hello, In an effort to learn a little more about clojure (and possibly introduce it at work) I decided to write a native client for the Beanstalk work queue. See http://kr.github.com/beanstalkd/ for more information about the queue and https://github.com/drsnyder/beanstalk for the client. One of

Re: Question about when to use protocol+record and compilation warnings

2010-12-26 Thread Baishampayan Ghose
But one issue I encountered with defprotocol is that there appears to be a possible symbol table/space issue. When I compile, I get warnings like the following: Warning: protocol #'beanstalk.core/BeanstalkObject is overwriting function read Warning: protocol #'beanstalk.core/BeanstalkObject

printf output from threads

2010-12-26 Thread justinhj
What do people use for logging debug output from threads? Either native threads created with Thread. or implicit threads via agents or pmap etc? I tried passing *out* to my thread function and then binding it to *out* in the thread, and this works but then makes the threads execute one at a time,

Re: partitioning iterative list

2010-12-26 Thread Ken Wesson
On Fri, Dec 24, 2010 at 8:38 PM, Glen Rubin rubing...@gmail.com wrote: Can I do the following without using loops?? I have list, e.g. '(4 6 66 33 26 6 83 5) I want to partition it so that I get a subset of lists that build up to the original: ( (4) (4 6) (4 6 66) (4 6 66 33) ) (defn

complexity

2010-12-26 Thread Thiago Dantas
Hi everyone, I was in the project euler page and i tried to solve the question 8 using clojure. No big deal, was really cool. So , i cant figure out what is the time complexity for the *code* below I thought that was O(n^2), but running the code for different input seems that the complexity

Re: websockets w/ clojure

2010-12-26 Thread Jay Fields
I don't have any publicly available jetty/clojure/websocket code. I'll see if I can throw something together tomorrow. Cheers, Jay On Dec 24, 2010, at 11:58 PM, Sean Allen wrote: Jay, Do you have any publicly released code I could take a look at? I've only found a couple of

Re: Question about when to use protocol+record and compilation warnings

2010-12-26 Thread Alex Osborne
Damon Snyder drsny...@gmail.com writes: One of the decisions I wasn't sure about was whether to use a protocol or a struct map for the (socket, reader, writer) tuple. I started using a struct-map and then switched over to defprotocol/defrecord. See

Re: Question about when to use protocol+record and compilation warnings

2010-12-26 Thread Ken Wesson
On Sun, Dec 26, 2010 at 7:18 PM, Alex Osborne a...@meshy.org wrote: Damon Snyder drsny...@gmail.com writes: One of the decisions I wasn't sure about was whether to use a protocol or a struct map for the (socket, reader, writer) tuple. I started using a struct-map and then switched over to

Re: complex number performance enhancement...

2010-12-26 Thread Alex Osborne
Sunil S Nandihalli sunil.nandiha...@gmail.com writes: http://paste.lisp.org/display/93387 It uses protocols and deftype I noticed that it was an old post .. I could not get it to compile to try it out.. I was complaining about likes of trying to convert a name-space-qualified to a type name

Re: Question about when to use protocol+record and compilation warnings

2010-12-26 Thread Alex Osborne
Ken Wesson kwess...@gmail.com writes: On Sun, Dec 26, 2010 at 7:18 PM, Alex Osborne a...@meshy.org wrote: Struct maps were in the language for a long time before defrecord was added.  Records are supposed to replace them for most purposes.  So if in doubt between the two use a defrecord.

Re: Knuth's literate programming tangle function in Clojure

2010-12-26 Thread Robert McIntyre
That's really cool. I was _just reading_ your comments from 2006 at http://www.mail-archive.com/gardeners@lispniks.com/msg01006.html and wondering about how hard something like this would be to write. If possible, could you expand on how one might use this in a development work-flow with emacs or

Re: complex number performance enhancement...

2010-12-26 Thread Sunil S Nandihalli
thanks Alex for your response . I tried it ... It compiled fine .. but the double dispatch does not seem to work correctly .. It some how reverses the arguments and then dispatches to the correct function for the reversed arguments and the function works properly .. i.e. when I do (- (Complex.

Re: Question about when to use protocol+record and compilation warnings

2010-12-26 Thread Ken Wesson
On Sun, Dec 26, 2010 at 8:20 PM, Alex Osborne a...@meshy.org wrote: Ken Wesson kwess...@gmail.com writes: On Sun, Dec 26, 2010 at 7:18 PM, Alex Osborne a...@meshy.org wrote: Struct maps were in the language for a long time before defrecord was added.  Records are supposed to replace them for

Re: complex number performance enhancement...

2010-12-26 Thread Alex Osborne
Sunil S Nandihalli sunil.nandiha...@gmail.com writes: thanks Alex for your response . I tried it ... It compiled fine .. but the double dispatch does not seem to work correctly .. It some how reverses the arguments and then dispatches to the correct function for the reversed arguments and

Re: Question about when to use protocol+record and compilation warnings

2010-12-26 Thread Alex Osborne
Ken Wesson kwess...@gmail.com writes: Actually you don't need to AOT compile records or types. They work fine for interactive development. Eh. That's not what I saw written elsewhere. Or is it just protocols? Though usually those are used hand-in-hand with records. Perhaps you're thinking

Re: Knuth's literate programming tangle function in Clojure

2010-12-26 Thread Praki Prakash
Tim, This approach is very interesting. My choice of mode for LP has always been noweb-mode but it doesn't seem to work with my version of emacs anymore. My current approach is to embed prose and clojure code in a latex document and generate a .tex file with formatted clojure code and .clj

Re: Question about when to use protocol+record and compilation warnings

2010-12-26 Thread Ken Wesson
On Sun, Dec 26, 2010 at 9:25 PM, Alex Osborne a...@meshy.org wrote: Ken Wesson kwess...@gmail.com writes: Actually you don't need to AOT compile records or types. They work fine for interactive development. Eh. That's not what I saw written elsewhere. Or is it just protocols? Though usually

Re: Question about when to use protocol+record and compilation warnings

2010-12-26 Thread Ken Wesson
On Sun, Dec 26, 2010 at 10:00 PM, Ken Wesson kwess...@gmail.com wrote: On Sun, Dec 26, 2010 at 9:25 PM, Alex Osborne a...@meshy.org wrote: Ken Wesson kwess...@gmail.com writes: Actually you don't need to AOT compile records or types. They work fine for interactive development. Eh. That's

Re: Question about when to use protocol+record and compilation warnings

2010-12-26 Thread David Nolen
On Sun, Dec 26, 2010 at 9:00 PM, Ken Wesson kwess...@gmail.com wrote: On Sun, Dec 26, 2010 at 9:25 PM, Alex Osborne a...@meshy.org wrote: Ken Wesson kwess...@gmail.com writes: Actually you don't need to AOT compile records or types. They work fine for interactive development. Eh.

Re: Knuth's literate programming tangle function in Clojure

2010-12-26 Thread Tim Daly
On 12/26/2010 9:56 PM, Praki Prakash wrote: Tim, This approach is very interesting. My choice of mode for LP has always been noweb-mode but it doesn't seem to work with my version of emacs anymore. My current approach is to embed prose and clojure code in a latex document and generate a

Re: Knuth's literate programming tangle function in Clojure

2010-12-26 Thread Tim Daly
On 12/26/2010 8:33 PM, Robert McIntyre wrote: That's really cool. I was _just reading_ your comments from 2006 at http://www.mail-archive.com/gardeners@lispniks.com/msg01006.html and wondering about how hard something like this would be to write. If possible, could you expand on how one might

Re: printf output from threads

2010-12-26 Thread Alex Osborne
justinhj justi...@gmail.com writes: I tried passing *out* to my thread function and then binding it to *out* in the thread, and this works but then makes the threads execute one at a time, and I'm presuming that is because my use of *out* in the binding block is blocking for the other threads