Re: core.async count in a channel

2014-01-17 Thread Meikel Brandmeyer (kotarak)
Hi, the average channel has no queue. Processes freeze until the peer process arrives. So count doesn't make sense for the typical channel. If you want to implement a queue, you could create a process which accepts values on end and distributes to the other. Then you can keep also track of any

Re: core.async count in a channel

2014-01-17 Thread Meikel Brandmeyer (kotarak)
Bleh when you see the bug as you hit "Send" (defn queue-process [input output stats] (async/go ; Wait for the first input. (loop [v (async/ Empty queue. (identical? ch input) (recur nil (cons v q)) ; Write happened, and there is more in the queue.

Functional Programming Challenge at CodeSprint

2014-01-17 Thread Abhiranjan Kumar
Hi All There's a contest going to be held on 18'th Jan (tomorrow). This time there will be one functional programming challenge to be solved. Link: https://www.hackerrank.com/codesprint5 We started functional programming track few months ago and it's growing, https://www.hackerrank.com/tracks/

Looking for a Clojure expert for video training

2014-01-17 Thread marlene saucier
My company is looking for a Clojure expert who is interested in developing training videos for our partner. Gig pays well! Let me know!! Marlene -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goog

Best Informatica Online Training By Vast IT Expert trainers in Hyderabad | India | UK| USA

2014-01-17 Thread Sairam Shankar
Informatica Online Training by Sunitlabs We are providing excellent Informatica Training by real-time IT industry experts Our training methodology is very unique Our Course Content covers all the in- depth critical scenarios. We have completed more than 200 Informatica batches through Online

Re: Best Informatica Online Training By Vast IT Expert trainers in Hyderabad | India | UK| USA

2014-01-17 Thread Baishampayan Ghose
Please don't send spam to our mailing list. Thank you. ~BG On Fri, Jan 17, 2014 at 2:59 PM, Sairam Shankar wrote: > Informatica Online Training by Sunitlabs We are providing excellent > Informatica Training by real-time > > IT industry experts Our training methodology is very unique Our Course >

Re: Very strange behaviour in reducers

2014-01-17 Thread Yves Parès
Ok, but apparently I'm not the only one to be puzzled by this behaviour, which we may regard as an inconsistency. Just to know, is it planned to be changed? (so that I can note it and remember it if I have an error that appears in this part of my code after a clojure upgrade) Le mardi 14 janvie

Re: core.async count in a channel

2014-01-17 Thread Meikel Brandmeyer (kotarak)
Hi again, and some more golfing by Christophe: (defn queue-process-uncontrolled [input output stats] (async/go (loop [q clojure.lang.PersistentQueue/EMPTY] (let [[val-to-q ch] (async/alts! (if-let [v (peek q)] [input [output

Re: core.async count in a channel

2014-01-17 Thread t x
@Meikel: I am now convinced that you are right. It's clear to me that I completely underestimated the power / flexibility of the Channel abastraction. @World: I now retract my second-ing of "adding count to Protocol of Channel" On Fri, Jan 17, 2014 at 2:10 AM, Meikel Brandmeyer (kotarak) wrote:

Re: How to handle configuration in Clojure?

2014-01-17 Thread Malcolm Sparks
There's also Jig : https://github.com/juxt/jig Jig's recommendation is for configuration to be held in EDN files. I much prefer EDN over environment variables. Environment variables feel awkward when there you have lots of configuration, usually in the form of a tree. Usually it makes sense to

Re: how to check if something is a channel ?

2014-01-17 Thread Timothy Baldridge
Those interfaces are also broken into ReadPort, WritePort and Channel. Each protocol defines (in order), read, write, and close!. So you can check on or all of those for only the ops you need. Note however, anything under clojure.core.async.impl is subject to change without notice in future versio

Re: Possible heisenbug in test suite (not in individual test runs) with memoization

2014-01-17 Thread Alex Miller
Further, in Clojure <= 1.5.1, (= 1M 1.0M) => false. Please note, this behavior has changed in 1.6. On Monday, January 6, 2014 12:21:13 PM UTC-6, Justin Kramer wrote: > > Shot in the dark: check that arguments passed to your memoized functions > use consistent typing. A BigDecimal such as 1M does

Re: functions inside of go blocks

2014-01-17 Thread Alex Miller
You can definitely call functions, just not ones use the channel ops. The recommendation is to keep the io ops inside the go block and pull your logic into external functions. There are two benefits to this approach: 1) You keep all the impure io stuff together in the go block while putting y

Using macro to generate boilerplate keywords

2014-01-17 Thread Kashyap CK
Hi, I am exploring javax.sound.midi using clojure and while creating keywords for notes I wonder if I could use macros to generate the keywords - (defn note-2-num [n] (let [ m { :C1 0 :C#1 1 :D1 2 :D#1 3 :E1 4 :F1 5

Re: Using macro to generate boilerplate keywords

2014-01-17 Thread Timothy Baldridge
perhaps something like: (zipmap (range) (for [octave (range 8) key ["C" "C#" "D" "D# ...]] (keyword (str key octave Timothy On Fri, Jan 17, 2014 at 9:21 AM, Kashyap CK wrote: > Hi, > > I am exploring javax.sound.midi using clojure and whi

Re: Using macro to generate boilerplate keywords

2014-01-17 Thread Alex Walker
Is a macro necessary? https://gist.github.com/alexpw/8476780 On Friday, January 17, 2014 10:21:52 AM UTC-6, Kashyap CK wrote: > > Hi, > > I am exploring javax.sound.midi using clojure and while creating keywords > for notes I wonder if I could use macros to generate the keywords - > > (defn note

Re: Using macro to generate boilerplate keywords

2014-01-17 Thread Kashyap CK
Thanks Alex ... I believe, pre-computing the map upfront would be more efficient. But yeah, looks like macros are not required as Timothy has shown. Regards, Kashyap On Friday, January 17, 2014 10:20:31 PM UTC+5:30, Alex Walker wrote: > > Is a macro necessary? > > https://gist.github.com/alexpw/

Re: Managing role-based permissions in Ring apps

2014-01-17 Thread Sam Ritchie
Okay, here's my post: http://sritchie.github.io/2014/01/17/api-authentication-with-liberator-and-friend/ This is basically everything I understand about Friend, plus my integrations with Liberator. The code's in this example project: https://github.com/paddleguru/liberator-friend Hope this h

RESTful API Auth with Friend and Liberator

2014-01-17 Thread Sam Ritchie
Hey guys, Those of you working on webapps might find this interesting: http://sritchie.github.io/2014/01/17/api-authentication-with-liberator-and-friend/ Enjoy! -- Sam Ritchie (@sritchie) Paddleguru Co-Founder 703.863.8561 www.paddleguru.com Twitter

Re: Looking to migrate thousands of Clojure applications from 1.2 to 1.5.

2014-01-17 Thread Vijay Kiran
May be this would help? https://github.com/flatland/classlojure On Thursday, January 16, 2014 5:13:11 PM UTC+1, solo...@gmail.com wrote: > > Quick update and question: We've put together a preliminary migration plan > and are considering options. > > Can someone share information or point me t

Re: RESTful API Auth with Friend and Liberator

2014-01-17 Thread Mimmo Cosenza
:-) mimmo On Jan 17, 2014, at 10:27 PM, Sam Ritchie wrote: > Hey guys, > > Those of you working on webapps might find this interesting: > > http://sritchie.github.io/2014/01/17/api-authentication-with-liberator-and-friend/ > > Enjoy! > -- > Sam Ritchie (@sritchie) > Paddleguru Co-Founder > 70

Factual is hiring Clojure engineers

2014-01-17 Thread Zach Tellman
It's been six months since I last announced this, so: Factual is perpetually hiring smart, driven engineers to solve deep problems in data analysis and systems engineering. We have offices in both SF and LA, and remote candidates with a strong background in analysis will be considered. Factual

Re: RESTful API Auth with Friend and Liberator

2014-01-17 Thread Curtis Gagliardi
Exactly the kind of article I was going to looking for in a few days, excellent. On Friday, January 17, 2014 1:27:10 PM UTC-8, Sam Ritchie wrote: > > Hey guys, > > Those of you working on webapps might find this interesting: > > > http://sritchie.github.io/2014/01/17/api-authentication-with-libe

Re: How to handle configuration in Clojure?

2014-01-17 Thread Curtis Gagliardi
I've been using carica (https://github.com/sonian/carica) and have config map like {:dev <...> :prod <...>} and just using a single environmental variable to determine which of those config maps to use. On Friday, January 17, 2014 5:06:31 AM UTC-8, Malcolm Sparks wrote: > > There's also Jig : h

Re: Using macro to generate boilerplate keywords

2014-01-17 Thread Kashyap CK
Thank you so much Timothy .. this is just what I was looking for ... On Friday, January 17, 2014 10:03:12 PM UTC+5:30, tbc++ wrote: > > perhaps something like: > > (zipmap (range) > (for [octave (range 8) > key ["C" "C#" "D" "D# ...]] > (keyword (

Re: RESTful API Auth with Friend and Liberator

2014-01-17 Thread clojure . user
Thanks! I have been looking at a lot of combinations for the front end to go with the liberator/friend back end e.g. using client-side technologies om(clojurescript) purnam (angularjs + clojurescript) or going for a server side hiccup/enlive templating + clojurescript (for any client side js)

nested #%'s

2014-01-17 Thread t x
## Question: Is there a way to do nested, #%'s, where each % matches to the nearest "parent" #. ## Counter Argument: You don't want this, it makes Clojure code hard to read. ## Counter Counter Argument: Despite it being hard to read, I'd like to try it for a few months, and see if I can

idiomatic extension to -> / --> ?

2014-01-17 Thread t x
I have the following: (defn helper [initial funcs] (loop [fns funcs ans initial] (if (empty? fns) ans (recur (rest fns) (list (first fns) ans) (defmacro => [initial & funcs] (helper initial funcs)) (macroexpand-1 '(=> 2 #(+ % 2) #(* 1 %

Re: idiomatic extension to -> / --> ?

2014-01-17 Thread Shaun Gilchrist
https://github.com/rplevy/swiss-arrows On Fri, Jan 17, 2014 at 11:05 PM, t x wrote: > I have the following: > > (defn helper [initial funcs] > (loop [fns funcs > ans initial] > (if (empty? fns) > ans > (recur (rest fns) > (list (first fns) ans) > > (d

Re: idiomatic extension to -> / --> ?

2014-01-17 Thread t x
You win. :-) On Fri, Jan 17, 2014 at 11:26 PM, Shaun Gilchrist wrote: > https://github.com/rplevy/swiss-arrows > > > On Fri, Jan 17, 2014 at 11:05 PM, t x wrote: > >> I have the following: >> >> (defn helper [initial funcs] >> (loop [fns funcs >> ans initial] >> (if (empty? fns)

Re: nested #%'s

2014-01-17 Thread Softaddicts
The reader does not support this and the reader is not configurable. Quite a final end to any counter...counter argument :) #() is syntactic sugar and not designed to play Russian puppets with anonymous fns :) (or Russian roulette ?) As a general remark, when you need imbricated anonymous fns i