Re: Is this a reasonable use of core.async?

2014-09-17 Thread Gary Verhaegen
Sounds like a job for a future. Something like: (->> job-list (partition-in-sublists 4) (map #(future (do-job-on-sublist %))) (mapv deref)) This is untested and written on a phone, so might not even be syntactically correct, but the future calls will create new threds to execute the do-job

Re: Is this a reasonable use of core.async?

2014-09-17 Thread Beau Fabry
pmap isn't an option as the processes kicked off could affect other systems load if we can't control the level of parallelization. futures seem like they'd work quite well (the return value of the jobs is nil, it's a doseq). I might rewrite it with futures at some point. Although it really just

Re: ECHELON: Wrangling messy political data

2014-09-17 Thread Joshua Ballanco
Very interesting project! (and congrats on joining SunlightLabs) As someone who has, on occasion, contributed to various SunlightLabs foundation projects, my only question would be: what do you need help with? I understand completely if this project is not at a point where you’re looking for

Re: why (> 2) returns true

2014-09-17 Thread Phillip Lord
Robert Tweed writes: > In writing this, I thought I'd better also test what (>) and (<) evaluate to, > because by the above definition, those should also evaluate to true. > Unfortunately, at least in v1.6, they throw an arity error. IMO, by the same > logic that says a single argument is valid,

Re: ClojureScript: Keyword Breaking Change Around the Corner

2014-09-17 Thread Peter Taoussanis
Sorry for digging this up, just got bit hard by this behaviour and I'm wondering what the rationale was for not defining `identical?` as `keyword-identical?` currently is, and instead adding an additional `fast-identical?`. This way Clojure/ClojureScript code using `identical?` remains portable

Re: Is this a reasonable use of core.async?

2014-09-17 Thread Thomas Heller
core.sync is more about coordination and communication than about doing things in parallel, thats just a pleasant side effect. In your case you don't need anything core.async provides. You could either use reducers or java.util.concurrent.ExecutorService. (let [exec (Executors/newFixedThreadPoo

Re: Is this a reasonable use of core.async?

2014-09-17 Thread Thomas Heller
Uh forgot to .shutdown the exec, proper cleanup is important otherwise the threads might hang arround a bit. On Wednesday, September 17, 2014 1:26:00 PM UTC+2, Thomas Heller wrote: > > core.sync is more about coordination and communication than about doing > things in parallel, thats just a plea

Re: why (> 2) returns true

2014-09-17 Thread Herwig Hochleitner
2014-09-17 11:51 GMT+02:00 Phillip Lord : > > So, why not special case 1 arg as well, and have that except? It's a > reasonable question. I would submit a bug report and see if anyone else > agrees. Something is wrong for sure. Either (> x) should throw arity, or > (>) should return true, or the d

Re: why (> 2) returns true

2014-09-17 Thread Phillip Lord
Herwig Hochleitner writes: > 2014-09-17 11:51 GMT+02:00 Phillip Lord : > >> >> So, why not special case 1 arg as well, and have that except? It's a >> reasonable question. I would submit a bug report and see if anyone else >> agrees. Something is wrong for sure. Either (> x) should throw arity, o

Re: [ANN] finagle-clojure: Finagle with Clojure!

2014-09-17 Thread Daniel
Very happy about this! On Tuesday, September 16, 2014 3:32:16 PM UTC-5, Sam Neubardt wrote: > > Announcing finagle-clojure, a Clojure wrapper for Finagle [1]. > > https://github.com/finagle/finagle-clojure > > Finagle is a library open sourced by Twitter for building highly > concurrent RPC ser

Re: why (> 2) returns true

2014-09-17 Thread Ashton Kemerling
I wouldn't be surprised if the 1 arg form is to help people who use > along with apply, just in case the list is only 1 element long. On Wed, Sep 17, 2014 at 7:40 AM, Phillip Lord wrote: > Herwig Hochleitner writes: >> 2014-09-17 11:51 GMT+02:00 Phillip Lord : >> >>> >>> So, why not special ca

Re: [ANN] om-bootstrap 0.2.6 released

2014-09-17 Thread Daniel
I could have said that in a slightly less vitriolic way. Apologies. On Tuesday, September 16, 2014 8:45:37 AM UTC-5, Sam Ritchie wrote: > > I fully agree that with more features, the library would be useful to a > larger range of folks :) Pull requests welcome, as always. > > I'm developing each

Re: ECHELON: Wrangling messy political data

2014-09-17 Thread Zack Maril
One issue we've been having is that we are using Datomic in a non standard way (I think). We're touching all the data all at once for some resolution steps and Datomic wasn't necessarily made for that (at least that has been my impression). I've been trying to understand the Datomic query system

Re: why (> 2) returns true

2014-09-17 Thread Robert Tweed
On 17/09/2014 15:28, Ashton Kemerling wrote: I wouldn't be surprised if the 1 arg form is to help people who use > along with apply, just in case the list is only 1 element long. That is precisely why it should do the same thing with zero arguments, which is what happens when you use apply with

Re: why (> 2) returns true

2014-09-17 Thread Phillip Lord
Same argument applies (er...) to the zero element case. Phil Ashton Kemerling writes: > I wouldn't be surprised if the 1 arg form is to help people who use > along > with apply, just in case the list is only 1 element long. > > On Wed, Sep 17, 2014 at 7:40 AM, Phillip Lord > wrote: > >> Herwi

[ANN] Leiningen 2.5.0

2014-09-17 Thread Phil Hagelberg
I'm happy to announce the release of Leiningen 2.5.0. The main priority with this release was to fix a bug with repls outside projects, but a few other features have been added, primarily around profiles that come from plugins. These are not useful directly to end users, but as plugins that requir

Converting Leiningen project.clj to Gradle

2014-09-17 Thread Adam Markham
Unfortunately using Leiningen in this project is out of the question, as the CI environment i'm using doesn't support it. Therefore I would like to convert this project.clj to a gradle project so I can run the uberjar that is built as a standalone jar. This seems to work well with this in Leini

Re: Converting Leiningen project.clj to Gradle

2014-09-17 Thread Korny Sietsma
Which ci environment? I'm a little surprised, as those I've used will let you run arbitrary command lines. I've run leiningen from Jenkins, Bamboo, and ThoughtWorks Go, all with no problems... On 17 Sep 2014 21:22, "Adam Markham" wrote: > Unfortunately using Leiningen in this project is out of th

Re: [ANN] om-bootstrap 0.2.6 released

2014-09-17 Thread Rostislav Svoboda
Concerning sortable tables, at the moment I do following (don't laugh): cp https://github.com/google/closure-library/blob/master/closure/goog/ui/ tablesorter.js resources/public/js/out/goog/ui/ index.html: ... http://fb.me/react-0.11.1.js";>

Re: Is this a reasonable use of core.async?

2014-09-17 Thread larry google groups
> We don't have streams of data here, the long running tasks have side-effects. I would > prefer to avoid adding another whole framework just to run a few long running jobs in p//. I guess I should show you some code, so you can see how simple this is. I'll copy-and-paste some code that I u

Re: Is this a reasonable use of core.async?

2014-09-17 Thread Beau Fabry
Thanks for that Larry but I think this is a bit of overkill for my scenario. The code I pasted is almost verbatim what we have in our production codebase, so the ability to queue new jobs etc is really not needed. Cheers though. On Thursday, September 18, 2014 9:38:47 AM UTC+10, larry google gr

Amazonica DynamoDB Atomic Counter

2014-09-17 Thread mark
Has anyone used Amazonica to implement an atomic counter in DynamoDB? I plan on having a Dynamo table with only one entry, something t

Re: Amazonica DynamoDB Atomic Counter

2014-09-17 Thread mark
If anyone is interested, my solution was: > (dynamo-client/update-item cred :table-name "atomic-counter" :key "counter" :attributeUpdates {:count {:value 1 :action "ADD"}}) {:consumed-capacity-units 1.0} > (dynamo-client/get-item cred :table-name "atomic-counter" :key "c

Re: Is this a reasonable use of core.async?

2014-09-17 Thread larry google groups
> Sounds like a job for a future. If he knows the workload, and he knows how many threads will be spun up, and he knows that the number will be reasonably small, then (future) is a good bet. But if there is any risk of large numbers of threads being spun up, then he should avoid calling (futur

Re: Is this a reasonable use of core.async?

2014-09-17 Thread larry google groups
> Thanks for that Larry but I think this is a bit of overkill for my scenario. If I'm counting correctly, your original example has 10 lines of code, and my example has 11 lines of code (minus the try/catch and the closure and the namespace declaration). So these 2 solutions are the same lengt

Re: Is this a reasonable use of core.async?

2014-09-17 Thread Beau Fabry
Larry your solution includes the cognitive overhead of another entire library and process model. "future" is part of core, and as I realised when Gary posted the doall's were unnecessary anyway. On Thursday, September 18, 2014 3:26:36 PM UTC+10, larry google groups wrote: > > > > Thanks for tha

Re: [ANN] Nginx-Clojure v0.2.5 released!

2014-09-17 Thread larry google groups
> JVMs are not goot at huge memory management. Configurable multiple JVM instances (is the > same number of Nginx Worker processes) will manage less memory. e.g. we have ten > Nginx Worker processes in one Nginx instance every JVM instance will only manage 1/10 memory This is a stupid quest