Save map contentns to external file?

2014-05-14 Thread Steven Jones
Hi I am developing an Overtone MIDI application and wish to save/read the state of a map to an external file. The map keys are always integers, specifically MIDI program numbers. The map values however have one of two forms. They are either explicit association list of key/value pairs or function

Asynchronous socket communication with agents

2014-05-14 Thread Dylan Gleason
I have a TCP socket connection in which I need to process several requests and conj each request and it's corresponding response to a vector for logging purposes. I need to transmit and receive via two asynchronous threads, where a transmit function is responsible for sending requests and a r

Re: [ANN] Throttler: a library for rate limiting

2014-05-14 Thread Atamert Ölçgen
Awesome! Thanks. On Thu, May 15, 2014 at 1:58 AM, Bruno Vecchi wrote: > Hm, apparently I forgot to post the links to the actual things I wanted to > share. > > Here they go: > > Github: https://github.com/brunoV/throttler > Blog Post: http://brunov.org/clojure/2014/05/14/throttler/ > > Bruno >

Re: setting environment variables for all repls?

2014-05-14 Thread guns
On Wed 14 May 2014 at 02:41:39PM -0800, Christopher Howard wrote: > Hey all, I want > > (set! *print-length* 40) > > to be run each time I open "lein repl" (regardless of the project, > preferably). I thought that is what the ~/.lein/init.clj file was for, > but apparently not. Set {:repl-options

setting environment variables for all repls?

2014-05-14 Thread Christopher Howard
Hey all, I want (set! *print-length* 40) to be run each time I open "lein repl" (regardless of the project, preferably). I thought that is what the ~/.lein/init.clj file was for, but apparently not. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

Re: [ANN] Automat: better FSMs through combinators

2014-05-14 Thread Alex Hammel
This looks really, really cool. Good work! On Wed, May 14, 2014 at 6:41 AM, Jason Felice wrote: > Wow, this library looks very useful! > > Thanks! > -Jason > > > On Tue, May 13, 2014 at 5:55 PM, Colin Fleming < > colin.mailingl...@gmail.com> wrote: > >> I'm also very excited about Automat, altho

Re: [ANN] Throttler: a library for rate limiting

2014-05-14 Thread Bruno Vecchi
Hm, apparently I forgot to post the links to the actual things I wanted to share. Here they go: Github: https://github.com/brunoV/throttler Blog Post: http://brunov.org/clojure/2014/05/14/throttler/ Bruno On Wednesday, May 14, 2014 1:43:34 PM UTC-3, Bruno Vecchi wrote: > > Throttler[1] is a li

Re: [ANN] Throttler: a library for rate limiting

2014-05-14 Thread Bruno Vecchi
Hm, apparently I forgot to post the links to the actual things I wanted to share. Here they go: Github: https://github.com/brunoV/throttle r Blog Post: http://brunov.org

Re: [ANN] Throttler: a library for rate limiting

2014-05-14 Thread Bruno Vecchi
Hm, apparently I forgot to post the links to the actual things I wanted to share. Here they go: Github: https://github.com/brunoV/throttle Blog Post: http://brunov.org/clojure/2014/05/14/throttler/ Bruno On Wednesday, May 14, 2014 1:43:34 PM UTC-3, Bruno Vecchi wrote: > > Throttler[1] is a lit

[ANN] Throttler: a library for rate limiting

2014-05-14 Thread Bruno Vecchi
Throttler[1] is a little library I wrote out of need for one of my personal projects. It lets you control the maximum rate of function calls or message transmissions through core.async channels. It supports bursty traffic shaping via the Token-Bucket algorithm and is fully asynchronous. I just

Re: [ANN] clojure.test.check 0.5.8

2014-05-14 Thread Steve Miner
On May 14, 2014, at 10:44 AM, Reid Draper wrote: > * Limit the number of retries for gen/such-that. A two-arity version is > provided if you need to retry more than 10 times. This should be a > code-smell, though. I think the limit is a good idea, but it's an extra wrinkle and ma

Re: Joy of Clojure question

2014-05-14 Thread kurofune
Haha, right on Gary! I used the later version of the original function, but the earlier call to the original function. Here is what it looked like in the beginning. This was an example of how not to write a function that looks up indices by value. The example code I posted above was the suppos

Re: Joy of Clojure question

2014-05-14 Thread Gary Johnson
Bridget and Guru are both right about the reason that \3 is found at position 13 in the string. However, the code you typed isn't valid Clojure, since the pos function expects pred to be a function of v. Thus, your pos call would need to look like this: (pos #(= % \3) ":a 4 :b 1 :c 3 :d 4") =>

Re: [ANN] Clojure RETE implementation - CLIPS-like expert system shell. New version 4.3

2014-05-14 Thread Ryan Brush
I'm less familiar with Waltz. It looks like a good way to exercise some worst-case scenarios in the rule engines as well. Like Ms Manners I don't think this is a very representative usage pattern but it could expose problems in extreme cases. -Ryan On Wednesday, May 14, 2014 8:28:41 AM UTC-5,

[ANN] clojure.test.check 0.5.8

2014-05-14 Thread Reid Draper
I'm please to announce clojure.test.check 0.5.8 [1], which is primarily a bugfix release. As usual, the release notes are available in the repository [2]. I've duplicated them here for convenience: * 0.5.8 * Limit the number of retries for gen/such-that. A two-arity version is provided

clojurescript: modifying function definitions

2014-05-14 Thread Mike Haney
There's a library for that - https://github.com/technomancy/robert-hooke/ -- 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

Re: [ANN] Automat: better FSMs through combinators

2014-05-14 Thread Jason Felice
Wow, this library looks very useful! Thanks! -Jason On Tue, May 13, 2014 at 5:55 PM, Colin Fleming wrote: > I'm also very excited about Automat, although I haven't had time to look > at it closely yet. Ragel is one of my favourite pieces of software. Here's > an article from Zed Shaw about usin

Re: [ANN] Clojure RETE implementation - CLIPS-like expert system shell. New version 4.3

2014-05-14 Thread ru
Hello Ryan, Have you look at Waltz test? You may be interested of this. Its CLIPS source is in examples folder of rete4frames. -Ru понедельник, 12 мая 2014 г., 17:47:44 UTC+4 пользователь ru написал: > > New feature: added Java interface. Eclipse project example. > > Home: https://github.com/ru

Re: test.check

2014-05-14 Thread Michał Marczyk
Sure, here's a possible approach: user> (gen/sample (gen/fmap (partial apply concat) (gen/list (gen/fmap #(repeat 3 %) gen/int (() () (0 0 0) (3 3 3 3 3 3 2 2 2) (3 3 3 2 2 2 0 0 0 3 3 3) (2 2 2) (-4 -4 -4 -6 -6 -6) (4 4 4 5 5 5) (7 7 7 3 3 3) (3 3 3 7 7 7 9 9 9 7 7 7 4 4 4 -4 -4 -4))

Re: [ANN] Clojure RETE implementation - CLIPS-like expert system shell. New version 4.3

2014-05-14 Thread Ryan Brush
Hey Ru, I avoided Miss Manners simply because it doesn't represent the usage patterns I have or expect, so I just have been profiling against the data I have for my use case. Of course, Ms Manners may be a a better reflection of your needs, in which case it could be a good benchmark. Micro-ben

test.check

2014-05-14 Thread Maciej Jaśkowski
Hi there, I would like to create a generator generating a list of ints with each value repeated a number of times e.g. (gen/sample gen-repeater [ 1 1 1 2 2 2 -1 -1 -1 9 9 9]) this (gen/sample (gen/bind gen/int (fn [i] (gen/return (take 5 (repeat i)) returns e.g. ((0 0 0 0 0) (-1 -1 -1 -1 -

Re: [ANN] Clojure RETE implementation - CLIPS-like expert system shell. New version 4.3

2014-05-14 Thread ru
Dave. It is a very good advice. Initially I tried to do as simple as possible. Now I will try to follow your advice and check what performance impact it may has. Ryan. RETE algorithm is a very basic and can be applied to a broad spectrum of tasks not only to expert systems. For example, I use i

Re: using atoms as logs for channels in core.async

2014-05-14 Thread Gary Verhaegen
The function map> takes a channel and a function, and returns a new channel; every time an element is sent through that new channel, it first goes through the given function (and it is the result of that function that is actually sent through the original channel). The function map< is similar, ex