Re: Ragtime w/ Korma

2014-01-14 Thread Sean Corfield
How exactly are you running the code? The Gist really doesn't provide enough information for anyone to be able to diagnose this... On Tue, Jan 14, 2014 at 5:15 PM, Christopher Allen wrote: > Verify with clojure.java.jdbc would by my first approach, but it's not clear > to me how you can know migr

Re: Nginx-Clojure Let You Deploy Clojure Web App on Nginx Without Any Java Web Server

2014-01-14 Thread Roberto De Ioris
> Hi Mingli, > > Thanks for your suggestion. > > Nginx-Clojure is quite different from uwsgi when supports JVM. > > Nginx-Clojure make JVM embed into Nginx worker process. JVM and Nginx > worker have the same memory process space. > > Nginx-Clojure heavy uses pointer operation just like C to ha

Guide to the ClojureScript Analyzer & Compiler

2014-01-14 Thread David Nolen
I think Light Table, Clojure, and ClojureScript users will find this guide informative: http://swannodette.github.io/2014/01/14/clojurescript-analysis--compilation/ Cheers, David -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: Nginx-Clojure Let You Deploy Clojure Web App on Nginx Without Any Java Web Server

2014-01-14 Thread Xfeep Zhang
I have check the uwsgi document again and the JVM integration document is HERE http://uwsgi-docs.readthedocs.org/en/latest/JWSGI.html . When using uwsgi to integrate JVM, the JVM process is not the same process of Nginx worker. So it can

Re: Granularity in Leiningen profile loading

2014-01-14 Thread Phil Hagelberg
gvim writes: > ... but after `lein deps :tree` the cljs profile still isn't loaded. That's normal; you would need to run `lein with-profile cljs deps :tree` to activate a profile. But if you have dependencies that are needed for your project to compile, it's a very bad idea to omit them from pro

Re: Nginx-Clojure Let You Deploy Clojure Web App on Nginx Without Any Java Web Server

2014-01-14 Thread Xfeep Zhang
Hi Mingli, Thanks for your suggestion. Nginx-Clojure is quite different from uwsgi when supports JVM. Nginx-Clojure make JVM embed into Nginx worker process. JVM and Nginx worker have the same memory process space. Nginx-Clojure heavy uses pointer operation just like C to handle memory wi

Re: Ragtime w/ Korma

2014-01-14 Thread Christopher Allen
Verify with clojure.java.jdbc would by my first approach, but it's not clear to me how you can know migratus and Korma aren't touching two different instantiations of the H2 in memory database using c.j.j. I don't know anything about H2. I'm a PostgreSQL user. On Tuesday, January 14, 2014 7:50

Re: Granularity in Leiningen profile loading

2014-01-14 Thread gvim
In ~/.lein/profiles.clj I have: {:user {:plugins [[lein-ritz "0.7.0"] [lein-ancient "0.5.4"]] :dependencies [[org.clojure/core.typed "0.2.21"] [org.clojure/core.match "0.2.0"] [co.paralleluniverse/pulsar "0.3.0"]]}} ... and I ~/.lein/projfile

Re: Granularity in Leiningen profile loading

2014-01-14 Thread Phil Hagelberg
Can you be more specific about what you did and what you would expect to happen in that case? -Phil -- -- 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 ar

Re: [ClojureScript] [ANN] cljs-start 0.1.1

2014-01-14 Thread Mimmo Cosenza
On Jan 14, 2014, at 9:26 AM, Ivan L wrote: > This is excellent work! I played around with cljs-start tonight, thanks so > much for your work. I'm glad you find it useful. > > One hopefully quick question. Assuming the CCW lein headless start and then > (run) and (browser-repl), how can the

Re: go "kill infinite loop"

2014-01-14 Thread Mark Mandel
On Wed, Jan 15, 2014 at 12:39 AM, Alex Miller wrote: > 2) Be careful using when using falsey tests like when or if - these will > stop on nil but will also stop on false coming through the channel. Might > be ok here, but it's something to be aware of. Oooh! that is a really good point! I hones

Re: Effects of diving into Clojure

