Re: [ANN] trapperkeeper 1.4.1

2017-01-30 Thread Timothy Washington
Hey Matthaus, I did notice some issues, when trying to use it with Clojure 1.9. Some of the specs were failing when run against Trapperkeeper 1.5.2. On Mon, Jan 30, 2017 at 11:44 AM, Matthaus Owens wrote: > > > On Mon, Jan 30, 2017 at 11:25 AM, Matthaus Owens > wrote: > >> Tim, >> Yes, trappe

Re: structuring parallel code

2017-01-30 Thread Brian Craft
I think java locks may be the only good answer. I can't usefully divide the vector, because the distribution of updates is uniform along the length of it. Perhaps there's a solution with queues, with multiple threads generating potential placements, and a single thread updating the vector and

Re: structuring parallel code

2017-01-30 Thread Timothy Baldridge
We really need more information if you're expecting us to offer any help at all. How many items are you updating, what are your update patterns, what is in these refs, are do you need to modify more than one ref in a single "transaction". All this impacts the correct approach. But with such a lack

Re: structuring parallel code

2017-01-30 Thread Brian Craft
I don't think parallel reducers can handle the conflict issue: two threads making incompatible changes to the vector. On Monday, January 30, 2017 at 7:01:22 PM UTC-8, Josh Tilles wrote: > > If your goal is “to operate on large data structures in parallel” then > you’ll probably find Clojure’s re

Re: structuring parallel code

2017-01-30 Thread Alex Miller
One technique is to batch locks at a coarser granularity. You've explored both ends of the spectrum - 1 lock and N locks. You can also divide the overall vector into any group of refs between 1 and N. If refs are too heavy, there are several other locking mechanisms on the JVM. You could try Cl

Re: structuring parallel code

2017-01-30 Thread Josh Tilles
If your goal is “to operate on large data structures in parallel” then you’ll probably find Clojure’s reducers library to be helpful. On Monday, January 30, 2017 at 9:38:01 PM UTC-5, Brian Craft wrote: > > ans: this scales badly. > > There must be a way i

Re: structuring parallel code

2017-01-30 Thread Timothy Baldridge
Please define "scales badly" what are you measuring to reach that conclusion? On Mon, Jan 30, 2017 at 7:38 PM, Brian Craft wrote: > ans: this scales badly. > > There must be a way in clojure to operate on large data structures in > parallel, no? > > > On Monday, January 30, 2017 at 6:03:39 PM UT

Re: structuring parallel code

2017-01-30 Thread Brian Craft
ans: this scales badly. There must be a way in clojure to operate on large data structures in parallel, no? On Monday, January 30, 2017 at 6:03:39 PM UTC-8, Brian Craft wrote: > > Would this not scale badly? When the vector is hundreds of thousands, or > millions? > > On Monday, January 30, 201

Re: structuring parallel code

2017-01-30 Thread Timothy Baldridge
As you mentioned, what you're battling right now is contention. In your existing code the threads always conflict. No matter what, only one thread's update can succeed, the others will fail and have to re-run. With the refs-in-a-vector approach as long as two threads don't touch the same cell (ref)

Re: structuring parallel code

2017-01-30 Thread Brian Craft
Would this not scale badly? When the vector is hundreds of thousands, or millions? On Monday, January 30, 2017 at 5:54:32 PM UTC-8, tbc++ wrote: > > Instead of looking at the state as a ref with a vector in it, think of it > as a vector of refs. That then allows multiple refs to be modified at o

Re: structuring parallel code

2017-01-30 Thread Timothy Baldridge
Instead of looking at the state as a ref with a vector in it, think of it as a vector of refs. That then allows multiple refs to be modified at once without stepping on other unrelated refs. On Mon, Jan 30, 2017 at 5:26 PM, Brian Craft wrote: > I'm experimenting with ref, dosync, and alter to ru

Re: clojure.core.match/match: very strange behavior

2017-01-30 Thread Josh Tilles
I’m not 100% sure about any of this, but I think you’re tripping on how core.match handles symbols . So in (match dt dt2 true :else false), the code is *not* comparing the value in the dt Var to the value in the dt2 Va

structuring parallel code

2017-01-30 Thread Brian Craft
I'm experimenting with ref, dosync, and alter to run some code in parallel, but so far haven't been able to figure out how to structure it such that it runs faster, instead of slower. The problem looks something like this. The current state is a long vector. Input is a long sequence of values.

ANN: kabel 0.2.0 - A library for simple wire-like connectivity semantics.

2017-01-30 Thread Christian Weilbach
Hi, I am pleased to announce the 0.2.0 version of kabel. It mainly provides a new websocket client for the JVM with tyrus. This finally solved race conditions (not multithreading, but an unsafe API) I had with http.async.client (and the underlying apache websocket client). The http.async.client is

clojure.core.match/match: very strange behavior

