Re: core.async: "Deprecated - this function will be removed. Use transducer instead"

2015-02-18 Thread Ben Smith-Mannschott
Thanks Malcolm, you're blog post was a great help to me. On Thu, Feb 19, 2015 at 3:06 AM, Malcolm Sparks wrote: > I have recently written a blog article which explains how to use > transducers with core.async. > > You can find it here: http://malcolmsparks.com/posts/transducers.html > > > On Wed

[ANN] clean-blog @ modularity.org

2015-02-18 Thread Malcolm Sparks
I've added a blog-site template called 'clean-blog' to the collection at http://modularity.org - documented here: http://modularity.org/templates/clean-blog.html clean-blog is intended as a live site, rather than a static site generator like Cryogen: https://github.com/cryogen-project/cryogen ,

Re: core.async: "Deprecated - this function will be removed. Use transducer instead"

2015-02-18 Thread Malcolm Sparks
I have recently written a blog article which explains how to use transducers with core.async. You can find it here: http://malcolmsparks.com/posts/transducers.html On Wednesday, 18 February 2015 21:48:05 UTC, bsmith.occs wrote: > > I'm probably just especially dense today, but perhaps someone c

Accessing branches in PersistentTreeMap / sorted-map / CLJ-1008

2015-02-18 Thread David James
Summary: I'd like to find a public API to work with the underlying tree of a sorted-map. For example: (def t (sorted-map 1 :a 2 :b 3 :c 4 :d 5 :e 6 :f)) The underlying implementation of sorted-map uses a PersistentTreeMap, which can be accessed with `tree`: (.tree t) ;=> [2 :b] I have not f

Less than two days left for GSoC 2015

2015-02-18 Thread Daniel Solano Gómez
Hello, all, The deadline for applying to be a mentoring organization for Google Summer of Code is coming up in less than two days. To be able to have a strong and successful application, we really need potential mentors to post ideas onto our project ideas page

Re: How to create jar for data.int-map

2015-02-18 Thread Cecil Westerhof
2015-02-19 1:33 GMT+01:00 James Reeves : > The data.int-map repository has a project.clj file, so can't you use > Leiningen? > ​That worked like a charm. With googling I only encountered maven. ​ > Or alternatively, just download the pre-built jar from the Maven > repository? > ​I did not fin

Re: Summer of Code 2015

2015-02-18 Thread Daniel Solano Gómez
Yes, we are applying to be a mentoring organization. If you are a student, now would be a good time to start reaching out to potential mentors and ask them to have ideas posted on the project ideas page . Sincerely, Daniel On Tuesday, F

Re: Lucky Numbers again

2015-02-18 Thread Cecil Westerhof
2015-02-18 20:47 GMT+01:00 Steve Miner : > One more try. This time using the int-map contrib library. (Thanks to > Zack Tellman.) > > Warning: I'm assuming that the int-set seq is automagically sorted so I > can reliably turn it back into a vector without sorting. It seems to be > stable at leas

Re: How to create jar for data.int-map

2015-02-18 Thread James Reeves
The data.int-map repository has a project.clj file, so can't you use Leiningen? Or alternatively, just download the pre-built jar from the Maven repository? - James On 18 February 2015 at 23:00, Cecil Westerhof wrote: > I like to make a jar for contrib.data.int-map. But when I do: > mvn pac

Re: Continuously Integrating Leiningen Projects

2015-02-18 Thread Allen Rohner
CircleCI uses: https://github.com/circleci/lein-version-specs https://github.com/circleci/version-specs Which can be used to set the version string arbitrarily. Thanks, Allen On Wednesday, February 18, 2015 at 2:10:14 PM UTC-6, Michael Blume wrote: > > Afraid the plugin's internal. > > On Wed

Re: Performant flattening of nested data structures

2015-02-18 Thread Sébastien Bocq
Hi Mark, Here is a version runs about 1.3x faster on my setup. (defn flatten-keys [thing] (letfn [(-map-key [prefix k] (str prefix "." (name k))) (-seq-key [prefix i] (str prefix "[" i "]")) (-flatten-entry [make-key prefix result entry] (let [[k v] entry]

How to create jar for data.int-map

2015-02-18 Thread Cecil Westerhof
I like to make a jar for contrib.data.int-map. But when I do: mvn package I get: [INFO] --- clojure-maven-plugin:1.3.13:test (clojure-test) @ data.int-map --- Exception in thread "main" java.io.FileNotFoundException: Could not locate clojure/test/check/generators__init.class or clojure/test/che

Re: ANN: Onyx Dashboard 0.5.2.1

2015-02-18 Thread Michael Drogalis
Hi Colin, This is well supported within Onyx, and has seen recent progress (http://yuppiechef.github.io/cqrs-server/) The examples should give you a good indication if it's a fit for your problem (https://github.com/MichaelDrogalis/onyx-examples). We hang out in Gitter if you have any question

Re: core.async: "Deprecated - this function will be removed. Use transducer instead"

2015-02-18 Thread Erik Price
(let [out (async/chan 0 (map inc))] (async/pipe in out) out) Earlier in your email you mention printing, however. If you have I/O to perform (like printing), I’m told that you don’t want to do it in a transducer. You can use pipeline-async for this instead: (defn f [v ch] (async/go (pri

Re: Help with Liberator POST route

2015-02-18 Thread gvim
On 18/02/2015 15:32, Andy- wrote: Without having tested it: I think you're "curl -d" format is wrong. It's not semicolon separated: http://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request HTH That solved the curl data submission problem but I'm still ge

Re: Use core.async executor with aleph

2015-02-18 Thread Robin Heggelund Hansen
Thanks! :) -- 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 be patient with your first post. To unsubscribe from this group, send ema

core.async: "Deprecated - this function will be removed. Use transducer instead"

2015-02-18 Thread Ben Smith-Mannschott
I'm probably just especially dense today, but perhaps someone can give me a poke in the right direction. I'm trying to wrap my head around transducers. (1) For debugging purposes I'd like to be able to consume the values on a channel and put them in a collection to be printed. I'm doing this at

Re: Use core.async executor with aleph

2015-02-18 Thread Zach Tellman
Hi Robin, You can absolutely specify an executor of :none if you're sure you won't be doing any blocking in your request handler. If everything's wrapped by a go-block, that's certainly the case, and is probably the most efficient approach. However, Aleph just needs some java.util.concurrent.

Re: Lucky Numbers again

2015-02-18 Thread Cecil Westerhof
2015-02-18 18:25 GMT+01:00 Cecil Westerhof : > 2015-02-18 16:31 GMT+01:00 Tassilo Horn : > >> Here's my version: >> >> --8<---cut here---start->8--- >> (defn drop-every-nth [c n] >> (keep-indexed (fn [i el] >> (if (zero? (mod (inc i) n)) nil

Re: Lucky Numbers again

2015-02-18 Thread Cecil Westerhof
2015-02-18 20:47 GMT+01:00 Steve Miner : > One more try. This time using the int-map contrib library. (Thanks to > Zack Tellman.) > ​Not installed on my system. So for the moment I let it rest. -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups "C

Re: Continuously Integrating Leiningen Projects

2015-02-18 Thread Michael Blume
Afraid the plugin's internal. On Wed Feb 18 2015 at 2:34:32 AM Rick Moynihan wrote: > This sounds very close to what I'm looking for. > > Is this plugin opensourced or something you're using locally, as the > closest thing I can find to what you describe is lein-git-version: > > https://github.c

Re: Lucky Numbers again

2015-02-18 Thread Steve Miner
One more try. This time using the int-map contrib library. (Thanks to Zack Tellman.) Warning: I'm assuming that the int-set seq is automagically sorted so I can reliably turn it back into a vector without sorting. It seems to be stable at least. I wanted a vector for fast nth access. (Nth

Re: ANN: Onyx Dashboard 0.5.2.1

2015-02-18 Thread Colin Yates
Hi Lucas, This looks great - thanks. [off topic] I don't know much about Onyx but I am just about to start committing code for server app which is going to use a CQRS design. It doesn't need to be internet scale at all, will be a single machine, and spend all of its time taking a command, executi

ANN: Onyx Dashboard 0.5.2.1

2015-02-18 Thread Lucas Bradstreet
Onyx is a batch/stream processing hybrid, written in Clojure, for Clojure. https://github.com/MichaelDrogalis/onyx Today I released a dashboard for Onyx, that leverages Onyx's information model to provide some nifty monitoring and job management features. You can read about its use of its informat

Re: Lucky Numbers again

2015-02-18 Thread Cecil Westerhof
2015-02-18 16:31 GMT+01:00 Tassilo Horn : > Here's my version: > > --8<---cut here---start->8--- > (defn drop-every-nth [c n] > (keep-indexed (fn [i el] > (if (zero? (mod (inc i) n)) nil el)) > c)) > > (defn lucky-numbers [n]

Re: Using 1_000_000_000

2015-02-18 Thread Cecil Westerhof
2015-02-18 17:52 GMT+01:00 James Reeves : > It occurs to me that you could use a macro to fake this: > > (N 1,000,000,000) > > (defmacro N [& parts] > (apply + (map * (reverse parts) (iterate (partial * 1000) 1 > > But I wouldn't recommend it :) > ​I will not do that then. ;-)​

Re: Using 1_000_000_000

2015-02-18 Thread James Reeves
It occurs to me that you could use a macro to fake this: (N 1,000,000,000) (defmacro N [& parts] (apply + (map * (reverse parts) (iterate (partial * 1000) 1 But I wouldn't recommend it :) You could also just use exponents: 1e9 means the same thing as 10. - James On 1

Re: Lucky Numbers again

2015-02-18 Thread Cecil Westerhof
2015-02-18 16:31 GMT+01:00 Tassilo Horn : > Cecil Westerhof writes: > > > One problem is that max-value is used in the doc-string also, so if it > > changes, it has to be done at two places. Is there a way around this? > > I wouldn't specify a max-value at all. Some users might have enough > tim

Re: Using 1_000_000_000

2015-02-18 Thread Cecil Westerhof
2015-02-18 16:38 GMT+01:00 Gary Verhaegen : > As an alternative, I use: > > (* 1 1000 1000 1000) > ​Nice one. :-D​ > > On 18 Feb 2015, at 08:07, Cecil Westerhof wrote: >> >> >> In Java I can use: >> 1_000_000_000 >> >> This makes code a lot more readable. But it seems this is not possible

Re: Using 1_000_000_000

2015-02-18 Thread Cecil Westerhof
2015-02-18 16:33 GMT+01:00 Akos Gyimesi : > It is not possible in Clojure. This is the full regexp pattern for > integers: > > https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L67 > ​I was afraid for that, but wanted to be sure. On 18 Feb 2015, at 08:07, Cecil

Re: Using 1_000_000_000

2015-02-18 Thread Gary Verhaegen
As an alternative, I use: (* 1 1000 1000 1000) On Wednesday, 18 February 2015, Akos Gyimesi wrote: > Hi Cecil, > > It is not possible in Clojure. This is the full regexp pattern for > integers: > > https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L67 > > See a

Re: Using 1_000_000_000

2015-02-18 Thread Akos Gyimesi
Hi Cecil, It is not possible in Clojure. This is the full regexp pattern for integers: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L67 See also http://clojure.org/re

Re: Help with Liberator POST route

2015-02-18 Thread Andy-
Without having tested it: I think you're "curl -d" format is wrong. It's not semicolon separated: http://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request HTH On Wednesday, February 18, 2015 at 7:09:19 AM UTC-5, g vim wrote: > > I have a Liberator app which

Re: Lucky Numbers again

2015-02-18 Thread Tassilo Horn
Cecil Westerhof writes: > One problem is that max-value is used in the doc-string also, so if it > changes, it has to be done at two places. Is there a way around this? I wouldn't specify a max-value at all. Some users might have enough time to wait for the result, have faster machines, might u

Re: [ANN] clj-uuid: thread-safe, performant unique identifiers

2015-02-18 Thread danle...@gmail.com
These were really good suggestions. As you mentioned, I implemented a UUIDNameBytes Protocol with a default representation of UTF8 for strings and will directly pass-through byte-array local-part for use in v3/v5. On Tuesday, February 17, 2015 at 1:06:11 AM UTC-5, Francis Avila wrote: > > This

Lucky Numbers again

2015-02-18 Thread Cecil Westerhof
I have updated my Lucky Numbers code: (defn indexed-sieve "Removes all elements that have a position that is a multiply of index. With first position counting as 1." [index this-list] (keep-indexed (fn [i v] (if (= 0 (mod (inc i) index)) n

Help with Liberator POST route

2015-02-18 Thread gvim
I have a Liberator app which works with this: (defresource user [day month year hour min region location] :available-media-types ["application/json"] :handle-ok (generate-string (clc/calc day month year hour min 0 (str region "/" location (defroutes app-routes (GET "/user/:day/:month

Re: Continuously Integrating Leiningen Projects

2015-02-18 Thread Rick Moynihan
This sounds very close to what I'm looking for. Is this plugin opensourced or something you're using locally, as the closest thing I can find to what you describe is lein-git-version: https://github.com/cvillecsteele/lein-git-version Which seems to follow project middleware approach you describe