Re: using hidden parameters?

2014-06-14 Thread Linus Ericsson
A more commonly used feature are bindings, which are sort of pluggable (or rather overridable) dynamic vars. http://stackoverflow.com/questions/1523240/let-vs-binding-in-clojure In short you declare a variable as dynamic and then use some binding around the function-call. Sort of a reusable

Re: time expression of clojure produces different results on cascalog queries

2014-06-14 Thread Linus Ericsson
It says Criterium ran four batches of 60 samples in each (it tries to make the jvm då garbage collection etc between each such batch). In total, 240 samples (ie timed test runs). The statistics are better looked up at wikipedia, but lower quartile here means the 2.5% of the 240 samples (0.025 *

Re: Gin card game with Datomic

2014-06-14 Thread Gijs S.
In IE the network parts only work in IE10 or better. The EventSource polyfill does support IE8 or better, but doesn't send cookies along for IE8 or 9 and the cookies are used for authentication. I haven't bothered with working around that. -Gijs On Saturday, June 14, 2014 6:22:33 AM UTC+2,

Re: Mathematica like eval

2014-06-14 Thread Maik Schünemann
Hi, You can use expresso https://github.com/clojure-numerics/expresso for this: (use 'numeric.expresso.core) (def e (ex (+ 8 a (* 9 (+ 2 b)) 2))) ;= (+ 8 a (* 9 (+ 2 b)) 2) This expression can now be manipulated by expresso to simplify it, solve it, etc. you can substitute a and b for its values

Convert clj-time date-time to UTC

2014-06-14 Thread gvim
I want to convert a time specified with a TZ datababse timezone such as America/Caracas into a UTC date-time but I can only find in clj-time from-time-zone and to-time-zone allowing the zone to be specified as a string. I want: (t/some-utc-func (t/date-time 1967 7 31 6 30) (t/time-zone-for-id

Re: Convert clj-time date-time to UTC

2014-06-14 Thread Stephen Gilardi
This is not quite to your exact specification, but should help you to write what you want: user (defn to-utc [dt] (t/to-time-zone dt (t/time-zone-for-offset 0))) #'user/to-utc user (to-utc (t/from-time-zone (t/date-time 1967 7 31 6 30) (t/time-zone-for-id America/Caracas))) #DateTime

Re: Convert clj-time date-time to UTC

2014-06-14 Thread gvim
On 14/06/2014 16:12, Stephen Gilardi wrote: This is not quite to your exact specification, but should help you to write what you want: user (defn to-utc [dt] (t/to-time-zone dt (t/time-zone-for-offset 0))) #'user/to-utc user (to-utc (t/from-time-zone (t/date-time 1967 7 31 6 30)

Re: Convert clj-time date-time to UTC

2014-06-14 Thread Stephen Gilardi
You're welcome. As another small refinement, I noticed that there's a var for the utc timezone: (t/time-zone-for-offset 0) can be replaced with t/utc --Steve On Jun 14, 2014, at 12:49 PM, gvim gvi...@gmail.com wrote: On 14/06/2014 16:12, Stephen Gilardi wrote: This is not

Re: Convert clj-time date-time to UTC

2014-06-14 Thread gvim
On 14/06/2014 17:59, Stephen Gilardi wrote: You're welcome. As another small refinement, I noticed that there's a var for the utc timezone: (t/time-zone-for-offset 0) can be replaced with t/utc I tried t/utc in place of your function but it didn't produce the desired result. gvim --

Re: Instaparse - thank you!

2014-06-14 Thread Mark Engelberg
Thanks for the kind words, everyone! It's great to hear that people are using Instaparse to get things done. -- 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

Re: Instaparse - thank you!

2014-06-14 Thread John Mastro
Agreed - thanks Mark! If anyone is able to share the query languages you're using (the language's grammar more than the implementation), I'd be very interested (and grateful). I'm always struggling to create reports for our non-technical staff which are flexible enough to be useful but don't

Re: How to unit test (defn-) functions?

2014-06-14 Thread rarous
Always test private functions through public ones. They have to use them. Private stuff should appear during refactoring phase. On Thursday, June 12, 2014 10:44:21 AM UTC+2, Hussein B. wrote: Hi, I like to use (defn-) when it comes to internal implementation functions. But since they

Re: Convert clj-time date-time to UTC

2014-06-14 Thread Michael Klishin
2014-06-14 20:49 GMT+04:00 gvim gvi...@gmail.com: Can't think why it's not baked into the library, though, as it must be a common requirement. Feel free to submit a pull request and a few tests. The clj-time maintainers are responsive and the library is primarily driven by user feedback at

ANN metrics-clojure 2.1.0 is released

2014-06-14 Thread Michael Klishin
metrics-clojure [1] is a Clojure interace to Coda Hale's Metrics library [2]. If you are not sure why collecting metrics about your app is valuable, take a moment and watch [3]. Release notes: https://github.com/sjl/metrics-clojure/blob/master/ChangeLog.md#changes-between-20x-and-210 1.

Re: Convert clj-time date-time to UTC

2014-06-14 Thread gvim
On 14/06/2014 21:59, Michael Klishin wrote: 2014-06-14 20:49 GMT+04:00 gvim gvi...@gmail.com mailto:gvi...@gmail.com: Can't think why it's not baked into the library, though, as it must be a common requirement. Feel free to submit a pull request and a few tests. The clj-time

Could use an error message here? (using `get` on an atom containing a map)

2014-06-14 Thread John Gabriele
This one took me a few minutes to see what I was doing wrong: ~~~ user= (def m (atom {:x 1 :y 2})) #'user/m ;; Later on ... user= (get m :x) nil ;; What?? `:x` isn't a key in `m`? But I *know* it is... ;; Sanity check, for comparison: user= (get {:a 1 :b 2} :c); Right; `:c` is not a key in

Re: Clojure on iOS devices - Swift as a host?

2014-06-14 Thread Mike Fikes
Hey Devin, You had asked to see some code. Here is a little, to give a feel for the “top level” without digging into the plumbing. Let's say you want an authentication UI that lets you enter a 6-digit code with a keypad and asterisk indicators showing how many digits have been keyed. Here is

Re: Could use an error message here? (using `get` on an atom containing a map)

2014-06-14 Thread Ambrose Bonnaire-Sergeant
Seems unlikely: http://dev.clojure.org/jira/browse/CLJ-1107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=34820#comment-34820 I would write my own get variant, or use something like Dynalint https://github.com/frenchy64/dynalint. Thanks, Ambrose On Sun,