2017-01-30 Thread Joachim De Beule
Does anybody understand what is going on here? (require '[clojure.core.matcher :refer [match]] (import '[org.joda.time DateTimeZone DateTime]) (def dt (DateTime. 2013 02 12 4 30 0 (DateTimeZone/forOffsetHours -2))) (def dt2 (clj-time.coerce/from-string "2013-02-12T04:30:00.000-02:00")) (match dt

Re: if nil is true

2017-01-30 Thread Leon Grapenthin
Hi Sayth, welcome to Clojure. Read like this: (nil? nil) ;-> true Is nil nil? True. (true? nil) ;-> false Is nil true? False. Kind regards, Leon. On Monday, January 30, 2017 at 8:34:09 AM UTC+1, Sayth Renshaw wrote: > > Hi > > If nil is true > > clojure-noob.core> (nil? nil) > true > > Th

Re: if nil is true

2017-01-30 Thread Mars0i
On Monday, January 30, 2017 at 1:34:09 AM UTC-6, Sayth Renshaw wrote: > > Hi > > If nil is true > > clojure-noob.core> (nil? nil) > true > Similarly, user=> (false? false) true -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: making a tree from map

2017-01-30 Thread Mark Engelberg
Depending on your needs, you may instead want to consider converting your data to a graph data structure, rather than a tree. The benefits are that it will deal properly with cycles, multiple components, or diverging and re-converging paths. Then in graph form you will be able to run a large libr

Re: [ANN] trapperkeeper 1.4.1

2017-01-30 Thread Matthaus Owens
Tim, Yes, trapperkeeper is still being developed and maintained. In addition to the jira link already posted (https://tickets.puppetlabs.com/browse/TK), github issues at https://github.com/puppetlabs/trapperkeeper/issues also work. If you are seeing specific issues when running against clojure 1.9,

Re: [ANN] trapperkeeper 1.4.1

2017-01-30 Thread Matthaus Owens
On Mon, Jan 30, 2017 at 11:25 AM, Matthaus Owens wrote: > Tim, > Yes, trapperkeeper is still being developed and maintained. In addition to > the jira link already posted (https://tickets.puppetlabs.com/browse/TK), > github issues at https://github.com/puppetlabs/trapperkeeper/issues also > work.

[ANN] Gorilla REPL v0.4.0

2017-01-30 Thread Jony Hudson
Hi All, it's a pleasure to announce a new release of Gorilla REPL :-) For those that haven't seen it before, Gorilla REPL is a browser-based notebook environment for Clojure that lets you make interactive documents with tables, graphs etc. The most important thing to note about this release i

Re: [ANN] trapperkeeper 1.4.1

2017-01-30 Thread Timothy Washington
Too right. Ok cool. Cheers! Tim On Mon, Jan 30, 2017 at 5:47 AM, Daniel Compton < daniel.compton.li...@gmail.com> wrote: > The JIRA > > still > looks fairly active. > > On Mon, Jan 30

ANN: s3-wagon-private 1.3.0

2017-01-30 Thread Daniel Compton
Hi folks s3-wagon-private is a Maven wagon that lets you use a private S3 bucket to store your Maven dependencies. 1.3.0 has been released with a long awaited feature thanks to Sheel Choksi : native AWS authenticatio

ANN: clojure-postmark 1.4.0

2017-01-30 Thread Daniel Compton
Hi folks clojure-postmark is a library for talking to postmarkapp.com, a transactional email service. I’ve taken over maintenance from Steve Losh, big thanks to him for creating it. It has a new release out with a bunch of small improvements qua

Re: [ANN] trapperkeeper 1.4.1

2017-01-30 Thread Daniel Compton
The JIRA still looks fairly active. On Mon, Jan 30, 2017 at 11:22 AM Timothy Washington wrote: > Is trapperkeeper still actively being developed and maintained? I'm having > trouble usin

Re: making a tree from map

2017-01-30 Thread Robert Aaron Zawiasa
I got a perfect answer from @moxaj on Clojurians Slack: https://clojurians.slack.com/files/moxaj/F3Y6J1X0S/-.clj -- 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 mem

making a tree from map

2017-01-30 Thread Robert Aaron Zawiasa
Hi everyone, I have a map like this: (def answer42 {:world [:space :planets :stars], :space [:spaceship :asteroid], :spaceship [:bob :spacesuit], :planets [:mars], :mars [:water :base], :base [:garden :livingroom], :garden [:mary]}) My question is: *How can i make a tree from it?like thi

Re: if nil is true

2017-01-30 Thread Andy Fingerhut
Sayth, check out these examples and see if they clarify anything for you. user=> nil nil user=> (if nil "nil is truthy" "nil is falsey") "nil is falsey" user=> (nil? nil) true user=> (if (nil? nil) "(nil? nil)=true is truthy" "(nil? nil)=true is falsey") "(nil? nil)=true is truthy" user=> (num

Re: if nil is true

2017-01-30 Thread Sayth Renshaw
On Monday, 30 January 2017 19:02:08 UTC+11, Sayth Renshaw wrote: > > > > On Monday, 30 January 2017 18:53:44 UTC+11, Alan Forrester wrote: >> >> >> > Hi >> > >> > If nil is true >> > >> > clojure-noob.core> (nil? nil) >> > true >> > >> > Then why doesn't nil return from this statement as t

Re: if nil is true

2017-01-30 Thread Sayth Renshaw
On Monday, 30 January 2017 18:53:44 UTC+11, Alan Forrester wrote: > > > > Hi > > > > If nil is true > > > > clojure-noob.core> (nil? nil) > > true > > > > Then why doesn't nil return from this statement as the first true value? > > This expression is a function invocation. The function is