Re: Asynchronous socket communication with agents

2014-05-15 Thread Gary Verhaegen
While an agent is probably what you want, you should not use it like that. I'm not sure how you can get a failed state with the given code, but here's how I would do it. First off, the agent is only meant for logging, so let's keep it on that job alone. In log-entry, replace the (dosync ...) with:

Re: Asynchronous socket communication with agents

2014-05-15 Thread Dylan Gleason
Thanks for your response, Gary. Just out of curiosity, what is the advantage of using the java Thread as opposed to using the Clojure future? Will it yield the same effect or must I use Thread to explicitly join the threads when they are done executing? -- Dylan On Thursday, May 15, 2014 12:04

Re: Save map contentns to external file?

2014-05-15 Thread Daniel Kersten
To write the data to a file, you could do something like this: (spit "filename" (pr data)) And to read it back in, you could do something like: (clojure.edn/read-string (slurp "filename")) On 15 May 2014 07:20, Steven Jones wrote: > Hi > > I am developing an Overtone MIDI application and wis

Re: Best method for REST api authentication?

2014-05-15 Thread Ivan Schuetz
Ok, I was confused, the solution for this is just to use a session - if the authentication is done using a cookie the server is basically stateless, which would comply to REST. I implemented cookie store session following this tutorial: http://vijaykiran.com/2012/02/web-application-development-

require multiple file

2014-05-15 Thread Tony Francis
(ns foo.core (foo-require "foo.bar.*") ) how to write a function to require or load file with specfic path or namespace like above -- 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 No

Re: citing Clojure and EDN?

2014-05-15 Thread Giovanni Gherdovich
Hello, On Wed, Apr 23, 2014 at 4:42 AM, wrote: > > For the purposes of academic publications > (in areas well outside of SIGPLAN and such), > are there any preferred citations for Clojure and EDN? loosely related to this old thread, today I have read that github has worked out a way to stick a D

Re: citing Clojure and EDN?

