Re: How should I implement an elevator state-machine with loops and core.async?

2014-05-22 Thread Rob Day
I haven't taken a detailed look yet, but you say you're watching the atom in a background loop - would http://clojuredocs.org/clojure_core/1.2.0/clojure.core/add-watch be more idiomatic and more efficient? Best, Rob On 22 May 2014 14:17, Jesse jesus.diama...@gmail.com wrote: Hey guys, I am

Re: Joy of Clojure example not working

2014-05-19 Thread Rob Day
It looks like it expects the keyword :osx, not the symbol osx. Could that be the issue? On 19 May 2014 16:39, gamma235 jesseluisd...@gmail.com wrote: Hi guys, I am working through the pre-release second edition of Joy of Clojure's section on multi-methods (section 9.2.~ : pg. 313), and am

Re: Looking for help with a Stack Overflow error

2014-05-17 Thread Rob Day
A better approach might be to break it down into three groups: * The first three numbers (rows 1 and 2), constrained by rule D * The middle three numbers (row 3), constrained by rule A * The last four numbers (row 4), constrained by rule E There are only 10!/7! or 10!/6! initial possibilities

Re: What is going wrong in my code?

2014-05-11 Thread Rob Day
On 11 May 2014 15:18, Hussein B. hubaghd...@gmail.com wrote: Hi, I'm trying to learn how to make DSL in Clojure and Korma project is a really good place to learn from. I'm trying this very simple stuff (inspired by Korma, not Korma code): [code snipped] But when I'm trying in the REPL:

Re: What is going wrong in my code?

2014-05-11 Thread Rob Day
On 11 May 2014 15:18, Hussein B. hubaghd...@gmail.com wrote: Hi, I'm trying to learn how to make DSL in Clojure and Korma project is a really good place to learn from. I'm trying this very simple stuff (inspired by Korma, not Korma code): [code snipped] But when I'm trying in the REPL:

Re: project docs

2014-04-17 Thread Rob Day
If you just want to preview the docs, Emacs has a markdown-mode - http://jblevins.org/projects/markdown-mode/. I can type C-c C-c p when editing my README.md, and a properly formatted version comes up in Firefox. On 17 April 2014 19:31, Andrey Antukh n...@niwi.be wrote: Hi. Personally I don't

Re: Google Summer of Code 2014 proposal

2014-03-12 Thread Rob Day
I don't have enough experience in this field to comment very sensibly (or offer to mentor), but I wanted to say that I think it would be really nice to have a broader selection of specialised persistent data structures available for Clojure. On 12 March 2014 09:56, Matteo Ceccarello

Re: Is there a function to determine if code is run as script or library ?

2014-02-26 Thread Rob Day
'lein run -m namespace' will run the main- function of a namespace, which otherwise won't be run unless deliberately invoked (like all functions). Is that what you're looking for? (See https://github.com/technomancy/leiningen#basic-usage). On 26 February 2014 09:57, Aaron France

Re: I'm trying to make proper urls, but I seem to be failing at it.

2014-02-25 Thread Rob Day
What are url-encode and url-decode doing wrong? They look like they should work (e.g. https://github.com/ring-clojure/ring-codec/blob/master/test/ring/util/test/codec.clj#L21). On 25 February 2014 07:14, David Toomey dbtoo...@gmail.com wrote: I'm building a site and I would like to allow users

Re: Why is Clojure faster than Java at this task?

2014-02-25 Thread Rob Day
It looks like an improvement in clojure.lang.BigInt over java.math.BigInteger - BigInt's add() method seems to do a long + long add if it doesn't overflow (https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/BigInt.java#L142) and only fall back to BigInteger's add method (which has

Re: How to override the default port on 3000?

2014-02-25 Thread Rob Day
If you do want to use port 80, it's generally safer to use a reverse proxy like nginx to listen on port 80 and forward to port 3000 - that way your code doesn't need root privileges and is less of a security headache. On 25 February 2014 14:59, Josh Kamau joshnet2...@gmail.com wrote: you can

[ANN] ttlcache, an improved (?) version of core.cache's TTLCache

2014-02-25 Thread Rob Day
Hi all, I've been looking at DNS caching recently, and based on that, have made some improvements on top of the TTLCache in core.cache which I think I'm ready to release - they're at https://github.com/rkday/ttlcache and https://clojars.org/uk.me.rkd.ttlcache. The main improvements are that you

Re: [ANN] Buffy The ByteBuffer Slayer, Clojure library to working with binary data

2013-12-04 Thread Rob Day
On 29 November 2013 22:15, Alex P oleksandr.pet...@gmail.com wrote: Buffy [1] is a Clojure library to work with Binary Data, write complete binary protocol implementations in clojure, store your complex data structures in an off-heap chache, read binary files and do everything you would

Re: [ANN] overload-middleware 0.1.1

2013-11-17 Thread Rob Day
On 16/11/13 21:22, Craig wrote: Very interesting. I have a similar requirement, but not in serving web requests. I haven't looked under the covers of your module, but wonder if it could be decoupled from web/ring? Craig I've just pushed 0.2.0-SNAPSHOT to Clojars and Github. This adds

[ANN] overload-middleware 0.1.1

2013-11-16 Thread Rob Day
Hi all, I've just published the first working version of a Ring middleware that some of you might find useful. It's designed for web apps where, if you're overloaded, it's better to serve some requests quickly and fail the others than to try and serve all the requests and do it slowly. (My

Re: [ANN] overload-middleware 0.1.1

2013-11-16 Thread Rob Day
On 16/11/13 21:22, Craig wrote: Very interesting. I have a similar requirement, but not in serving web requests. I haven't looked under the covers of your module, but wonder if it could be decoupled from web/ring? Craig Yes - I don't think that would be at all difficult. The only

Re: Loosing a space from an XML document

2013-06-19 Thread Rob Day
On 19 June 2013 20:32, Stefan Kamphausen ska2...@gmail.com wrote: Take a look at the last tag wheredidmyspacego. The whitespace between the span tags gets lost whereas the dear in the second example is preserved including surrounding spaces. Is this on purpose and/or expected behavior?

Re: what directs the program in my-website progream to execute the various files, welcome, users?

2013-06-12 Thread Rob Day
On Tuesday, June 11, 2013 5:32:46 AM UTC-7, jayvandal wrote: what statements makes the program execute. The main statement tells the program to execute server file what statements in the server file tell the program to run the welcome file ? the user file Is welcome.clj in