Re: How did you learn Clojure?

2014-03-27 Thread Aditya Athalye
@Marcus, Thanks for your kind words, Marcus. @Gareth, +1. I feel re-implementing a past solution is a really good learning technique. Half the battle is to correctly understand a problem/domain and work out how to solve it. No point taking on that kind of friction if the purpose is to learn a ne

Unexpected core.async timeout behaviour

2014-03-27 Thread Peter Taoussanis
Hi all, quick question: `(dotimes [_ 5] (go ( java.lang.AssertionError: Assert failed: No more than 1024 pending takes are allowed on a single channel. It appears (?) that there's a (surprisingly low?) limit to the number of unique timeout timestamps that can be simultaneously queued. Is

Re: Writing tests for a live trading API?

2014-03-27 Thread dm3
I would strongly recommend against doing tests against a live exchange, because there are just too many failure modes (network down, exchange down, exchange hostname changed, etc.) as well as the possibility to execute trades and lose money. What I usually do is this: * create stub requests/re

Re: om: state management considerations

2014-03-27 Thread Jeff Rose
There is some explanation about component local state in the documentation here: https://github.com/swannodette/om/wiki/Conceptual-overview UI components will often have transient state that really doesn't make sense to expose externally. For example the characters in an input as someone is t

Re: looking for a lzw decompress routine written in clojure

2014-03-27 Thread bww00amd...@yahoo.com
yep, i actually have one but i thought it would be easier with all clojure. i am going to go ahead and look at the clojure > java class interop with the lzw java class i have i am on a learn clojure quest Thanks again On Thursday, March 27, 2014 5:09:52 PM UTC-5, bww00...@yahoo.com wrote: > > >

Re: anyone in Santa Cruz?

2014-03-27 Thread Brian Craft
Great to see some replies! Starting an email thread to arrange details. On Thu, Mar 27, 2014 at 5:04 PM, Paul Mooser wrote: > I'm also in Santa Cruz. > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to c

Re: [ANN] Clojure 1.6

2014-03-27 Thread David Nolen
It looks like the zip file that usually included with the releases is missing? http://repo1.maven.org/maven2/org/clojure/clojure/1.5.1/ vs. http://repo1.maven.org/maven2/org/clojure/clojure/1.6.0/ Thanks, David On Tue, Mar 25, 2014 at 7:00 AM, Alex Miller wrote: > We are pleased to announce

Re: anyone in Santa Cruz?

2014-03-27 Thread Paul Mooser
I'm also in Santa Cruz. -- 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

Re: anyone in Santa Cruz?

2014-03-27 Thread Dave Ray
I'd be interested. Dave On Thu, Mar 27, 2014 at 1:04 PM, Tim wrote: > Yes, please! > > > On Thursday, March 27, 2014 10:21:32 AM UTC-7, Brian Craft wrote: > >> Looking for clojure users in the Santa Cruz, Ca area who are interested >> in a meetup, study group, etc. >> > -- > You received this

Re: Concurrency, Parallelism, and State. And Zombies.

2014-03-27 Thread Daniel Higginbotham
Thanks for the positive feedback, Gary and Di :) It's very encouraging to me. Daniel -- 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 - pleas

Re: looking for a lzw decompress routine written in clojure

2014-03-27 Thread Gary Trakhman
Why? A java one exists. On Thu, Mar 27, 2014 at 6:09 PM, bww00amd...@yahoo.com < bww00amd...@yahoo.com> wrote: > > > Thanks > Bryan > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.co

looking for a lzw decompress routine written in clojure

2014-03-27 Thread bww00amd...@yahoo.com
Thanks Bryan -- 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, sen

[ANN] Clojure cheat sheet (v13)

2014-03-27 Thread Andy Fingerhut
The version published at http://clojure.org/cheatsheet has been updated to the latest version, with new functions and macros added to Clojure 1.6 marked with (1.6) before them. There is a link near the top of that page "Download other versions with tooltips" that links to a page with several other

Re: vim-fireplace debug workflow: modifying jars

2014-03-27 Thread Brian Craft
This seems like the right approach, but something is odd about the namespacing. Details: 0) using vim-fireplace 1) I jump into honeysql-0.4.2.jar::honeysql/format.clj 2) edit the format fn to always return "foo", and eval the new fn definition 3) Eval (format {:select [5]}) in the format.clj spli

Re: anyone in Santa Cruz?

2014-03-27 Thread Tim
Yes, please! On Thursday, March 27, 2014 10:21:32 AM UTC-7, Brian Craft wrote: > > Looking for clojure users in the Santa Cruz, Ca area who are interested in > a meetup, study group, etc. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: anyone in Santa Cruz?

2014-03-27 Thread Stanislav Sedov
On Mar 27, 2014, at 10:21 AM, Brian Craft wrote: > Looking for clojure users in the Santa Cruz, Ca area who are interested in a > meetup, study group, etc. > I’m in Sunnyvale and using Clojure occasionally. Not exactly Santa Cruz, but I travel there often. -- ST4096-RIPE signature.asc

Re: anyone in Santa Cruz?

2014-03-27 Thread John Wetherill
Yes - would love to participate in any Santa Cruz -based Clojure meetups/discussions. I work at Cruzio a few days a week. On Thursday, March 27, 2014 10:21:32 AM UTC-7, Brian Craft wrote: > > Looking for clojure users in the Santa Cruz, Ca area who are interested in > a meetup, study group, et

Re: vim-fireplace debug workflow: modifying jars

2014-03-27 Thread Moritz Ulrich
Checking out a project your project depend on, finding the right version, etc. is quite cumbersome. With Emacs/nrepl, you can just press M-. over any function to jump to the definition, even when it's inside a jar. You can also edit and reload it (via C-c C-c). I don't think you can save it, but t

Tales From Clojure/West 2014

2014-03-27 Thread John Wetherill
I attended Clojure/West this week and wanted to send kudos to the organizers and Clojure community in general: this was an exciting event, one of the best development shows I've attended in terms of quality, enthusiasm, very high signal to noise ratio, and technical content. I wrote up a quick

Re: vim-fireplace debug workflow: modifying jars

2014-03-27 Thread Michael Blume
Don't worry about the jar, especially. You can have your own git checkout of the upstream project you're working with, and that'll work just fine. Open a source file you need to work with, connect with nrepl, edit a function, and eval -- that should be enough. On Thursday, March 27, 2014 11:43:

vim-fireplace debug workflow: modifying jars

2014-03-27 Thread Brian Craft
Describing my debug workflow woes at clojure/west, it was suggested to me that I could jump into the jar file for a library and add print statements to elucidate its inner workings. I guess this is supported in emacs? Jump into the library source jar, edit, reload into the repl? How does this w

Re: updating the last member

2014-03-27 Thread Andy Smith
I was hoping there would be something like the :last keyword out of the box? -- 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 patie

Re: updating the last member

2014-03-27 Thread Jozef Wagner
(defn update-in* [m [k & ks] f & args] (let [k (if (and (instance? clojure.lang.Indexed m) (integer? k) (neg? k)) (+ (count m) k) k)] (if ks (assoc m k (apply update-in* (get m k) ks f args)) (assoc m k (apply f (ge

Re: dependencies from github

2014-03-27 Thread dgrnbrg
Voom is a Lein plugin that lets you depend on a repository and pins you to a specific commit. It also provides tools manage systems spanning multiple repos. You can find it here: https://github.com/LonoCloud/lein-voom and see the video from clojure/west here: https://m.youtube.com/watch?v=axztc

Re: Concurrency, Parallelism, and State. And Zombies.

2014-03-27 Thread Gary Johnson
Great job on such a tricky chapter. I particularly enjoyed the hilarious examples in the spirit of Learn You a Haskell for Great Good. ~Gary On Wednesday, March 26, 2014 9:45:38 AM UTC-4, Daniel Higginbotham wrote: > > I've added a new chapter to Clojure for the Brave and True, "Concurrency,

anyone in Santa Cruz?

2014-03-27 Thread Brian Craft
Looking for clojure users in the Santa Cruz, Ca area who are interested in a meetup, study group, etc. -- 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

Re: updating the last member

2014-03-27 Thread Mark Engelberg
Or you could write your own custom version of update-in that recognizes the keyword ::last to have a special meaning, so you could do: (update-in [1 2 ::last 1 ::last] ...) On Thu, Mar 27, 2014 at 8:57 AM, Jozef Wagner wrote: > Calling count on vector is a constant time operation, so I think (d

[Video] Game development in Clojure (with play-clj)

2014-03-27 Thread James Trunk
Hi everyone, I thought some of you might be interested to watch my screencast about game development in Clojure with play-clj . Cheers, James -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to t

Re: split maps contained in a file

2014-03-27 Thread Mauricio Aldazosa
Slurp returns one big string, in this case (assuming you have one map for each line) you can use line-seq: user> (with-open [rdr (clojure.java.io/reader "file-with-maps")] (doall (map read-string (line-seq rdr ({:a 1, :b 2} {:c 3, :d 4}) Cheers, Mauricio -- You received th

Re: How did you learn Clojure?

2014-03-27 Thread Marcus Blankenship
Awesome, thanks for the advice. I need to find something I've written and translate it to Clojure... On Mar 26, 2014, at 7:14 PM, gaz jones wrote: > A technique I use whenever I need to learn a new language is to write the > same application I already have in another language. I generally cho

split maps contained in a file

2014-03-27 Thread emptya45
Hi, I have a Clojure file that contains two maps. {:a 1 :b 2} {:c 3 :d 4} I would like to read both maps as Clojure data structures, but if I: (read-string (slurp maps.clj)) Only the first map is returned. I would like to read the file and split or partition the maps and hold onto them a

Re: core.async threadpool size

2014-03-27 Thread icamts
Thank you again Ben, now it is more clear. Luca Il giorno giovedì 27 marzo 2014 16:43:51 UTC+1, Ben Mabey ha scritto: > > If you want or need to block in a go-block then you should use the > `thread` macro instead of the `go` macro. A thread macro block will be ran > in a cached thread pool a

Re: dependencies from github

2014-03-27 Thread Phil Hagelberg
On Thursday, March 27, 2014 7:16:36 AM UTC-7, Aaron Cohen wrote: > If "version" doesn't end in "-SNAPSHOT", then lein (deferring to the way maven works) > will retrieve that dependency to your local $HOME/.m2/repository/not-really-trusted-package/version > directory, and never update it again (be

Re: updating the last member

2014-03-27 Thread Jozef Wagner
Calling count on vector is a constant time operation, so I think (dec (count v)) is an acceptable and even idiomatic in this case. Make it a function if it is too verbose for you. (let [assoc-last #(assoc % (dec (count %)) %2) ] (update-in [1 [1 2 [1 2 3]]] [1 2] #(assoc-last % 5))) Jozef On Th

Re: core.async threadpool size

2014-03-27 Thread Ben Mabey
If you want or need to block in a go-block then you should use the `thread` macro instead of the `go` macro. A thread macro block will be ran in a cached thread pool as you seem to be wanting: https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L379 Just

Re: core.async threadpool size

2014-03-27 Thread icamts
Thank you Ben. Can we speculate on a go-off macro? Like in agents send / send-off to have go-off blocks executed by a cached thread pool executor? Luca Il giorno giovedì 27 marzo 2014 16:01:16 UTC+1, Ben Mabey ha scritto: > > I asked Timothy Baldridge about this on IRC when the change was made

Re: creating a map

2014-03-27 Thread Armando Blancas
To add a little, into is generic and has no special treatment if the collection is a map, but works with maps if the elements are vectors because map associations of key-value pairs are a subclass of vector. The other way around: user=> (for [elem {:foo :bar}] elem) ([:foo :bar]) ; extracts :foo

Re: updating the last member

2014-03-27 Thread Mauricio Aldazosa
Try something like this: (let [xs [1 2 3]] (conj (pop xs) 4)) Cheers, Mauricio -- 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 - ple

Re: core.async threadpool size

2014-03-27 Thread Ben Mabey
I asked Timothy Baldridge about this on IRC when the change was made that added 42 and this was the reply I got: we're trying to strike a balance there, we don't want people to do IO inside a go block, but if they have to we'd don't want it to totally stall out. Here is the full conversation

Re: updating the last member

2014-03-27 Thread Andy Smith
P.P.S My assumption that I could use lists fails because lists arent associative so the following doesnt work either : (let [xs '(1 2 3)] (assoc xs 0 2)) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@g

core.async threadpool size

2014-03-27 Thread icamts
Hi all, quite a funny question. Thread pool size in core.async is twice the number of processors plus 42. https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/exec/threadpool.clj 42? The question is: 1) should it be 4 or 2? 2) 42 is the response to life,

Re: updating the last member

2014-03-27 Thread Andy Smith
P.S. in the above, I am assuming that the length of the leaf vector [1 2 3] is not known : i.e. I cant call (assoc-in [1 [1 2 [1 2 3]]] [1 2 2] 5) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

updating the last member

2014-03-27 Thread Andy Smith
Hi, (1) I'm sure there must be a simpler way to update the last element of a vector other than dec and count : (let [xs [1 2 3]] (assoc xs (dec (count xs)) 4)) This gets messy when updating vectors in nested data structures : (update-in [1 [1 2 [1 2 3]]] [1 2] #(assoc % (dec (count %)) 5))

Re: Garden, Thorn - Looking for contributors

2014-03-27 Thread Joel Holdbrooks
Thanks! I'll be in touch. On Tuesday, March 25, 2014 1:54:23 PM UTC-7, Alan Moore wrote: > > Joel, > > Count me in... > > You can contact me offline at kahunamoore coopsource org > > Thanks for this library! > > Alan > > > On Tuesday, March 25, 2014 12:33:15 PM UTC-7, Julien wrote: >> >> Hi Joel

Re: Garden, Thorn - Looking for contributors

2014-03-27 Thread Joel Holdbrooks
I've answered this question numerous times and am convinced I need to write a blog post so I can just drop a link. In general the biggest win is that you can use Clojure and all of the facilities therein to write more sophisticated stylesheets. Large CSS codebases are notoriously hard to manage

Re: dependencies from github

2014-03-27 Thread Aaron Cohen
I think you have 1 minor misunderstanding about how lein is working here. Lein isn't checking "not-really-trusted-package" out of github, it's retrieving the corresponding "artifact" from a maven-style repository. If "version" doesn't end in "-SNAPSHOT", then lein (deferring to the way maven work

Re: dependencies from github

2014-03-27 Thread David Powell
On Thu, Mar 27, 2014 at 10:23 AM, David Powell wrote: > If you checkout the package to checkouts/not-really-trusted-package, then > that version will automatically be used instead. > > https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies > (Though this is in

Re: dependencies from github

2014-03-27 Thread David Powell
If you checkout the package to checkouts/not-really-trusted-package, then that version will automatically be used instead. https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies -- Dave On Thu, Mar 27, 2014 at 9:16 AM, t x wrote: > Hi, > > ## Context: > >

Re: dependencies from github

2014-03-27 Thread Ray Miller
Have you considered pushing your build of the package to Clojars under the org.clojars.USERNAME group? Ray. On 27 March 2014 09:16, t x wrote: > Hi, > > ## Context: > > * I'm using lein. > * In my project.clj, I have something like: > > :dependencies[ [org.clojure/clojure "1.5.1"] >

dependencies from github

2014-03-27 Thread t x
Hi, ## Context: * I'm using lein. * In my project.clj, I have something like: :dependencies[ [org.clojure/clojure "1.5.1"] [org.clojure/clojurescript "0.0.-2173"] [not-really-trusted-package "version"]] Now, I don't like pulling not-really-trusted-package, which can change

Re: Core async / how to work around "No more than 1024 pending puts are allowed on a single channel"

2014-03-27 Thread Jozef Wagner
If you cannot drop messages, just increase the size of a channel buffer (the argument to the chan function). If the channel buffer is full, puts are placed in a channels 'put buffer', which is limited to 1024 puts. Jozef On Thu, Mar 27, 2014 at 3:00 AM, Hanh Huynh Huu wrote: > Hi guys, > > I h

Re: Core async / how to work around "No more than 1024 pending puts are allowed on a single channel"

2014-03-27 Thread Tassilo Horn
Hanh Huynh Huu writes: > If I replace the buffer with a dropping buffer or a sliding buffer, it > works but I can't afford to drop messages. However, I'd be fine with a > larger buffer than 1024. I also replaced the >!! with >! and > async/put!, but the result is the same. > > Is there a way to

Re: generators...?

2014-03-27 Thread Tim
I'm fairly new to Clojure and this was a fun little exercise to try. (def color-map (reduce #(assoc % (count %) %2) {} [:red :yellow :blue :green :purple])) color-map => {4 :purple, 3 :green, 2 :blue, 1 :yellow, 0 :red} (defn random-repeating-map ([coll-map] (random-repeating-map coll-map col

om: state management considerations

2014-03-27 Thread rlewczuk
Hi, After playing a bit with om, I'm somewhat confused about state maintaining possibilities it offers. There is global application state and local component state. I have some doubts about using local state as it seems to lead to troubles as soon as code grows a bit (I'm thinking about trad

Re: Clojure + BDD + TDD + Pairing...

2014-03-27 Thread Brian Muhia
Hi Josh, I'm interested in pairing as well. I'm also based in GMT+3. Best, - B On Wednesday, 30 October 2013 10:23:58 UTC+3, Josh Kamau wrote: > > I can do it with you if we limit the hours to Saturday and sunday. > > I am a noob though i have 2 apps in production. (You can get alot done > witho

Core async / how to work around "No more than 1024 pending puts are allowed on a single channel"

2014-03-27 Thread Hanh Huynh Huu
Hi guys, I have an app that sometimes needs to put a lot of messages on a channel. The rate is not directly under my control - the messages come from the outside. As a quick test, I wrote this snippet (def c (chan (async/buffer 10240))) (go (doseq [i (range 1024000)] (>!! c i))) and i

Re: Clojure + BDD + TDD + Pairing...

2014-03-27 Thread Brian Muhia
Hi Marc, tmux + emacs works fine with me. Best, Brian On Wednesday, 26 March 2014 17:58:48 UTC+3, Marc Bluemner wrote: > > I guess wie Need to Devide on a pairing method "wemux oremacs or whatever > else there is .I use emacs but am good with vim and tmux too. I would > prefer emacs as I'