2014-05-15 Thread Phillip Lord
Giovanni Gherdovich writes: >> For the purposes of academic publications >> (in areas well outside of SIGPLAN and such), >> are there any preferred citations for Clojure and EDN? > > loosely related to this old thread, today I have read that github > has worked out a way to stick a DOI ( > http:/

Re: clojurescript: modifying function definitions

2014-05-15 Thread t x
Dave, Mike: Noted. Will study this. Thanks! On Wed, May 14, 2014 at 6:46 AM, Mike Haney wrote: > 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,

Re: Clojure TCP client using Java Socket

2014-05-15 Thread Philipp Meier
Hi, Am Donnerstag, 8. Mai 2014 07:41:48 UTC+2 schrieb Dylan Gleason: > > *(defn- receive* > * "Given a socket create a DataInputStream and process the server* > * response"* > * [reader socket]* > * (let [bytes-in (make-array Byte/TYPE util/max-message-size)* > *info {:type :recei

printing lazy lists

2014-05-15 Thread Phillip Lord
I am trying to dump a representation of the contents of a list to file. I've recently changed how I generated this list and it's now lazy (not really by design more by side-effect, if you will excuse the poor choice of words). I was using (spit "file" (str lst "\n")) which worked quite nicely

Re: printing lazy lists

2014-05-15 Thread Michał Marczyk
Use pr-str: user=> (str (lazy-seq (list 1 2 3))) "clojure.lang.LazySeq@7861" user=> (pr-str (lazy-seq (list 1 2 3))) "(1 2 3)" Cheers, Michał On 15 May 2014 16:29, Phillip Lord wrote: > > > I am trying to dump a representation of the contents of a list to file. > I've recently changed how I ge

Propagating data through dependencies

2014-05-15 Thread Casper
This is not strictly a Clojure question, but I'll ask it here since I am solving it in Clojure. I have already made one solution which works, but I am interested in whether there are other and better approaches. I have a number of different products and some are dependant on others: A <- B B <

Re: [ANN] clojure.test.check 0.5.8

2014-05-15 Thread Reid Draper
Sorry you ran into an issue, Steve. I like your idea of including more information in the ex-info data. Is there a specific generator you're having trouble writing without such-that? In general, I've found that it's a code-smell if you need such-that to retry that many times. Happy to help expl

implicit :required behavior in Tools.cli is deceptive

2014-05-15 Thread Bob Larrick
A single element in the cli-options can be as brief as ["-p" "--port" "A port number"] What is non-obvious is that specifying "--port PORT" has entirely different semantics than specifying "--port" In the first case the command "lein run -p 3000" will result in an options map of {:options

ANN Cassaforte 1.3.0 is released

2014-05-15 Thread Michael Klishin
Cassaforte [1] is a Clojure client for Cassandra built around CQL. Release notes: http://blog.clojurewerkz.org/blog/2014/05/15/cassaforte-1-dot-3-0-is-released/ Next Cassaforte release will be 2.0 and will introduce a major public API change: http://blog.clojurewerkz.org/blog/2014/04/26/major-bre

Leiningen just hangs

2014-05-15 Thread Mark Watson
I'm running Leiningen on CentOS 6.5. Everything was working fine, and today when I try "lein run" it just hangs. It takes about 15 minutes for "lein version" to return. The project works fine on my macbook pro, and another CentOS box. I deleted ~/.m2 and reinstalled Leiningen. I updated Leining

Re: Leiningen just hangs

2014-05-15 Thread Gary Trakhman
Did you try to clean out ~/.lein/profiles.clj? On Thu, May 15, 2014 at 2:34 PM, Mark Watson wrote: > I'm running Leiningen on CentOS 6.5. Everything was working fine, and > today when I try "lein run" it just hangs. It takes about 15 minutes for > "lein version" to return. > > The project works

Re: Leiningen just hangs

2014-05-15 Thread Mark Watson
I don't have a ~/.lein/profiles.clj file. I removed all the Leiningen files, tried with a fresh install, still no luck. On Thursday, May 15, 2014 2:38:34 PM UTC-4, Gary Trakhman wrote: > > Did you try to clean out ~/.lein/profiles.clj? > > > On Thu, May 15, 2014 at 2:34 PM, Mark Watson > > wro

Re: [ANN] clojure.test.check 0.5.8

2014-05-15 Thread Steve Miner
On May 15, 2014, at 1:03 PM, Reid Draper wrote: > Sorry you ran into an issue, Steve. I like your idea of including more > information in the ex-info data. Is there a specific generator you're having > trouble writing without such-that? In general, I've found that it's a > code-smell if you n

Re: Leiningen just hangs

2014-05-15 Thread Mimmo Cosenza
try removing ~/.m2 On 15 May 2014, at 20:56, Mark Watson wrote: > I don't have a ~/.lein/profiles.clj file. I removed all the Leiningen files, > tried with a fresh install, still no luck. > > > > On Thursday, May 15, 2014 2:38:34 PM UTC-4, Gary Trakhman wrote: > Did you try to clean out ~/.l

Re: Leiningen just hangs

2014-05-15 Thread Mark Watson
Tried it On Thursday, May 15, 2014 3:17:58 PM UTC-4, Magomimmo wrote: > > try removing ~/.m2 > > On 15 May 2014, at 20:56, Mark Watson > > wrote: > > I don't have a ~/.lein/profiles.clj file. I removed all the Leiningen > files, tried with a fresh install, still no luck. > > > > On Thursday, May

Re: Save map contentns to external file?

2014-05-15 Thread Steven Jones
Thanks, edn looks like the way to go but your example is not quite working. The issue appears to be with pr. (defn foo [] 'foo) (def data {0 foo, 1 '[a b c]}) (spit filename (pr data)) First pr prints the data to *out* but then returns nil so spit is writing an empty file. Second de

Re: Leiningen just hangs

2014-05-15 Thread Gary Trakhman
At this point, I'd suspect a networking timeout issue, do you get a different result if you disable all your connections? On Thu, May 15, 2014 at 3:31 PM, Mark Watson wrote: > Tried it > > > On Thursday, May 15, 2014 3:17:58 PM UTC-4, Magomimmo wrote: > >> try removing ~/.m2 >> >> On 15 May 201

Re: Leiningen just hangs

2014-05-15 Thread Armando Blancas
I've had this problem and I suspect is low memory. It happened often with an old box with 1G running Fedora 20, but I've also seen it with my laptop if I leave too many leftover jvm processes running (with 4G allocated for a virtual box instance); on my 16G mac it never happens. So freeing up so

Re: Leiningen just hangs

2014-05-15 Thread Gary Trakhman
Oh yea, GC churn can take up a lot of time. The illusion of 'infinite memory' :-). On Thu, May 15, 2014 at 3:47 PM, Armando Blancas wrote: > I've had this problem and I suspect is low memory. It happened often with > an old box with 1G running Fedora 20, but I've also seen it with my laptop > i

Re: Save map contentns to external file?

2014-05-15 Thread Stephen Gilardi
On May 15, 2014, at 3:35 PM, Steven Jones wrote: > Thanks, edn looks like the way to go but your example is not quite > working. The issue appears to be with pr. > > (defn foo [] 'foo) > > (def data {0 foo, >1 '[a b c]}) > > (spit filename (pr data)) Use pr-str instead of pr. It

Propagating data through dependencies

2014-05-15 Thread David Pidcock
You said b can't be billed after B. But it sounds like it can't be billed before. Say b is ready at 1, can you bill it at 1 and then B at 2? Anyway, my first thought was using weights on the edges equal to the duration between the dependencies and use a max cost on the graph. But calculating

Propagating data through dependencies

2014-05-15 Thread David Pidcock
If, say C cannot depend on any b directly, (I.e. C can only depend on B), and your domain rules say you can only bill for all b's when you bill B, then really you have a self contained sub-graph with only one bill date for the root node B. You can simply ignore backfilling the billing date for b

Re: Propagating data through dependencies

2014-05-15 Thread François Rey
I'm not sure I totally understand your use case, but somehow it sounds like these libraries may be of interest to you: propaganda prismatic graph -- You received this message because you are subscribed to the Google Grou

Re: Propagating data through dependencies

2014-05-15 Thread Casper
On Thursday, May 15, 2014 11:18:31 PM UTC+2, David Pidcock wrote: > You said b can't be billed after B. But it sounds like it can't be billed > before. > > Say b is ready at 1, can you bill it at 1 and then B at 2? > They should actually be billed at the same time (yeah, I didn't explain that

Re: Propagating data through dependencies

2014-05-15 Thread Casper
Yeah maybe, but both b and B should basically be billed at max of their associated dates, which might affect the things that depend on B. So I don't think b can be dropped completely. On Thursday, May 15, 2014 11:30:35 PM UTC+2, David Pidcock wrote: > > If, say C cannot depend on any b directly,

Re: Propagating data through dependencies

2014-05-15 Thread Casper
Nice thanks, I didn't know propaganda. I am not sure if it applies to this problem, but it looks interesting so I'll have a look. On Friday, May 16, 2014 12:10:29 AM UTC+2, François Rey wrote: > > I'm not sure I totally understand your use case, but somehow it sounds > like these libraries may

clojurescript, sourcemaps, and debugging info

2014-05-15 Thread t x
Hi, * background: * I have clojurescript + lein cljsbuild auto working perfectly fine. * I have source maps working (when I click on a file in Chrome, it jumps me to the corresponding *.cljs file) * problem I am facing: * I like to name my modules: foo/public.cljs foo/other-stu

Re: Save map contentns to external file?

2014-05-15 Thread Steven Jones
Thanks that gives me a few options. I am leaning towards the latter approach of registering the functions somewhere and then serializing the information needed to retrieve them. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro