Re: core.async is very slow for some cases, what to do?

2014-03-11 Thread Эльдар Габдуллин
To be honest, I don't see any contradiction here. You can bring everything back easily: 1. Just take existing core.async channels as is 2. Replace callback based take! and put! with promise based take! and put! 3. That's it! Instead (! channel val) you do ( > You can take the CSP ou

Re: core.async is very slow for some cases, what to do?

2014-03-11 Thread Эльдар Габдуллин
My container benchmarks showed up to 3 times improvement after that hack. вторник, 11 марта 2014 г., 22:29:49 UTC+4 пользователь Ben Mabey написал: > > I've also ran into situations as well where the context switching of the > thread pool is prohibitive. I swapped out the thread pool with a sing

Re: Clojure & Jruby (Ruby on Rails) Interop

2014-03-11 Thread Shantanu Kumar
On Monday, 9 September 2013 07:55:15 UTC+5:30, rdelcueto wrote: > > Hi everyone, > I'm about to start working on building a site for a startup company. > > We are a small team, and currently they've been coding the site using RoR > (Ruby on Rails). I was thinking Clojure might be better suited

Re: Clojure & Jruby (Ruby on Rails) Interop

2014-03-11 Thread rdelcueto
Hey Ramon, Back when I started coding my project ~6 months ago, I couldn't run Torquebox successfully in Heroku nor Openshift. I read about the Torquebox Lite project, but you loose most of the Torquebox magic. I know now, you can get the full Torquebox stack - {Stomp server & Clustering} runn

Re: expectations 2.0 has been released

2014-03-11 Thread Sean Corfield
Looks great Jay - as you know I'm a big fan of Expectations. One big issue I see here is that by removing 'given' you've made adoption of 2.0 a bit "all or nothing": to use 2.0, I must update our entire test base to rewrite all 'given' tests using the new syntax. Is there an intermediate versio

Re: 求教:使用uberjar后,如何能覆盖log4j.properties

2014-03-11 Thread Sun Ning
试试启动参数 -Dlog4j.configuration 什么的呢,你可以搜一下 On Tue 11 Mar 2014 11:16:13 PM CST, sonic pan wrote: 把项目用uberjar打包后,如何覆盖日志配置文件log4j.properties? 试了 java -cp resources -jar xxx.jar 貌似不能覆盖 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: Question about importing java classes to Clojure

2014-03-11 Thread James Reeves
On 12 March 2014 00:06, Brandon Barret wrote: > > (defn list-paths [directory] > (println "Files in " (.getName directory)) > (doseq [f (.listFiles directory)] > (if (.isDirectory f) > (print "directory: ") > (print "- ")) > (println (.getName f) > (fn clj-check [d

Re: Help a Startup use Clojure!

2014-03-11 Thread Jarrod Swart
Sean, Thanks for the reply and insight. I completely agree on your points. We will be in a 12 week accelerator program so it is quite possible that this code & business could fail. Our work is likely going to be more back-end API centric as a point of integration for other businesses rather

Re: Question about importing java classes to Clojure

2014-03-11 Thread Brandon Barret
Jarrod, Thanks! I have heard of fs. Since I am new to Clojure, I was resistant to try it, but am going to look into it more tonight. Thanks! Brandon -- 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: Help a Startup use Clojure!

2014-03-11 Thread Jarrod Swart
Sean, Oops I didn't realize you were asking these questions: - What are you building? - An application for businesses to help leverage the power of crowds in non-traditional "crowdsource" environments. - The main use-case for many will be that of integration with-in

Re: Question about importing java classes to Clojure

2014-03-11 Thread Jarrod Swart
No problem, happy to help. Here is one way you might write the above with fs. I didn't check this I just typed it out so there may be a few tiny bugs. (defn jar? [filename] (if (= (fs/extension filename) "jar") true false)) (defn list-paths [path-str] (println "Files in " path-str

Re: Question about importing java classes to Clojure

2014-03-11 Thread Jarrod Swart
Hey Brandon, I had a really simple blog post about reading a directory of files that I never published, I updated it and hopefully it can help: http://jarrodswart.com/clojure-like-im-five-working-with-files/ Best, Jarrod -- You received this message because you are subscribed to the Google Gr

求教:使用uberjar后,如何能覆盖log4j.properties

2014-03-11 Thread sonic pan
把项目用uberjar打包后,如何覆盖日志配置文件log4j.properties? 试了 java -cp resources -jar xxx.jar 貌似不能覆盖 -- 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

expectations 2.0 has been released

2014-03-11 Thread Jay Fields
expectations is a minimilist's unit testing framework website: http://jayfields.com/expectations/ github: https://github.com/jaycfields/expectations changelog: https://github.com/jaycfields/expectations/blob/master/CHANGELOG.md some large changes that will hopefully result in even more concise a

Re: Question about importing java classes to Clojure

2014-03-11 Thread Brandon Barret
Sean, I am getting closer. Sorry about that. Here is my (rudimentary) code. My goal is to print the contents of a directory, and from that, print one of two things based on the results ( an if/then, if you will). I am running into a few problems though. (defn list-paths [directory] (p

Re: Question about importing java classes to Clojure

2014-03-11 Thread Moritz Ulrich
Brandon Barret writes: > Hello all, > > I am working on a program that needs to list all the files in a directory. > I have read that Clojure doesn't yet have great support for this kind of > task, and that it is better to import java.io.File to your namespace in > order to use some of it

Re: Question about importing java classes to Clojure

2014-03-11 Thread Sean Corfield
Hard to tell what your problem is with so little information to go on. Here's the code we use to get a directory listing: (defn- wildcard-filter "Given a regex, return a FilenameFilter that matches." [re] (reify java.io.FilenameFilter (accept [_ dir name] (not (nil? (re-find re name

Re: Help a Startup use Clojure!

2014-03-11 Thread Sean Corfield
On Mar 11, 2014, at 2:09 PM, Jarrod Swart wrote: > My goal is to convince the CEO and other early stage executives of the > benefits of using Clojure in place of PHP. All the early founders have > worked in places that use PHP, and I have worked as a PHP developer with some > of them at other

Question about importing java classes to Clojure

2014-03-11 Thread Brandon Barret
Hello all, I am working on a program that needs to list all the files in a directory. I have read that Clojure doesn't yet have great support for this kind of task, and that it is better to import java.io.File to your namespace in order to use some of it's methods. Every time I have done t

Re: Help a Startup use Clojure!

2014-03-11 Thread Jarrod Swart
Christopher, Absolutely I agree. I enjoyed that book very much. I think I misstated my question a bit in that I don't need to be convinced of the value, but rather how best to relay Clojure's benefits to non-technical business types. Thanks for your input. -- You received this message becau

Re: Help a Startup use Clojure!

2014-03-11 Thread Christopher Poile
Jarrod, The book Clojure Programminghas a chapter (19) dedicated to your very question. I think the most important piece of advice is "Be Prudent" by choosing where Clojure fits and by starting slow. Try to find small s

Re: Help a Startup use Clojure!

2014-03-11 Thread Jarrod Swart
Gary, Thanks for your observations. I agree it doesn't necessarily have to be all or nothing. I'm hoping to get as much as possible insight before I present to the founders. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: Help a Startup use Clojure!

2014-03-11 Thread Gary Trakhman
Some Observations: We took on a relatively inexperienced java developer, threw her into emacs, gave her 'Joy of Clojure', and she was able to make contributions within a month or two. It doesn't have to be Clojure-everything, maybe PHP would be a great fit for the front-end web/templating based on

Help a Startup use Clojure!

2014-03-11 Thread Jarrod Swart
I'm about to be an early employee at a small startup. I will be the first technical hire and am a competent but not extraordinarily experienced developer. The founders know this and hired me based on soft as well as technical skills. I don't want to be the first technical employee and make

ANN Elastisch 2.0.0-beta1 is released

2014-03-11 Thread Michael Klishin
Elastisch [1] is a small, feature complete Clojure client for ElasticSearch that provides both HTTP and native transports. 2.0 focuses on compatibility with and support for the new features in ElasticSearch 1.0. Release notes: http://blog.clojurewerkz.org/blog/2014/03/10/elastisch-2-dot-0-0-beta1

Re: java.lang.IllegalArgumentException: More than one matching method found: submit - when "letting" an ExecutorService

2014-03-11 Thread Alex Miller
Sorry for the deep storage reply - this was just referenced from a ticket and I didn't realize it was super old. :) On Tuesday, March 11, 2014 3:44:36 PM UTC-5, Alex Miller wrote: > > In the let case, the *pool* will be tagged with the proper type so the > ambiguity is detected. > > In the def

Re: java.lang.IllegalArgumentException: More than one matching method found: submit - when "letting" an ExecutorService

2014-03-11 Thread Alex Miller
In the let case, the *pool* will be tagged with the proper type so the ambiguity is detected. In the def case, the *pool* will be seen as an object and the compiler is just deferring to reflection at runtime to figure it out. If you turn on *warn-on-reflection*, you'll see a reflection warning

Re: core.async is very slow for some cases, what to do?

2014-03-11 Thread Ghadi Shayban
Comparing CSP and promises is apples-to-oranges. I'd love to see a minimal sample of problematic code. On Tuesday, March 11, 2014 1:39:54 PM UTC-4, Эльдар Габдуллин wrote: > > Each go block is executed via thread pool. On a channel side, producers > and consumers are also decoupled. > Such deco

Re: Clojure & Jruby (Ruby on Rails) Interop

2014-03-11 Thread Ramon Long
Rodrigo, Have you looked at hosting your JVM-based solution with Clojure and jRuby on Heroku? -Ramon On Thursday, October 24, 2013 9:59:56 PM UTC-4, rdelcueto wrote: > > Thanks for your response Jim. > Is there any alternative solution to Openshift that supports the TB and > Immutant combo, th

Re: core.async is very slow for some cases, what to do?

2014-03-11 Thread Timothy Baldridge
You can take the CSP out of core.async, but then it really isn't the same thing. Your version with promises still allows for async, but in the process removes most of the benefits of CSP. Timothy Baldridge On Tue, Mar 11, 2014 at 12:29 PM, Ben Mabey wrote: > I've also ran into situations as w

Re: core.async is very slow for some cases, what to do?

2014-03-11 Thread Ben Mabey
I've also ran into situations as well where the context switching of the thread pool is prohibitive. I swapped out the thread pool with a single threaded executor and saw a big speed improvement. The downside is that you can not specify what thread pool a go block should be ran on. This means

Re: Good quick reference screencasts

2014-03-11 Thread John Wiseman
FYi the videos at pluralinsight.com require you to sign up for a free trial, including giving them billing information. On Mon, Mar 10, 2014 at 11:36 PM, The Dude (Abides) wrote: > Found a good set of screencasts as quick references for functions, > namespaces, collections, destructuring, seque

core.async is very slow for some cases, what to do?

2014-03-11 Thread Эльдар Габдуллин
Each go block is executed via thread pool. On a channel side, producers and consumers are also decoupled. Such decoupling costs around 10-20 us per async operation. For the cases when your async values are immediately available (e.g. from cache), or when you designed an async API just because yo

Re: [ANN] Kria, an async driver for Riak 2

2014-03-11 Thread David James
I started Kria in January I think. It has tests, and I use in for (currently small) but real projects. It works great so far for me. I'd appreciate it if you try it out. On Fri, Mar 7, 2014 at 9:24 PM, dgrnbrg wrote: > This is really exciting! One question I have is how mature is Kria? Given >

[ANN] Clojure 1.6.0-RC1

2014-03-11 Thread Alex Miller
Clojure 1.6.0-RC1 is now available. Try it via - Download: http://central.maven.org/maven2/org/clojure/clojure/1.6.0-RC1 - Leiningen: [org.clojure/clojure "1.6.0-RC1"] See the full change log here: https://github.com/clojure/clojure/blob/master/changes.md Clojure 1.6.0-RC1 has the following chan

Re: [ANN] Jig

2014-03-11 Thread Joachim De Beule
update: I made mistake at the end of my previous post: I mean "that the db component does NOT sufficiently encapsulate the internals" of course... -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegrou

Re: [ANN] Jig

2014-03-11 Thread Joachim De Beule
Dear Malcolm. I'm still having trouble seeing the intended flow, and I have the feeling I'm missing something. My first question is why I would create two separate components C and A, instead of just having one component A that both installs a channel in the system map and starts a thread for

Re: [soft/philosophical] event handers in cljs

2014-03-11 Thread juan.facorro
Hi François, That makes sense. I think I had read that discussion a while ago but hadn't really grokked it. Thanks! Juan On Tuesday, March 11, 2014 10:42:04 AM UTC-3, François Rey wrote: > > On 10/03/14 15:37, juan.facorro wrote: > > I have taken this approach as well, but I can can't seem

Re: [soft/philosophical] event handers in cljs

2014-03-11 Thread François Rey
On 10/03/14 15:37, juan.facorro wrote: I have taken this approach as well, but I can can't seem to find a good answer to this question: When you create a bunch of elements with their corresponding channels to handle certain events, how do you handle the closing of those channels and the termina

Quil for ClojureScript

2014-03-11 Thread Divyansh Prakash
Hello! I am a Java developer, and the author of 3Coffee, a 2D Game Engine (with custom inbuilt physics) that I wrote some 2 years back. I stumbled across Clojure while trying to solve one of the *many* threading issues I seemed to have with swing. I have b

Re: [ANN] Stasis - not another static site framework

2014-03-11 Thread Christian Johansen
I just posted a quite long and detailed post/tutorial on using Stasis for static web sites, including integration testing of all pages, link checker ++ The post also shows off using Optimus for asset optimization, and Enlive and Hiccup for markup generation/manipulation. http://cjohansen.no/bu

Re: [ANN] 1st public release of thi.ng geometry toolkit (CLJ & CLJS)

2014-03-11 Thread Baishampayan Ghose
Brilliant work. Major kudos for writing a literate program. ~BG On Tue, Mar 11, 2014 at 3:02 AM, Karsten Schmidt wrote: > It is my absolute pleasure to finally announce the first public > release of the 2d/3d geometry library/toolkit: thi.ng/geom > > Having worked on this regularly since late 201