2014-01-14 Thread Bob Hutchison
On Jan 14, 2014, at 3:46 PM, gvim wrote: > No, you're probably right. It's just that there never seem to be enough hours > in a day/life :( You’re not alone there either :-) Cheers, Bob > > gvim > > > On 14/01/2014 20:26, Bob Hutchison wrote: > >> No it’s not just you. Hardly! However, I

Re: Effects of diving into Clojure

2014-01-14 Thread gvim
No, you're probably right. It's just that there never seem to be enough hours in a day/life :( gvim On 14/01/2014 20:26, Bob Hutchison wrote: No it’s not just you. Hardly! However, I’d caution you against allowing this situation to continue. Preference is one thing. Isolating yourself from

Re: Effects of diving into Clojure

2014-01-14 Thread Bob Hutchison
On Jan 14, 2014, at 2:01 PM, gvim wrote: > I recently took the plunge into learning Clojure and love it. Since I tend to > be single-minded/all-or-nothing about these things I'm now finding it very > difficult to switch mindset when I have to work with Ruby. Anyone else > experienced this? I

Re: Effects of diving into Clojure

2014-01-14 Thread Travis Vachon
+1 here. I'm afraid the only solution I've found is to stop writing Ruby. ¯\_(ツ)_/¯ On Tue, Jan 14, 2014 at 2:39 PM, Mark wrote: > I misread the critical piece of your post :) You are, indeed, a step ahead > of me > > > On Tuesday, January 14, 2014 11:30:13 AM UTC-8, g vim wrote: >> >> It's been

Re: Effects of diving into Clojure

2014-01-14 Thread Mark
I misread the critical piece of your post :) You are, indeed, a step ahead of me On Tuesday, January 14, 2014 11:30:13 AM UTC-8, g vim wrote: > > It's been the other way round for me. I always felt Ruby was doing too > much under the hood. So much so that I bought "Ruby Under A Microscope" > j

Re: Effects of diving into Clojure

2014-01-14 Thread gvim
It's been the other way round for me. I always felt Ruby was doing too much under the hood. So much so that I bought "Ruby Under A Microscope" just to find out what was going on. I found it very easy to switch to Clojure because everything is so much more transparent. Now Ruby just feels awkwar

Re: Effects of diving into Clojure

2014-01-14 Thread Mark
I have felt your pain. I started life with Smalltalk and more or less spent the last 15 years in Java. When I started Clojure, it was very hard to break my thinking habits. Particularly, I was lost without manifest typing. I didn't realize how much types documented my system and allowed ver

Re: Effects of diving into Clojure

2014-01-14 Thread Gary Trakhman
Maybe don't switch mindset? Write code that looks like idiomatic ruby but has what appears to rubyists as QWAN. I think it's possible and maybe even desirable for bad things to feel more foreign when your understanding increases. On Tue, Jan 14, 2014 at 2:01 PM, gvim wrote: > I recently took t

Re: Very strange behaviour in reducers

2014-01-14 Thread Filip Štaffa
Hi Yves, I guess it is because r/reduce calls r/reduce-kv (which is specific for map), while r/fold it does not have such special handling Filip On Tuesday, January 14, 2014 4:43:10 PM UTC+1, Yves Parès wrote: > > Hello! > When mapping and reducing a map, it seems arguments are passed different

Re: Nginx-Clojure Let You Deploy Clojure Web App on Nginx Without Any Java Web Server

2014-01-14 Thread Mingli Yuan
Hi, Xfeep, Thanks for your contribution, and the project looks interesting. For me, the idea of driving ring webapp behind nginx is not new. We use uwsgi to drive our ring app behind nginx in our production. uwsgi support JVM and ring for almost one year, and I think the code is relative stable r

Effects of diving into Clojure

2014-01-14 Thread gvim
I recently took the plunge into learning Clojure and love it. Since I tend to be single-minded/all-or-nothing about these things I'm now finding it very difficult to switch mindset when I have to work with Ruby. Anyone else experienced this? If you get deeply into a programming language it alte

Re: [ANN] incise 0.1.0 - An extensible static site generator

2014-01-14 Thread Ryan McGowan
Hey Jan, My decisions were mostly in an effort to reduce the number of hard dependencies. If you do a search on the incise repository for "hiccup", you'll see it is not used in any core functionality (besides server to generate a trivi

Re: >! on channels that are not yet closed

2014-01-14 Thread t x
@Timothy: Looking forward to your changes. Thanks for all the existing work with core.async! (I was half tempted to switch to Scala to use Akka right before core.async came out.) On Tue, Jan 14, 2014 at 10:30 AM, t x wrote: > @Ghadi, > > > Are you referring to the race condition between: > > (

Re: >! on channels that are not yet closed

2014-01-14 Thread t x
@Ghadi, Are you referring to the race condition between: (check if channel is closed) ### BAM SOMETHING HAPPENS (put something on to the channel) ? I agree it's a race condition, however after some refactoring, I no longer care if I'm >!-ing onto a closed channel, as long as I eventually know

Re: go "kill infinite loop"

2014-01-14 Thread t x
@Alex: Noted. In practice, it's not much of a problem to me, since objects I'm sending over the channel are of the form: {:tag :message :return-chan ... :data ... actual message } On Tue, Jan 14, 2014 at 5:39 AM, Alex Miller wrote: > Two notes: > > 1)The provided core.async go-lo

Re: closing-buffer

2014-01-14 Thread t x
Hi Michal, After a good night's sleep, I've decided to not fight this battle at the buffer layer. However, I appreciate (1) the code you've written and (2) the initial suggestion (which got me interested enough to dig into internals of Channels.clj / Mutex.clj / ... ) On Tue, Jan 14, 2014

Re: >! on channels that are not yet closed

2014-01-14 Thread Timothy Baldridge
It's a known problem (putting into a closed channel), and one we have a possible solution for (it's in one of the branches of core.async). I'll bring it up this Friday and see if we can't make some progress on the code. Timothy On Tue, Jan 14, 2014 at 10:43 AM, Ghadi Shayban wrote: > This code

Re: >! on channels that are not yet closed

2014-01-14 Thread Ghadi Shayban
This code actually results in a subtle race condition as channels need to be locked internally. It also won't work for other implementations of channel, of which there are several in core.async besides ManytoManyChannel. (For example, map< returns a reified channel.) Knowing whether a channel

Re: Ragtime w/ Korma

2014-01-14 Thread Arlandis Lawrence
The errors I'm getting indicate that the tables don't exist. "Table "itinerary" not found; SQL statement: DELETE FROM "itinerary" [42102-164] org.h2.jdbc.JdbcSQLException: Table "itinerary" not found; SQL statement: DELETE FROM "itinerary" [42102-164] at org.h2.message.DbExce

Very strange behaviour in reducers

2014-01-14 Thread Yves Parès
Hello! When mapping and reducing a map, it seems arguments are passed differently to the function that is mapped depending on whether you reduce with r/reduce or r/fold: (r/fold + (r/map (fn [k v] (inc v)) {:a 4 :b 5})) But: (r/reduce + (r/map (fn [[k v]] (inc v)) {:a 4 :b 5})) The func

ANN: core.match 0.2.1

2014-01-14 Thread David Nolen
The only significant change is the bugfix MATCH-92, keywords with dots now supported. http://github.com/clojure/core.match -- -- 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 pos

Re: Clojure web server benchmarks

2014-01-14 Thread Xfeep Zhang
You 're right! ab has many limitations. Maybe httpload , wrk, Weighttp or ABs ( several instances of AB) are better when test client and server do not run on the same computer. On Tuesday, January 14, 2014 5:52:59 PM UTC+8, Feng Shen wrote: > > Hi, nginx-clojure looks great! > > A small tip:

Re: go "kill infinite loop"

2014-01-14 Thread Alex Miller
Two notes: 1)The provided core.async go-loop macro is a small enhancement for the (go (loop )) case. 2) Be careful using when using falsey tests like when or if - these will stop on nil but will also stop on false coming through the channel. Might be ok here, but it's something to be aware of.

Re: closing-buffer

2014-01-14 Thread Alex Miller
>From my perspective, a buffer is below the abstraction level of a channel. If you want a channel with special behavior, it seems like you should implement a channel. On Monday, January 13, 2014 10:47:22 PM UTC-6, t x wrote: > > I am aware of: > > DroppingBuffer and SliddingBuffer > > I would

Re: Hello, here´s a new clojur adict... with a question.

2014-01-14 Thread Chris Ford
Unless you are worrying about concurrency, you probably don't need an atom at all: (def sx2 [2 3 4]) (println (sx2 1)) On 14 January 2014 14:45, Andreas Olsson wrote: > Okay,.. > > ..learning one step at a time hear. =) > > I´m good at basic.. this is some thing else. > > Den tisdagen den 14:

Re: Nginx-Clojure Let You Deploy Clojure Web App on Nginx Without Any Java Web Server

2014-01-14 Thread Xfeep Zhang
You are welcome! Yes, you are right. One JVM instance is embed per Nginx Worker process. The number of Nginx Workers is generally the same with the number of CPU. If one Worker crashs the Nginx Master will create a new one so you don't worry about JVM crashs accidentally. Although there w

Re: Hello, here´s a new clojur adict... with a question.

2014-01-14 Thread Andreas Olsson
Okay,.. ..learning one step at a time hear. =) I´m good at basic.. this is some thing else. Den tisdagen den 14:e januari 2014 kl. 12:38:34 UTC+1 skrev James Reeves: > > You could also write: > > (println (@sx2 4)) > > > On 14 January 2014 11:35, Andreas Olsson > > wrote: > >> thanks... this w

Re: Hello, here´s a new clojur adict... with a question.

2014-01-14 Thread James Reeves
You could also write: (println (@sx2 4)) On 14 January 2014 11:35, Andreas Olsson wrote: > thanks... this works > > (println ((deref sx2) 4)) > > > > Den tisdagen den 14:e januari 2014 kl. 12:29:02 UTC+1 skrev Jim foo.bar: > >> an atom cannot be used as a function! deref it first to get the v

Re: Hello, here´s a new clojur adict... with a question.

2014-01-14 Thread Andreas Olsson
thanks... this works (println ((deref sx2) 4)) Den tisdagen den 14:e januari 2014 kl. 12:29:02 UTC+1 skrev Jim foo.bar: > > an atom cannot be used as a function! deref it first to get the vector > inside and then try again... > > Jim > > > On 14/01/14 11:25, Andreas Olsson wrote: > > Cant

Re: Hello, here´s a new clojur adict... with a question.

2014-01-14 Thread Jim - FooBar();
an atom cannot be used as a function! deref it first to get the vector inside and then try again... Jim On 14/01/14 11:25, Andreas Olsson wrote: Cant get this to work. (def sx2(atom [2 3 4])) (println (sx2 3)) Den tisdagen den 14:e januari 2014 kl. 12:04:27 UTC+1 skrev Omer Iqbal: (p

Re: Hello, here´s a new clojur adict... with a question.

2014-01-14 Thread Andreas Olsson
Cant get this to work. (def sx2(atom [2 3 4])) (println (sx2 3)) Den tisdagen den 14:e januari 2014 kl. 12:04:27 UTC+1 skrev Omer Iqbal: > > (println (v 0)) > > (v 0) would give you the element at index 0 > (println ..) would print whatever you supply as its argument. > > Cheers, > Omer > > > O

Re: Hello, here´s a new clojur adict... with a question.

2014-01-14 Thread Omer Iqbal
(println (v 0)) (v 0) would give you the element at index 0 (println ..) would print whatever you supply as its argument. Cheers, Omer On Tue, Jan 14, 2014 at 6:44 PM, Andreas Olsson wrote: > > How can i "println" an index of a vector? > > tryed. > > (println vector index) > > like > > (printl

Hello, here´s a new clojur adict... with a question.

2014-01-14 Thread Andreas Olsson
How can i "println" an index of a vector? tryed. (println vector index) like (println x 0) dosnt work. / a swede. -- -- 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 post

Re: Clojure web server benchmarks

2014-01-14 Thread Shen, Feng
Hi, nginx-clojure looks great! A small tip: ab may not be the best tool, since it's single threaded. A better tool is wrk: https://github.com/wg/wrk You can use wrk to better test nginx-clojure, It should perform even better than others. 沈锋 http://shenfeng.me On Tue, Jan 14, 2014 at 5:

Re: Nginx-Clojure Let You Deploy Clojure Web App on Nginx Without Any Java Web Server

2014-01-14 Thread Feng Shen
Hi, Thanks for your work on nginx-clojure. It looks great! As I know Nginx spawns many processes(correct me if I am wrong), does that mean, there will be many JVM process? On Tuesday, January 14, 2014 4:44:18 PM UTC+8, Xfeep Zhang wrote: > > > I have done the first one. The result is >

Re: Clojure web server benchmarks

2014-01-14 Thread Peter Taoussanis
Oh wow, that's fantastic! For those watching: Xfeep's fixed a number of config issues, updated all the servers, and completely updated the chart. Absolutely well worth a look if you're interested in Clojure web server performance. * Results are here: https://github.com/ptaoussanis/clojure-web-se

Re: How to handle configuration in Clojure?

2014-01-14 Thread Stefan Kanev
On 14/01/14, James Trunk wrote: > > I am curious about what you mean by 'thread safety'. > Perhaps "thread safety" is the wrong term, but what I meant was the > limitations dynamic binding introduces around thread dispatching, which > Stuart Sierra explains in this blog > post

Re: How to handle configuration in Clojure?

2014-01-14 Thread James Trunk
Thanks for all the great links and ideas you have all posted, now I have plenty of reading and thinking to do! > I am curious about what you mean by 'thread safety'. Perhaps "thread safety" is the wrong term, but what I meant was the limitations dynamic binding introduces around thread dispatchi

Re: closing-buffer

2014-01-14 Thread Michał Marczyk
Just to avoid any possibility of giving the impression that I'm offering the above as a well-tested component: I wouldn't actually use closing-channel as defined above without giving much more thought to all implications. The current version is just a quick sketch. Also, if the alt! / alts! approa

Re: closing-buffer

2014-01-14 Thread Michał Marczyk
A sketch of a different approach: alt! / alts! on the main channel and an extra channel with :priority true when putting. Use an unblocking buffer in the extra channel. If you end up putting on the extra channel, close the main channel. (core.async channels can be closed multiple times.) Here a

Re: Nginx-Clojure Let You Deploy Clojure Web App on Nginx Without Any Java Web Server

2014-01-14 Thread Xfeep Zhang
I have done the first one. The result is HERE( https://github.com/ptaoussanis/clojure-web-server-benchmarks ) Thanks Taoussanis for his invitation to the project clojure-web-server-benchmarks

Re: Eastwood lint tools - some Qs

2014-01-14 Thread Colin Fleming
Ah, I see - that makes sense, thanks. On 14 January 2014 19:49, Andy Fingerhut wrote: > defn is a macro, and thus macro-expanded during Eastwood analysis, I > believe ignoring the :arglists. I think it is really only the :arglists of > functions that matter for Eastwood :wrong-arity warnings >

Re: closing-buffer

2014-01-14 Thread Michał Marczyk
Ah, of course, the mutex is not reentrant. So, one possible way to fix the situation would be to close the owned channel manually by resetting its "closed" atom to true. Thinking through all the implications should make for an interesting exercise. :-) (For example, I think cleanup is performed co

Re: Clojure web server benchmarks

2014-01-14 Thread Xfeep Zhang
I have committed some update. - org.clojure/clojure 1.4.0 --> 1.5.1 - compojure 1.1.4 --> 1.1.6 - ring 1.1.6 --> 1.2.1 - aleph 0.3.0-beta13 --> 0.3.0 - http-kit 1.3.0-alpha2 --> 2.1.16 - ring-netty-adapter 0.0.3 --> netty-ring-adapter 0.4.6 - remove testing about pure nginx w

Re: [ANN] incise 0.1.0 - An extensible static site generator

2014-01-14 Thread Jan Herich
Hello Ryan, Thank you for the project, i was always missing a good static site generator written in clojure ! You took some interesting design decisions with extensibility. I'm currently working on the similar project , even if my design is very differe