Re: clojure.data.csv/write-csv isn't thread safe (should it be?)

2019-05-02 Thread matt . t . grimm
Well, snark and sarcasm aside, you've made me realize I was way too focused 
on making write-csv do what I wanted rather than come up with a better 
solution. So thanks for that, but do try to keep up the impression that 
this is a friendly, welcoming community.

On Thursday, May 2, 2019 at 6:07:53 PM UTC-6, Matching Socks wrote:
>
> Wow, that user.clj is impressive.  This is a top-notch application of 
> clojure core async!  Nonetheless, if one is going to the trouble of making 
> 100 threads, it would be clearer and farther-sighted (and not much more 
> work) to toss the results into a channel that a single thread drained into 
> an output file.  In that sense, a "fix" of the csv writer would not even be 
> in our best interest.  Moreover, isn't the default expectation that 
> multi-threaded side effects will inevitably produce a mud puddle?  If "this 
> is not thread-safe, of course" were added to one side-effecting function's 
> docstring, would the interests of fairness demand such a flag on many more 
> functions?!  Since most Clojure programs are not AOT-compiled, the extra 
> bloat of docstrings would make program startup take longer.  The delay 
> could be mitigated somewhat by Huffman-encoding the docstrings.
>

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


clojure.data.csv/write-csv isn't thread safe (should it be?)

2019-05-02 Thread matt . t . grimm
The write-csv function in clojure.data.csv isn't thread safe because even 
though it uses the synchronized .write method on BufferedReader, it does so at 
the cell level 
,
 
not the row/line level. Is this expected or a bug? Is there a reason it 
shouldn't be made thread safe?

Attached is a simple test showing the result of calling write-csv with a 
single thread vs. 100 threads. With a single thread, the output is correct, 
and with 100 threads the result is a jumbled mess. Conversely, if I use 
clojure-csv  and manually 
write at the row level using the same harness, it works as expected with 
multiple threads.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


user.clj
Description: Binary data


Re: Lazy Flatten; One seq at a Time

2017-11-22 Thread Matt Anderson
Thanks! The `aconcat` solution from plumbing works great for this use case.

The `lazy-gen`/`yield` fn's in Tupelo are exactly what I was searching for 
in terms of a larger abstraction, but couldn't quite put into words. Thanks 
for the tip!



On Wednesday, November 22, 2017 at 2:36:18 AM UTC-5, Alan Thompson wrote:
>
> You can also solve this using `lazy-gen` and `yield-all` from the Tupelo 
> library 
> <https://github.com/cloojure/tupelo#generator-functions-for-lazy-sequences-a-la-python>.
>  
> It allows you to make
> a lazy generator function (a la Python):
>
>   (let [seq-of-seqs [(range  0  5)
>  (range 10 15)
>  (range 20 25)]
> flat-seq(lazy-gen
>   (doseq [curr-seq seq-of-seqs]
> (yield-all curr-seq)))]
> (is= flat-seq [0 1 2 3 4 10 11 12 13 14 20 21 22 23 24]))
>
>
> Alan
>
>
> On Tue, Nov 21, 2017 at 4:47 PM, Jason Wolfe <ja...@w01fe.com 
> > wrote:
>
>> I think this 
>> <https://github.com/plumatic/plumbing/blob/318af7798bb701607aaae8639d12829014941184/src/plumbing/core.cljx#L182>
>>  
>> will do it: 
>>
>> (lazy-cat (first coll) (when-let [n (next coll)] (lazy-flatten n
>>
>>
>> On Tuesday, November 21, 2017 at 2:34:15 PM UTC-8, Matt Anderson wrote:
>>>
>>> I have a function that is returning a lazy-seq of lazy-seq's.
>>>
>>>
>>> (seq (seq [1 2 3]) (seq [4 5 6]) ...)
>>>
>>>
>>> The end-user API, however, should be able to get back a lazy-seq of the 
>>> individual items across all lazy-seq's--essentially a flattening of the 
>>> output of my function--instead of the "top level" seqs. 
>>>
>>>
>>> (seq [1 2 3 4 5 6 ...])
>>>
>>> Each of the internal lazy-seq's is expensive in terms of memory usage so 
>>> I'd like to only "load" one at a time.  I've been trying to find a way to 
>>> only calculate one of the top-level lazy-seq's at a time and then not 
>>> "take" the next until the user gets to the end of the first and needs the 
>>> first item from the next (eg: (seq [4 5 6]) doesn't get calculated until we 
>>> have consumed 3 and are asking for the next), but haven't found a way to do 
>>> it. Best I've gotten is "loading" 2 "top level" seqs at a time and I'm 
>>> afraid that may be the best I get, but I thought it might be an exercise 
>>> worth presenting in case anyone had ideas. Here's a contrived example:
>>>
>>>
>>> (defn lazy-flatten
>>>
>>>  [coll]
>>>
>>>  (when-let [s (seq coll)]
>>>
>>>(lazy-seq
>>>
>>>  (if (seq? (first s))
>>>
>>>(concat (lazy-flatten (first s)) (lazy-flatten (rest s)))
>>>
>>>(cons (first s) (lazy-flatten (rest s)))
>>>
>>> (->> (repeatedly
>>>(fn []
>>>  (println "New seq...")
>>>  (map (fn [x] + x (rand-int 10)) (range 4
>>>  lazy-flatten
>>>  (take 1))
>>>
>>>
>>>
>>> Prints:
>>>
>>>
>>> New seq...
>>>
>>> New seq...
>>>
>>> => (8)
>>>
>>>
>>> I realize this is because 2 items must be taken for "concat", so there 
>>> would need to be another approach (this was just my best shot 
>>> implementation). 
>>>
>>>
>>> Any ideas on how to get the bottom form to only print 1 "New seq..."?
>>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Lazy Flatten; One seq at a Time

2017-11-21 Thread Matt Anderson


I have a function that is returning a lazy-seq of lazy-seq's.


(seq (seq [1 2 3]) (seq [4 5 6]) ...)


The end-user API, however, should be able to get back a lazy-seq of the 
individual items across all lazy-seq's--essentially a flattening of the 
output of my function--instead of the "top level" seqs. 


(seq [1 2 3 4 5 6 ...])

Each of the internal lazy-seq's is expensive in terms of memory usage so 
I'd like to only "load" one at a time.  I've been trying to find a way to 
only calculate one of the top-level lazy-seq's at a time and then not 
"take" the next until the user gets to the end of the first and needs the 
first item from the next (eg: (seq [4 5 6]) doesn't get calculated until we 
have consumed 3 and are asking for the next), but haven't found a way to do 
it. Best I've gotten is "loading" 2 "top level" seqs at a time and I'm 
afraid that may be the best I get, but I thought it might be an exercise 
worth presenting in case anyone had ideas. Here's a contrived example:


(defn lazy-flatten

 [coll]

 (when-let [s (seq coll)]

   (lazy-seq

 (if (seq? (first s))

   (concat (lazy-flatten (first s)) (lazy-flatten (rest s)))

   (cons (first s) (lazy-flatten (rest s)))

(->> (repeatedly
   (fn []
 (println "New seq...")
 (map (fn [x] + x (rand-int 10)) (range 4
 lazy-flatten
 (take 1))



Prints:


New seq...

New seq...

=> (8)


I realize this is because 2 items must be taken for "concat", so there 
would need to be another approach (this was just my best shot 
implementation). 


Any ideas on how to get the bottom form to only print 1 "New seq..."?

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help with strange test output when deftest used inside a macro

2017-10-10 Thread Matt Grimm
Excellent, thanks! The actual macro is indeed a little more complicated, 
but the test assertions are limited to (is (= ...)), so replacing = with 
~'= works perfectly.

On Tuesday, October 10, 2017 at 3:10:37 AM UTC-6, Gary Verhaegen wrote:
>
> is is looking for specific patterns and, if it can't find a known one, 
> defaults to assuming its argument is a random predicate and prints that.
>
> So what's happening here is the syntax quote expands (resolves) = to 
> clojure.core/= and thus it doesn't match the pattern for = anymore.
>
> So you'd need for = to not be expanded and stay as exactly the = symbol 
> after macroexpansion. There are various ways to achieve that, but I can't 
> think of a generic, elegant one. In the trivial example you posted you can 
> just replace = with ~'=, I think, though that might not be so easy on more 
> complex macros.
>
> You can also take a look at the assert-expr and report multimethods in 
> clojure.test.
>
> On 9 Oct 2017, at 22:32, Timothy Baldridge <tbald...@gmail.com 
> > wrote:
>
> The problem isn't the macro, it's your use of syntax quoting. `(= x y) 
> gets expanded at read-time into `(clojure.core/= x y)`. Not much you can do 
> about that. Although I'd suggest perhaps changing your code a bit to not 
> require macros. 
>
> deftest mostly just creates a defn with some extra metadata and the like. 
> One option would be to use a dynamic var to setup your config information. 
> Or better yet have the test itself read the config data the way your normal 
> app would. This not only exercises the same config codepaths, but it also 
> keeps the code quite functional. 
>
> On Mon, Oct 9, 2017 at 2:40 PM, Matt Grimm <matt.t...@gmail.com 
> > wrote:
>
>> Hello,
>>
>> I'm generating deftest's using a helper macro that takes a variety of 
>> test parameters and though the tests function correctly, the output of a 
>> failed test is not exactly right. The expect value is shown as the 
>> un-evaluated test form, and the actual value is shown as the result of 
>> evaluating the test form. I realize 'is' is a macro itself, but I'm not 
>> quite sure how to expand or escape the guts of my macro to make the output 
>> match that of a normal test.
>>
>> Whereas a normal test failure looks like this (some output elided):
>>
>> user=> (deftest normal-test
>>   #_=>   (is (= [0 1 5] (range 3
>> #'user/normal-test
>> user=> (run-tests)
>>
>> FAIL in (normal-test)
>>
>> expected: [0 1 5]
>>   actual: ((0 1 2)) 
>>
>> A failure for a deftest defined within a macro comes out like this:
>>
>> user=> (defmacro defnesttest [v]
>>   #_=>   `(deftest nested-test
>>   #_=>  (is (= [0 1 5] ~v
>> #'user/defnesttest
>> user=> (defnesttest (range 3))
>> #'user/nested-test
>> user=> (run-tests)
>>
>> FAIL in (nested-test)
>>
>> expected: (clojure.core/= [0 1 5] (range 3))
>>   actual: false
>>
>> Thanks for any insight,
>> m.
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> “One of the main causes of the fall of the Roman Empire was that–lacking 
> zero–they had no way to indicate successful termination of their C 
> programs.”
> (Robert Firth) 
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com 
> Note that posts from new members are moderated - please be patient with 
> your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com 
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop rece

Help with strange test output when deftest used inside a macro

2017-10-09 Thread Matt Grimm
Hello,

I'm generating deftest's using a helper macro that takes a variety of test 
parameters and though the tests function correctly, the output of a failed 
test is not exactly right. The expect value is shown as the un-evaluated 
test form, and the actual value is shown as the result of evaluating the 
test form. I realize 'is' is a macro itself, but I'm not quite sure how to 
expand or escape the guts of my macro to make the output match that of a 
normal test.

Whereas a normal test failure looks like this (some output elided):

user=> (deftest normal-test
  #_=>   (is (= [0 1 5] (range 3
#'user/normal-test
user=> (run-tests)

FAIL in (normal-test)

expected: [0 1 5]
  actual: ((0 1 2)) 

A failure for a deftest defined within a macro comes out like this:

user=> (defmacro defnesttest [v]
  #_=>   `(deftest nested-test
  #_=>  (is (= [0 1 5] ~v
#'user/defnesttest
user=> (defnesttest (range 3))
#'user/nested-test
user=> (run-tests)

FAIL in (nested-test)

expected: (clojure.core/= [0 1 5] (range 3))
  actual: false

Thanks for any insight,
m.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reducers exception when calling into

2017-05-12 Thread Matt Grimm
Thanks very much for the quick response. From your hints, I tried switching 
uses of into to r/foldcat and it worked. 

On Thursday, May 11, 2017 at 4:44:37 PM UTC-6, Alex Miller wrote:
>
> The symptoms sound like you are running into a case where there are 
> multiple protocol branches that apply - this is a case where the behavior 
> is undefined and can vary between JVM executions.
>
> Looks like it's going down the seq reduce path. I'm not at a computer to 
> check more precisely what the other preferred option might be. I think 
> there's actually an open ticket about a similar case.
>
>

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reducers exception when calling into

2017-05-11 Thread Matt Grimm
Hi,

I've run into a bizarre issue with reducers that is consistently 
reproducible, but only on one set of systems. On a separate system with the 
same OS and java, the error is not reproducible. The exception messages 
seem to indicate that I've tried to access a reducible like a seq before 
doing something like `into', but that's not the case. In fact, the 
exception is thrown at the very line where I'm trying to call into on the 
reducible. 

The exception happens in a reducers chain like this:
(->> content
(r/map :vals)
r/flatten
(r/filter (comp #{1 2 3} :page-number))
(into []) ;; <-- exception occurs at this line 
count)

Stack trace:
https://gist.github.com/tkocmathla/2d4bc38c2ac2977b6c421fc92cd812ed

$ java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS" 

Thanks for any insight,
m.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to disable (or limit) test.check shrinking

2017-02-10 Thread 'Matt Bossenbroek' via Clojure
Perfect - that’s exactly what I’m looking for. Thanks!

-Matt


On February 9, 2017 at 4:04:17 PM, Gary Fredericks (fredericksg...@gmail.com)
wrote:

Wrapping the generator in `gen/no-shrink` will give you a generator that
pretends it doesn't know how to shrink.

On Thursday, February 9, 2017 at 11:55:38 AM UTC-6, Matt Bossenbroek wrote:
>
> I considered that, but that only partially fixes the issue. If it does
> actually find a real problem, it’ll never complete because the shrinking
> takes too long.
>
> In the end I’d rather have something not fully shrunk than something that
> runs forever.
>
> -Matt
>
>
> On February 8, 2017 at 1:19:24 PM, Daniel Compton (daniel.com...@gmail.com)
> wrote:
>
> If the 503 is only returned by failures not relating to what you are
> testing (e.g. load), then one option might be to catch the exception and
> retry that request?
>
> On Thu, Feb 9, 2017 at 6:48 AM 'Matt Bossenbroek' via Clojure <
> clo...@googlegroups.com> wrote:
>
>> I'm using test.check to test a live service. Occasionally it gets a 503
>> from the service and spends hours trying to shrink the input & reproduce
>> the error.
>>
>> Is there a way to limit the shrinking process to n iterations? Or disable
>> it entirely for some tests?
>>
>> Is there a better approach for using test.check against a live service
>> where transient issues are expected? Should I just retry the actual service
>> call many times before allowing test.check to see it?
>>
>> Thanks,
>> Matt
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+u...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
>
> Daniel
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to disable (or limit) test.check shrinking

2017-02-09 Thread 'Matt Bossenbroek' via Clojure
I considered that, but that only partially fixes the issue. If it does
actually find a real problem, it’ll never complete because the shrinking
takes too long.

In the end I’d rather have something not fully shrunk than something that
runs forever.

-Matt


On February 8, 2017 at 1:19:24 PM, Daniel Compton (
daniel.compton.li...@gmail.com) wrote:

If the 503 is only returned by failures not relating to what you are
testing (e.g. load), then one option might be to catch the exception and
retry that request?

On Thu, Feb 9, 2017 at 6:48 AM 'Matt Bossenbroek' via Clojure <
clojure@googlegroups.com> wrote:

> I'm using test.check to test a live service. Occasionally it gets a 503
> from the service and spends hours trying to shrink the input & reproduce
> the error.
>
> Is there a way to limit the shrinking process to n iterations? Or disable
> it entirely for some tests?
>
> Is there a better approach for using test.check against a live service
> where transient issues are expected? Should I just retry the actual service
> call many times before allowing test.check to see it?
>
> Thanks,
> Matt
>
> --
> 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, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
--

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 - please be patient with
your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to disable (or limit) test.check shrinking

2017-02-08 Thread 'Matt Bossenbroek' via Clojure
I'm using test.check to test a live service. Occasionally it gets a 503 
from the service and spends hours trying to shrink the input & reproduce 
the error.

Is there a way to limit the shrinking process to n iterations? Or disable 
it entirely for some tests?

Is there a better approach for using test.check against a live service 
where transient issues are expected? Should I just retry the actual service 
call many times before allowing test.check to see it?

Thanks,
Matt

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Should I switch to Clojure after 3 years of learning another full stack ?

2016-10-11 Thread Matt Mitchell
My first Clojure "app" was a CLI utility that pulled data from a SQL 
database, mapped records into another form, and pushed them into a search 
engine app. It took me about 3 weeks to do that with no lisp experience at 
all, and I was super rusty on Java at that point. It was "hard", but I 
really only remember that as a very enjoyable learning experience. I don't 
think Clojure is any more difficult than language X, Y or Z really. From 
what I've seen from other developers, it's mostly a matter of getting over 
the parens/syntax (seriously). Once that's over, it's like any other 
language - it'll all click - "variables", conditionals, functions, state 
etc.. Just get started, don't hesitate. Peel back the layers one at a time 
and enjoy the learning experience. After a while, you might even find 
yourself preferring Clojure (those parens are there for a really good 
reason), and then eventually, every other language will look inferior (just 
kidding, maybe).

More to your question though - Clojure can definitely be used to build 
websites. A minimalist toolset would be (think Sinatra or Express) Ring and 
Bidi or Compojure. Throw in some common Ring middleware (static assets, 
sessions, file-type info) and you're getting somewhere. If you want 
something like Rails, I'm sure others here could recommend something.

- Matt

On Thursday, October 6, 2016 at 5:39:43 PM UTC-4, Xman wrote:
>
> It's been many years of postponing learning programming, because I 
> considered the popular languages of that time not right.
> It took me nearly 3 years to learn and build a website using another stack 
> (I wont advertise here), 
> and without having much previous knowledge in programming.  I have not 
> deployed the website yet. 
> I would like to know if Clojure is a great option to make websites ?
>
> I found out that there are new features on the web that Clojure is better 
> for, but I don't use those features in the present. 
> When I choose to learn a language I decide by myself, and after listening 
> to a video talk, it gives me reasons to think that its better.
> I want to learn the language and "frameworks" (or how to create the 
> architecture) much quicker than previous attempt.
>
> I'd like to know if its possible to do that in less than 6 months or if I 
> should stay with the framework I know ?
>

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Meta-data should be added to deprecated functions?

2016-08-11 Thread Matt Mower
On Wednesday, 10 August 2016 13:22:47 UTC+1, Alex Miller wrote:

> In this case, there is not a specific function to point to, rather the use 
> of a transducer with a chan is the alternative.


How about {:deprecated } where the URL could refer to a 
human-readable/machine-processable description of the deprecation and 
alternative that could be presented by a tool/IDE.

m/

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: clojure, not the go to for data science

2015-12-20 Thread Matt Revelle
Hey all, just chiming in that I use Clojure for exploratory analysis, 
prototyping, and "production." Most of my work involves social networks and 
aside from my own libs I use: core.matrix, Loom, and gg4clj (ggplot!). I'm 
also a big fan of core.typed type annotations and Schema for data 
validation and coercion.

I used Clojure for implementing the method described in this paper: 
Revelle, Matt, et al. "Finding Community Topics and Membership in Graphs." 
*Machine 
Learning and Knowledge Discovery in Databases*. Springer International 
Publishing, 2015. 625-640.

And the code is available at:
https://github.com/gmu-dmml-lab/senc

I also have a utility library that will likely become a few separate 
libraries in the future:
https://github.com/mattrepl/munge

It has some basic IO for common formats (Matrix Market, various graph 
formats, R tables), helper functions (some of which are no longer needed) 
for core.matrix and Loom, and simple text processing.

My biggest pain point with using Clojure is the kludgy access to decent 
plots (nothing on the JVM comes close to ggplot) as well as missing 
functions for probability distributions and model fitting. I've tried 
various substitutes (or written my own), but nothing is as polished as R.

-Matt

On Sunday, December 20, 2015 at 1:11:12 AM UTC-5, Christopher Small wrote:
>
> You're quite welcome; I was happy to add your work there :-) It's always 
> wonderful seeing folks using Clojure for scientific research. I'm happy to 
> add similar showcasings to the list.
>
> I should add that I've been wanting to make it easier for folks to submit 
> suggestions through the site, and add interactive features, but I've been a 
> bit busy. If anyone else is interested in contributing, I'd be grateful.
>
> Cheers
>
> Chris
>
>
>
> On Sat, Dec 19, 2015 at 11:31 AM, Boris V. Schmid <boris@gmail.com 
> > wrote:
>
>> Just noticed one of my research paper made it to the showcase :-). Thanks 
>> for that!
>>
>> As for clojure resources: I have been mainly used clojure itself, and 
>> visualization libraries, (incanter, quil and gg4clj [to make plots in R 
>> with ggplot2, but you can use it to run any R code]), and sometimes a stray 
>> java library for smoothing or clustering things. The inter-op with java is 
>> often not too bad. I use light table as an IDE.
>>
>> Boris
>>
>>
>> On Thursday, April 9, 2015 at 3:17:44 AM UTC+2, Christopher Small wrote:
>>>
>>> Made some updates to http://clojure-datascience.herokuapp.com/. In 
>>> particular, went with the tagline "Resources for the budding Clojure Data 
>>> Scientist." Couldn't come up with anything else sufficiently punny and 
>>> appropriate.
>>>
>>> Again; please contribute! I'll be starting a list in the about page 
>>> mentioning everyone who's contributed.
>>>
>>> Chris
>>>
>>>
>>> On Tuesday, April 7, 2015 at 8:24:27 PM UTC-7, Emrehan Tüzün wrote:
>>>>
>>>> Clojure isn't the first tool coming into mind on data science at the 
>>>> moment but the number of useful libraries are growing up. You can check 
>>>> out 
>>>> https://github.com/razum2um/awesome-clojure#science-and-data-analysis.
>>>
>>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Clojure" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/clojure/vsjUlAWm64g/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] 2015 State of Clojure Community survey

2015-12-09 Thread 'Matt Bossenbroek' via Clojure
How about adding a state of Datomic survey? :) 

-Matt


On Sunday, December 6, 2015 at 4:12 PM, Mars0i wrote:

> 
> 
> On Sunday, December 6, 2015 at 3:26:55 PM UTC-6, Lee wrote:
> > 
> > On Dec 6, 2015, at 3:00 PM, Alex Miller <al...@puredanger.com 
> > (javascript:)> wrote: 
> > 
> > > Almost all of the questions are optional - if they don't apply to your 
> > > scenario, you should skip the question.
> > 
> > 
> > FWIW if I recall correctly (it won't let me back in to check the questions 
> > now that I finished it) I think that some questions sort of apply but use 
> > terminology that implies an industrial context (like "in production"). Not 
> > a big deal but a bit confusing, and maybe if we want to encourage use in 
> > education and research these could be tweaked. 
> 
> I agree with Lee.  It's not that there are missing questions. It's that in 
> some cases I have an answer to the question, but it's not one of the options; 
> all of the options presume that we're doing certain sorts of things, which 
> are common in business.  Someone doing data manipulation and analysis for 
> scientific research may be doing a lot of coding that doesn't leave one or 
> two machines.  Likewise for scientific simulations.  These uses may not be 
> part an ongoing process--they're not used to run a business, or a website, or 
> anything like that.  You write something, do a lot with it, then move on to 
> something else.  Or come back and modify it for a related research project.  
> Clojure's a great language for that sort of thing.
> 
> I'd be happy to go through the survey and suggest a few things to add or 
> change if that would be helpful.  Lee's suggested additional questions seem 
> worthwhile, too.  I agree that some thought would have to be put into 
> formulating them.
>  
> > > 
> > > What question would be useful to add re use in academia? 
> > 
> > I'd personally be interested in knowing how many people are using Clojure 
> > for computer science courses, and which ones. Also, how many people are 
> > using Clojure for research, and in what fields. Also, what tools (e.g. 
> > IDEs, books, websites) are people using, and what do they think is missing, 
> > for research and education purposes. 
> > 
> > I'm not sure how best to phrase survey questions for these issues. 
> > 
> >  -Lee
> 
> -- 
> 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 
> (mailto:clojure@googlegroups.com)
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com 
> (mailto:clojure+unsubscr...@googlegroups.com)
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com 
> (mailto:clojure+unsubscr...@googlegroups.com).
> For more options, visit https://groups.google.com/d/optout.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] PigPen 0.3.1

2015-10-19 Thread 'Matt Bossenbroek' via Clojure
We just released PigPen 0.3.1 with a couple of minor improvements: 

Update cascading version to 2.7.0
Update nippy (for serialization) to 2.10.0 & tune performance


PigPen is map-reduce for Clojure, or distributed Clojure. You write idiomatic 
Clojure code, we run it on thousands of machines using Apache Pig or Cascading.

Learn more here: https://github.com/Netflix/PigPen


-Matt

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


IoT Clojure Opportunity

2015-10-13 Thread Matt Masciocchi
Hello Everyone,

I'm currently working for an exciting IoT start-up looking for a Sr.SW 
Engineer (server side).  After countless Emails, InMails and phone calls, 
my team and I have come to realize that finding a qualified, expert Clojure 
Engineer is quite a task!

If you work with Clojure in a professional setting and would be interested 
in helping develop technology that will revolutionize smart-cities 
world-wide, please let me know and we can discuss this fantastic 
opportunity further.

This position is located in Sunnyvale and would require on-site presence at 
least for the first couple of months with the potential to move to remote 
work down the road.

Thank you for your time and consideration!

My Best,

Matt Masciocchi
Network Search Associates

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-09-02 Thread Matt Mitchell
I just created a scratch project using schema-1.0.0. Requiring schema.core 
works fine, but coerce throws an exception. Here's the repl session:

user=> (require '[schema.core])

 

nil 

user=> (require '[schema.coerce]) 


 

CompilerException java.lang.RuntimeException: No such var: s/spec, compiling
:(schema/coerce.clj:31:28)



- Matt

On Tuesday, September 1, 2015 at 2:02:30 PM UTC-4, Jason Wolfe wrote:
>
> We're excited to finally bring Schema out of alpha, while introducing some 
> new exciting features around testing: test.check integration and data 
> completion.  Check out the blog post for details about these new 
> applications.
>
> http://blog.getprismatic.com/schema-1-0-released/
>
> We've also rewritten the internals of schema for this release, to make it 
> easier and faster to add new schema types and applications.  We expect 
> ordinary users of Schema should see no breaking changes, but custom schema 
> types or tooling will likely need to be updated.  Please see the changelog 
> for details.
>
> https://github.com/Prismatic/schema/blob/master/CHANGELOG.md
>
> Comments and suggestions welcome!
>

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-09-01 Thread Matt Mitchell
Awesome and good work! Can't wait to try it out.

- Matt

On Tuesday, September 1, 2015 at 2:02:30 PM UTC-4, Jason Wolfe wrote:
>
> We're excited to finally bring Schema out of alpha, while introducing some 
> new exciting features around testing: test.check integration and data 
> completion.  Check out the blog post for details about these new 
> applications.
>
> http://blog.getprismatic.com/schema-1-0-released/
>
> We've also rewritten the internals of schema for this release, to make it 
> easier and faster to add new schema types and applications.  We expect 
> ordinary users of Schema should see no breaking changes, but custom schema 
> types or tooling will likely need to be updated.  Please see the changelog 
> for details.
>
> https://github.com/Prismatic/schema/blob/master/CHANGELOG.md
>
> Comments and suggestions welcome!
>

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Recommendations for a schema-based data language for use in Hadoop?

2015-08-05 Thread 'Matt Bossenbroek' via Clojure
FWIW, We use edn (serialized with nippy [1]) in hadoop  it works very well for 
us: 

https://github.com/Netflix/PigPen 

In some places we use maps for the expressiveness and in some we use vectors 
for more performance.

Whatever I lose in raw performance I can trivially throw a few more boxes at, 
so it makes it a non-issue for us. The flexibility of edn outweighs any 
performance gains of converting back  forth to another format and having to 
worry about translation errors.

-Matt

[1] https://github.com/ptaoussanis/nippy


On Tuesday, August 4, 2015 at 7:05 PM, Ryan Schmitt wrote:

 Hi Clojure people,
 
 I'm currently working on some problems in the big data space, and I'm more or 
 less starting from scratch with the Hadoop ecosystem. I was looking at ways 
 to work with data in Hadoop, and I realized that (because of how InputFormat 
 splitting works) this is a use case where it's actually pretty important to 
 use a data language with an external schema. This probably means ruling out 
 Edn (for performance and space efficiency reasons) and Fressian (managing the 
 Fressian caching domain seems like it could get complicated), which are my 
 default solutions for everything, so now I'm back to the drawing board. I'd 
 rather not use something braindead like JSON or CSV.
 
 It seems like there are a few language-agnostic data languages that are 
 popular in this space, such as:
 
 * Thrift
 * Protobuf
 * Avro
 
 But since the Clojure community has very high standards for data languages, 
 as well as a number of different libraries that run code on Hadoop, I was 
 wondering if anyone could provide a recommendation for a fast, extensible, 
 and well-designed data language to use. (Recommendations of what to avoid are 
 also welcome.)
 -- 
 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 
 (mailto:clojure@googlegroups.com)
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com 
 (mailto:clojure+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com 
 (mailto:clojure+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/d/optout.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Advice on introducing a Java dev to Clojure

2015-07-12 Thread Matt Bailey
Johanna,

I noticed you mentioned CQRS. In my work, we use CQRS heavily, specifically 
the Axon framework for Java (utilizing Spring and Hibernate). I got into 
Clojure through watching Rich Hickey's talks and figured that any language 
that he wrote had to be good.

It's remarkable to me how cleanly the concepts applied in CQRS map to 
concepts in Clojure. The funny thing is that CQRS would never be necessary 
if it wasn't for languages like C# and Java.

It can be discouraging to see people's eyes glaze over when you talk about 
code as a series of transformations on the input. Many people limit their 
understanding of code to a very procedural style with ifs, elses and 
helper methods that have side effects.

Sorry I don't have any words of wisdom on how to evangelize Clojure, but I 
am glad to see someone else noted the parallels between CQRS and a more 
functional style of programming.

Cheers!
-Matt

On Saturday, July 11, 2015 at 2:47:31 PM UTC-7, Johanna Belanger wrote:

 That's really cool, thanks!

 On Saturday, July 11, 2015 at 5:27:37 AM UTC-7, juvenn wrote:

  Hi Johanna, 

 I don’t know if it'll work for your team, but I find Shaun Le Bron's 
 Interactive guide to Tetris in ClojureScript” the most succinct and 
 beautiful way of showing power of Clojure and ClojureScript.

 https://github.com/shaunlebron/t3tr0s-slides

 Have fun!
 -- 
 Juvenn Woo
 Sent with Sparrow http://www.sparrowmailapp.com/?sig

 On Saturday, 11 July, 2015 at 1:24 pm, Johanna Belanger wrote:

 I ended up giving him a brief description of Clojure, with stress on its 
 ability to do heavy lifting with very little code, and sent him a link to 
 Neal Ford's talk The Curious Clojurist 
 https://www.youtube.com/watch?v=bxLnpgnDApg. We'll see what happens. 
 Thanks everyone for your advice.

 On Thursday, July 9, 2015 at 3:20:23 PM UTC-7, Johanna Belanger wrote:

 Hi :)

 I've recently broached the subject of Clojure with another dev in my 
 organization, and his response was basically What's Clojure? and I'm not 
 sure how to answer that in a way that might inspire him. It's a 
 dynamically-typed functional Lisp with persistent immutable data structures 
 that runs on the JVM doesn't seem like it will grab his interest. =)

 I work primarily in .NET, and he does enterprise Java. I don't know him 
 well enough to know how happy he is with it. He did express interest in 
 learning .Net.

  I came to an appreciation of Clojure through 

 -CQRS (the power of decomplection!)
 -Sussman and Abelson's SICP class at MIT online (the power of 
 homoiconicity and functions!)
 -the death of Silverlight (alternatives to Javascript in the browser?)

 By the time I found Rich Hickey's talks (eg Simple Made Easy) I was 
 pretty well primed to love Clojure. I've been using it for little personal 
 projects and prototyping for a couple of years, but I haven't put it in 
 production because no one else here knows it.

 Could anyone tell me how they got from enterprise Java to Clojure?

 Thanks very much,
 Johanna

  -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+u...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.
  

 

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Neanderthal, a fast, native matrix and linear algebra library for Clojure released + call for help

2015-06-21 Thread Matt Revelle
Mike (core.matrix author) has been adjusting the API according to his needs 
and those of other users. I don't think anyone will disagree with the 
statement that good APIs are shaped by usage and keeping things simple. 
That said, I see no reason why there shouldn't be a common API which is 
higher level and more convenient than BLAS/LAPACK.

On Saturday, June 20, 2015 at 1:28:09 PM UTC-4, Mars0i wrote:

 Dragan, this just occurred to me--a small comment about the slow speed 
 that I reported 
 https://groups.google.com/forum/#!topic/numerical-clojure/WZ-CRchDyl8 
 from clatrix, which you mentioned earlier.  I'm not sure whether the slow 
 speed I experienced on 500x500 matrices itself provides evidence for 
 general conclusions about using the core.matrix api as an interface to 
 BLAS.  There was still a lot of work to be done on clatrix at that 
 point--maybe there still is.  My understanding is that clatrix supported 
 the core.matrix api at that stage, but it was known that it didn't do so in 
 an optimized way, in many respects.  Optimizing remaining areas was left 
 for future work.


Besides the call overhead involved, there are two places where speed 
performance is likely to suffer when using core.matrix with a native lib: 
copying/duplicating matrix data and mismatch between core.matrix operations 
and BLAS/LAPACK operations. The first is fixed by taking the approach 
Dragan has with Neanderthal, use a buffer which is shared by both the 
native lib and JVM code. The second is hypothetical, at least I don't have 
enough familiarity with the BLAS/LAPACK API to quickly identify a problem. 
Examples of these would be helpful.


 I think your general point doesn't depend on my experience with clatrix a 
 year ago, however.  I understand you to be saying that there are some 
 coding strategies that provide efficient code with BLAS and LAPACK, and 
 that are easy to use in Neanderthal, but that are difficult or impossible 
 using the core.matrix api.


Again, there should be examples. I agree with Dragan that better API 
documentation for core.matrix should exist. That said, there's only one 
file you need to look at (matrix.clj, 
https://github.com/mikera/core.matrix/blob/develop/src/main/clojure/clojure/core/matrix.clj)
 
and it should be straightforward for anyone interested to identify 
functions which would introduce inefficiencies for BLAS/LAPACK libraries.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Neanderthal, a fast, native matrix and linear algebra library for Clojure released + call for help

2015-06-19 Thread Matt Revelle
On Friday, June 19, 2015 at 4:57:32 AM UTC-4, Dragan Djuric wrote:

 I do not even claim that an unified api is not possible. I think that to 
 some extent it is. I just doubt in core.matrix eligibility for THE api in 
 numerical computing. For it makes easy things easy and hard things 
 impossible.


Are you saying you don't believe core.matrix should be _the_ abstract API 
for matrices/arrays in Clojure? If so, what are your concerns? Feel free to 
point to me a previous post if it's already been stated. It also sounds 
like you're alluding to the thread in the Numerical Clojure group about a 
broad numerical computing lib for complex numbers and various math 
functions, but I'm not following how that matters here.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] PigPen 0.3.0 - Now with Cascading!

2015-05-18 Thread 'Matt Bossenbroek' via Clojure
No complaints, so PigPen 0.3.0 is now officially released.

Enjoy!

-Matt


On Monday, May 11, 2015 at 8:40 AM, Matt Bossenbroek wrote:

 I'm excited to announce the release of PigPen v0.3.0, which now includes 
 support for Cascading.
 
 PigPen is Map-Reduce for Clojure - you write idiomatic Clojure code, we 
 compile it into an Apache Pig script or a Cascading flow that runs on Hadoop.
 
 https://github.com/Netflix/PigPen
 
 An RC build is currently available in Maven (0.3.0-rc.7). We've been using it 
 at Netflix for a little over a month now with no issues, but we want to get 
 it out in the wild before locking down the release.
 
 There are a couple of breaking changes in this release, mostly just moving 
 pig-specific functions into another namespace. Check out the release notes 
 for more details.
 
 Also new since the last major release: semi-joins, anti-joins, load-json, 
 store-json, load-csv (RFC 4180), load-parquet, store-parquet, and load-avro 
 (parquet  avro support not yet available for cascading).
 
 A huge thanks to Piotr Kozikowski for contributing all of the Cascading work 
 to the project.
 
 For questions or complaints: pigpen-supp...@googlegroups.com 
 (mailto:pigpen-supp...@googlegroups.com)
 
 -Matt
 
 
 ps. The PigPen name  logo aren't really ideal now that we've added another 
 platform and plan to add more. Apparently we're only clever enough for one 
 name  logo. If you've got an idea for a better name for the project, please 
 let us know. :)
 
 -- 
 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 
 (mailto:clojure@googlegroups.com)
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com 
 (mailto:clojure+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com 
 (mailto:clojure+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/d/optout.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] PigPen 0.3.0 - Now with Cascading!

2015-05-11 Thread Matt Bossenbroek
I'm excited to announce the release of PigPen v0.3.0, which now includes 
support for Cascading.

PigPen is Map-Reduce for Clojure - you write idiomatic Clojure code, we 
compile it into an Apache Pig script or a Cascading flow that runs on 
Hadoop.

https://github.com/Netflix/PigPen

An RC build is currently available in Maven (0.3.0-rc.7). We've been using 
it at Netflix for a little over a month now with no issues, but we want to 
get it out in the wild before locking down the release.

There are a couple of breaking changes in this release, mostly just moving 
pig-specific functions into another namespace. Check out the release notes 
for more details.

Also new since the last major release: semi-joins, anti-joins, load-json, 
store-json, load-csv (RFC 4180), load-parquet, store-parquet, and load-avro 
(parquet  avro support not yet available for cascading).

A huge thanks to Piotr Kozikowski for contributing all of the Cascading 
work to the project.

For questions or complaints: pigpen-supp...@googlegroups.com

-Matt


ps. The PigPen name  logo aren't really ideal now that we've added another 
platform and plan to add more. Apparently we're only clever enough for one 
name  logo. If you've got an idea for a better name for the project, 
please let us know. :)

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.7.0-beta2

2015-04-24 Thread Matt Mitchell
Awesome. Just tested it on our API and working well. Looking forward to a 
more in depth testing session!

- Matt

On Friday, April 24, 2015 at 2:27:40 PM UTC-4, Alex Miller wrote:

 Clojure 1.7.0-beta2 is now available.

 Try it via
 - Download: 
 https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-beta2/
 - Leiningen: [org.clojure/clojure 1.7.0-beta2]

 Regression fixes since 1.7.0-beta1:

 1) CLJ-1711 - structmap iterator broken
 2) CLJ-1709 - range wrong for step != 1
 3) CLJ-1713 - range chunks are not serializable
 4) CLJ-1698 - fix reader conditional bugs

 Additional enhancements to new features since 1.7.0-beta1:

 1) CLJ-1703 - Pretty print #error and new public function Throwable-map
 2) CLJ-1700 - Reader conditionals now allowed in the REPL
 3) CLJ-1699 - Allow data_readers.cljc as well as data_readers.clj
   
 For a full list of changes since 1.6.0, see:
 https://github.com/clojure/clojure/blob/master/changes.md

 Please give it a try and let us know if things are working (or not)!

 - Alex



-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure Applied: From Practice to Practitioner

2015-04-13 Thread Matt Mitchell
Just picked it up! Thanks Alex. Sounds like the sort of thing I've been 
wanting more info on for a while now. Looking forward to the reading!

- Matt

On Wednesday, April 8, 2015 at 9:27:58 AM UTC-4, Alex Miller wrote:

 Hey all,

 I'm very happy to announce that Clojure Applied is now available in beta:

 https://pragprog.com/book/vmclojeco/clojure-applied

 I've been working on this with Ben Vandgrift for a long time, hoping to 
 fill the underserved niche of *intermediate* Clojure material. Our goal 
 is to step in after you've read any of the fine introductory books and 
 provide the next level of guidance needed to successfully apply Clojure to 
 real problems.

 The chapters are:

 1. Model Your Domain - an overview of modeling domain entities, modeling 
 relationships, validating them, and creating domain operations.
 2. Collect And Organize Your Data - choosing the right collection, 
 updating collections, accessing collections, and building custom 
 collections.
 3. Processing Sequential Data - using sequence functions and transducers 
 to transform your data.
 4. State, Identity, and Change - modeling change and state with Clojure's 
 state constructs.
 5. Use Your Cores - waiting in the background, queues and workers, 
 parallelism with reducers, and thinking in processes with core.async.
 6. Creating Components - organizing your code with namespaces, designing 
 component APIs, connecting components with core.async channels, and 
 implementing components with state.
 7. Compose Your Application - assembling components, configuration, and 
 entry points.
 8. Testing Clojure - example- and property-based testing with 
 clojure.test, expectations, and test.check. 
 9. Playing With Others - details TBD
 10. Getting Out The Door - publishing your code and deploying your 
 application.

 Chapters 1-6 and 10 are available now in beta form. We expect to release a 
 new chapter every 2-3 weeks until completion. The printed book should be 
 available this fall.

 Alex


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Debugging in CIDER

2015-03-30 Thread Matt Mitchell
Awesome.

+1 for a new release too, lots of other good stuff in there too.

- Matt

On Saturday, March 28, 2015 at 1:46:33 PM UTC-4, Bozhidar Batsov wrote:

 Hey everyone,

 Just wanted to let you know that the most requested feature for CIDER (a 
 debugger, in case you're wondering) has just landed in the master branch (
 https://github.com/clojure-emacs/cider/pull/1019#issuecomment-87240470).

 The new CIDER debugger is inspired by edebug (Emacs's own debugger) and 
 based on https://github.com/razum2um/clj-debugger

 It's not super fancy and there's clearly room for improvement in both 
 clj-debugger and CIDER itself, but it's a pretty good first step. Please, 
 take the new debugger out for a spin and let us know what do you think 
 about it. You might also report any problems you've encountered. :-)

 If all is well, CIDER 0.9 will probably be released in a week or so.

 P.S. Thanks, Artur (https://github.com/Malabarba), for all the hard work 
 on the debugger! You've once again showed the power of the OSS! There's 
 nothing we can't build together!


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Who's using Clojure?

2015-03-16 Thread Matt Owen
We're using Clojure at Chartbeat.

On Tuesday, April 19, 2011 at 10:38:14 AM UTC-4, Damien wrote:

 Hi Everyone,

 I'm on a mission: introducing Clojure in my company, which is a big 
 consulting company like many others.

 I started talking about Clojure to my manager yesterday.
 I was prepared to talk about all the technical benefits and he was 
 interested.
 I still have a long way to go but I think that was a good start.

 However I need to figure out how to answer to one of his questions: who is 
 using Clojure?

 Obviously I know each of you is using Clojure, that makes almost 5,000 
 people.
 I know there is Relevance and Clojure/core.
 I read about BackType or FlightCaster using Clojure.

 But, let's face it, that doesn't give me a killer answer.

 What could help is a list of success stories, a bit like MongoDB published 
 here:
 http://www.mongodb.org/display/DOCS/Production+Deployments

 Is there a place where I could find this kind of information for Clojure?

 Thanks

 -- 
 Damien Lepage
 http://damienlepage.com



-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


core.async, System/currentTimeMillis, and leap seconds

2015-02-19 Thread Matt Havener
I was talking to a coworker about the implementation of core.async timers 
[0], and he mentioned it uses System/currentTimeMillis. I'm not a Java 
expert, but I believe currentTimeMillis can be affected by a leap second in 
some implementations of the JVM. If so, is it possible that a timeout 
channel could produce a value significantly later than expected?

- Matt

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[job] Clojure opportunity at Lucidworks

2015-02-06 Thread Matt Mitchell
Hello fellow Clojurians!

Lucidworks http://lucidworks.com is looking for a Clojure dev with 
experience in web API services; security exp. is a big bonus. We are 
considering remote devs but only in the US at this time. See the job posting 
http://lucidworks.com/company/careers/security-engineer/, and please ping 
me directly (not here) if you have specific questions - *matt.mitchell at 
lucidworks.com*

Really hope to hear from some of you!

- Matt Mitchell

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ANN: Sparse matrix support for Clojure with vectorz-clj 0.28.0

2014-12-29 Thread Matt Revelle
Yes, will do.

 On Dec 28, 2014, at 9:58 PM, Mike Anderson mike.r.anderson...@gmail.com 
 wrote:
 
 Looks like you have some good changes in your Vectorz branch - any chance you 
 could tidy up and make a PR?
 
 I like the idea of specialised getSlices and getColumns in particular - these 
 should be much faster than getting the slices one-by-one if the data is very 
 sparse.
 
 On Monday, 29 December 2014 09:43:54 UTC+8, Matt Revelle wrote:
 
 On Dec 28, 2014, at 7:28 PM, Mike Anderson mike.r.anderson...@gmail.com 
 mailto:mike.r.anderson...@gmail.com wrote:
 
 Interesting idea. The challenge is that I'm not sure how to add 
 representation specification in an implementation independent way. It's a 
 quirk of vectorz that it has both indexed and hashed storage, I probably 
 wouldn't expect any other implementations to have that. Likewise row and 
 column oriented storage are fairly obvious choices but I still wouldn't 
 expect every implementation to support both.
 
 Any idea how you would specify the API?
 
 I guess we could simply pass an optional map argument of options, but 
 behaviour would be completely implementation specific. 
 
 I think the map is the way to go. You’re probably correct about few other 
 implementations having as many options, but adding a map of “preferences” 
 seems like a good option. Creating a sparse matrix might then look like:
 
 ;; preferences as a separate arg
 (new-sparse-array [10 10] :vectorz {:order :row :indexed true})
 
 ;; an alternative, preferences combined with implementation selection
 (new-sparse-array [10 10] {:impl :vectorz :order :row :indexed true})
 
 Implementations should throw an exception if they don’t support (or 
 understand) the preferences.
 
 On Monday, 29 December 2014 02:12:05 UTC+8, Matt Revelle wrote:
 Glad to see the addition of new-sparse-array to core.matrix. It looks like 
 it defaults to SparseRowMatrix for the Vectorz implementation? Should the 
 API provide a way to specify which sparse matrix representation (e.g., row- 
 vs column-based, indexed vs hashed) should be used? I'd suggest a 3-arity 
 new-sparse-array which takes a keyword indicating the representation to use 
 as well as a new function which returns a list of available representations 
 for a specific implementation.
 
 I think at this point you incorporated (looks like we have some duplication 
 too, doh) all the changes I had made for sparse matrix support in Vectorz, 
 but will verify.
 
 I definitely haven't covered all the potential code paths - in particular a 
 lot of things aren't yet optimised for sparse operations. So any review / 
 patches would be appreciated!
 
 I did some optimization of sparse ops but the code probably needs to be 
 cleaned up before submitting (e.g., generalized and/or moved to the correct 
 level in class hierarchy). Those changes were made hastily when I needed to 
 quickly get a program running fast.
 
 A  branch containing all performance changes based on an older revision of 
 the develop branch is available here:
 https://github.com/mattrepl/vectorz/tree/sparse-speed 
 https://github.com/mattrepl/vectorz/tree/sparse-speed
 
 There is a related sparse-speed branch in my forks of vectorz-clj and 
 core.matrix.
 
 We should also look into other sparse array representations for Vectorz from: 
 Matlab, MTJ (https://github.com/fommil/matrix-toolkits-java 
 https://github.com/fommil/matrix-toolkits-java, specifically the 
 LinkedSparseMatrix for row and column ops), etc.
 
 -Matt
 
  
 
 On Saturday, December 27, 2014 4:56:55 AM UTC-5, Mike Anderson wrote:
 Here is a little belated Christmas present for Clojure data aficionados:
 
 ;; setup
 (use 'clojure.core.matrix)
 (set-current-implementation :vectorz)
 
 ;; create a big sparse matrix with a trillion elements (initially zero)
 (def A (new-sparse-array [100 100]))
 
 ;; we are hopefully smart enough to avoid printing the whole array!
 A
 = #SparseRowMatrix Large matrix with shape: [100,100]
 
 ;; mutable setter operations supported so that you can set individual sparse 
 elements
 (dotimes [i 1000]
  (mset! A (rand-int 100) (rand-int 100) (rand-int 100)))
 
 ;; all standard core.matrix operations supported
 (esum A)
 = 50479.0
 
 ;; efficient addition
 (time (add A A))
 = Elapsed time: 12.849859 msecs
 
 ;; matrix multiplication / inner products actually complete in sensible time
 ;; (i.e. much faster than than the usual O(n^3) which might take a few 
 thousand years)
 (time (mmul A (transpose A)))
 = Elapsed time: 2673.085171 msecs
 
 
 Some nice things to note about the implementation:
 - Everything goes through the core.matrix API, so your code won't have to 
 change to use sparse matrices :-)
 - Sparse matrices are 100% interoperable with non-sparse (dense) matrices
 - Sparse arrays are fully mutable. Management of storage / indexing happens 
 automatically
 - It isn't just matrices - you can have sparse vectors, N-dimensional arrays 
 etc

Re: ANN: Sparse matrix support for Clojure with vectorz-clj 0.28.0

2014-12-28 Thread Matt Revelle
Glad to see the addition of new-sparse-array to core.matrix. It looks like 
it defaults to SparseRowMatrix for the Vectorz implementation? Should the 
API provide a way to specify which sparse matrix representation (e.g., row- 
vs column-based, indexed vs hashed) should be used? I'd suggest a 3-arity 
new-sparse-array which takes a keyword indicating the representation to use 
as well as a new function which returns a list of available representations 
for a specific implementation.

I think at this point you incorporated (looks like we have some duplication 
too, doh) all the changes I had made for sparse matrix support in Vectorz, 
but will verify.

On Saturday, December 27, 2014 4:56:55 AM UTC-5, Mike Anderson wrote:

 Here is a little belated Christmas present for Clojure data aficionados:

 ;; setup
 (use 'clojure.core.matrix)
 (set-current-implementation :vectorz)

 ;; create a big sparse matrix with a trillion elements (initially zero)
 (def A (new-sparse-array [100 100]))

 ;; we are hopefully smart enough to avoid printing the whole array!
 A
 = #SparseRowMatrix Large matrix with shape: [100,100]

 ;; mutable setter operations supported so that you can set individual 
 sparse elements
 (dotimes [i 1000]
  (mset! A (rand-int 100) (rand-int 100) (rand-int 100)))

 ;; all standard core.matrix operations supported
 (esum A)
 = 50479.0

 ;; efficient addition
 (time (add A A))
 = Elapsed time: 12.849859 msecs

 ;; matrix multiplication / inner products actually complete in sensible 
 time
 ;; (i.e. much faster than than the usual O(n^3) which might take a few 
 thousand years)
 (time (mmul A (transpose A)))
 = Elapsed time: 2673.085171 msecs


 Some nice things to note about the implementation:
 - Everything goes through the core.matrix API, so your code won't have to 
 change to use sparse matrices :-)
 - Sparse matrices are 100% interoperable with non-sparse (dense) matrices
 - Sparse arrays are fully mutable. Management of storage / indexing 
 happens automatically
 - It isn't just matrices - you can have sparse vectors, N-dimensional 
 arrays etc.
 - Code is pure JVM - no native dependencies to worry about

 This is all still very much alpha - so any comments / patches / more 
 rigorous testing much appreciated!





-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ANN: Sparse matrix support for Clojure with vectorz-clj 0.28.0

2014-12-28 Thread Matt Revelle

 On Dec 28, 2014, at 7:28 PM, Mike Anderson mike.r.anderson...@gmail.com 
 wrote:
 
 Interesting idea. The challenge is that I'm not sure how to add 
 representation specification in an implementation independent way. It's a 
 quirk of vectorz that it has both indexed and hashed storage, I probably 
 wouldn't expect any other implementations to have that. Likewise row and 
 column oriented storage are fairly obvious choices but I still wouldn't 
 expect every implementation to support both.
 
 Any idea how you would specify the API?
 
 I guess we could simply pass an optional map argument of options, but 
 behaviour would be completely implementation specific. 

I think the map is the way to go. You’re probably correct about few other 
implementations having as many options, but adding a map of “preferences” seems 
like a good option. Creating a sparse matrix might then look like:

;; preferences as a separate arg
(new-sparse-array [10 10] :vectorz {:order :row :indexed true})

;; an alternative, preferences combined with implementation selection
(new-sparse-array [10 10] {:impl :vectorz :order :row :indexed true})

Implementations should throw an exception if they don’t support (or understand) 
the preferences.

 On Monday, 29 December 2014 02:12:05 UTC+8, Matt Revelle wrote:
 Glad to see the addition of new-sparse-array to core.matrix. It looks like it 
 defaults to SparseRowMatrix for the Vectorz implementation? Should the API 
 provide a way to specify which sparse matrix representation (e.g., row- vs 
 column-based, indexed vs hashed) should be used? I'd suggest a 3-arity 
 new-sparse-array which takes a keyword indicating the representation to use 
 as well as a new function which returns a list of available representations 
 for a specific implementation.
 
 I think at this point you incorporated (looks like we have some duplication 
 too, doh) all the changes I had made for sparse matrix support in Vectorz, 
 but will verify.
 
 I definitely haven't covered all the potential code paths - in particular a 
 lot of things aren't yet optimised for sparse operations. So any review / 
 patches would be appreciated!

I did some optimization of sparse ops but the code probably needs to be cleaned 
up before submitting (e.g., generalized and/or moved to the correct level in 
class hierarchy). Those changes were made hastily when I needed to quickly get 
a program running fast.

A  branch containing all performance changes based on an older revision of the 
develop branch is available here:
https://github.com/mattrepl/vectorz/tree/sparse-speed

There is a related sparse-speed branch in my forks of vectorz-clj and 
core.matrix.

We should also look into other sparse array representations for Vectorz from: 
Matlab, MTJ (https://github.com/fommil/matrix-toolkits-java 
https://github.com/fommil/matrix-toolkits-java, specifically the 
LinkedSparseMatrix for row and column ops), etc.

-Matt

  
 
 On Saturday, December 27, 2014 4:56:55 AM UTC-5, Mike Anderson wrote:
 Here is a little belated Christmas present for Clojure data aficionados:
 
 ;; setup
 (use 'clojure.core.matrix)
 (set-current-implementation :vectorz)
 
 ;; create a big sparse matrix with a trillion elements (initially zero)
 (def A (new-sparse-array [100 100]))
 
 ;; we are hopefully smart enough to avoid printing the whole array!
 A
 = #SparseRowMatrix Large matrix with shape: [100,100]
 
 ;; mutable setter operations supported so that you can set individual sparse 
 elements
 (dotimes [i 1000]
  (mset! A (rand-int 100) (rand-int 100) (rand-int 100)))
 
 ;; all standard core.matrix operations supported
 (esum A)
 = 50479.0
 
 ;; efficient addition
 (time (add A A))
 = Elapsed time: 12.849859 msecs
 
 ;; matrix multiplication / inner products actually complete in sensible time
 ;; (i.e. much faster than than the usual O(n^3) which might take a few 
 thousand years)
 (time (mmul A (transpose A)))
 = Elapsed time: 2673.085171 msecs
 
 
 Some nice things to note about the implementation:
 - Everything goes through the core.matrix API, so your code won't have to 
 change to use sparse matrices :-)
 - Sparse matrices are 100% interoperable with non-sparse (dense) matrices
 - Sparse arrays are fully mutable. Management of storage / indexing happens 
 automatically
 - It isn't just matrices - you can have sparse vectors, N-dimensional arrays 
 etc.
 - Code is pure JVM - no native dependencies to worry about
 
 This is all still very much alpha - so any comments / patches / more rigorous 
 testing much appreciated!
 
 
 
 
 -- 
 You received this message because you are subscribed to a topic in the Google 
 Groups Numerical Clojure group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/numerical-clojure/LLpq4WHx-k8/unsubscribe 
 https://groups.google.com/d/topic/numerical-clojure/LLpq4WHx-k8/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 numerical

Core Banking And The Mechanics Of Money Creation

2014-12-17 Thread Matt Dean
Tim, I enjoyed reading your post. Having recently launched an online banking 
user interface for a credit union using the same principles you mentioned (and 
React), I agree that this represents the path forward for financial 
institutions, and a surprising number of credit union execs seem to feel the 
same. It's an intimidating idea for most but they're seeing the opportunity. 

To bring this back around to the mailing list topic, we've recently started a 
new banking front end using clojurescript, with a liberator-based mock API for 
development. The experience has been fantastic and we're looking forward to 
using Clojure as much as our clients can tolerate. 

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Charting Data Format Feedback Requested

2014-12-12 Thread Matt Revelle
I had started thinking about this problem recently too and also had broken 
it down to two parts. I was going to create a simple data frame protocol 
for a) and a ggplot2-inspired library which emits SVG for b). There is 
prior work for plotting in Incanter (using JFreeChart) and David Liebke 
also started a SVG-emitting plot library, Analemma 
(https://github.com/liebke/analemma). I believe there is some sort of data 
frame implementation in Incanter.

My motivation was for simple libraries which could be used to generate 
well-designed figures. I frequently end up exporting data from Clojure to R 
only for ggplot2. Having a data frame is useful for designing the plotting 
API or quickly collecting aggregate statistics for certain attributes or 
factor levels.

On Friday, December 12, 2014 4:29:37 AM UTC-5, Mike Anderson wrote:

 Lucas,

 Thanks for kicking off the discussion - great to see your proposal on 
 this. I think it will be really valuable if we can converge on a standard 
 way of representing this kind of data in Clojure/ClojureScript. Copying the 
 Incanter and main Clojure groups as well because I think there will be 
 broad interest in this.

 My view is that it is worth distinguishing (decomplecting?) two things:

 a) The format used to convey the actual data, i.e. the labelled :dataset 
 part of the data format suggested below
 b) The format used to specify the chart (chart type, axes etc.)

 I think a) Can be pretty closely linked to the standard core.matrix 
 dataset / n-dimensional array structure. 

 b) is much harder and may call for something more like ggplot2, also worth 
 checking out Kevin Lynagh's c2 work (https://keminglabs.com/c2/)

 Therefore it may be easier to tackle a) in isolation first. b) will 
 probably need more experimentation before we can settle on something 
 sufficiently well designed and general.
  
 On Thursday, 11 December 2014 17:45:00 UTC+8, Lucas Bradstreet wrote:

 Hi everyone,

 We are currently writing an OM based visualisation / charting library 
 that we
 intend to use extensively in combination with core.matrix and other data
 analysis libraries/tools (e.g. gorilla REPL, incanter, etc). 

 Some of the goals of this library:
 - Provide a clojurescript wrapper for common visualisation libraries (C3,
   dimple, Rickshaw, NVD3) for standard charting features.
 - Provide a generic data format, with conversion functions to native 
 charting
   library formats.
 - Provide transformation functions between core.matrix datasets, incanter
   datasets, etc to this generic charting format.
 - Provide update functions to allow datasets to seamlessly be updated 
 with the
   addition of data-points in map and vector formats.
 - Provide seamless transitions when a dataset is updated, ala om.

 We would like to hear any of your thoughts regarding the following 
 charting
 data format below. This format maps fairly closely to core.matrix datasets
 (note, although core.matrix datasets currently do not allow labelled
 dimensions, this support is incoming).

 {:axes [{:label X axis label :type :category}
 {:label Y axis label :type :category}
 {:label Z axis label :type :measure}
 {:label C axis label :type :color}]
:chart-type :area
:dataset {:labels [; 0th dimension is labelled from the 0th dimension 
 of the 1st
  ; 1st dimension labels (i.e. columns)
   [timestamp event-count magnitude colour]
   ; 2nd dimension labels (i.e. series)
   [series1 series2 series3]] 
  :data [[; series 1 data
  [1 2 3 4] ; timestamp values
  [100 200 300 400] ; event count value
  [50 100 150 200] ; magnitude values
  [25 50 75 100] ; colour values
  ]
 [[1 2 3 4]
  [1 200 3 4] 
  [5 7 444 8] 
  [9 10 11 12]]
 [[1 2 3 4]
  [1 2 3 4] 
  [5 9 7 8] 
  [9 10 11 12]]]}}

 The above format is close to the native format used by C3, and can be 
 easily mapped
 to a format that is more easily consumed by dimple charts:

 {:axes [{:key timestamp, :type :category, :label X axis label} 
 {:key event-count, :type :category, :label Y axis label} 
 {:key magnitude, :type :measure, :label Z axis label} 
 {:key colour, :type :color, :label C axis label}], 
  :chart-type :area, 
  :dataset [{:name series1, 
 :values [{colour 25, magnitude 50, event-count 100, 
 timestamp 1} 
  {colour 50, magnitude 100, event-count 200, 
 timestamp 2} 
  {colour 75, magnitude 150, event-count 300, 
 timestamp 3} 
  {colour 100, magnitude 200, event-count 400, 
 timestamp 4}]} 
{:name series2, 
 :values [{colour 9, magnitude 5, event-count 1, 
 timestamp 1} 
  {colour 10, magnitude 7, event-count 

Re: Map holds on to element being processed

2014-11-11 Thread 'Matt Bossenbroek' via Clojure
Thanks! I was playing around with similar variants last night  came up with 
some that seem to work for one element, but not many.

I was seeing a similar result from your version:

= (map2 count [(repeat 1e8 stuff) (repeat 1e8 stuff) (repeat 1e8 
stuff)]) 
OutOfMemoryError GC overhead limit exceeded
java.lang.Double.valueOf (Double.java:521)
clojure.lang.Numbers$DoubleOps.dec (Numbers.java:628)
clojure.lang.Numbers.dec (Numbers.java:118)
clojure.core/take/fn--4270 (core.clj:2627)
clojure.lang.LazySeq.sval (LazySeq.java:40)
clojure.lang.LazySeq.seq (LazySeq.java:49)
clojure.lang.Cons.next (Cons.java:39)
clojure.lang.RT.countFrom (RT.java:540)
clojure.lang.RT.count (RT.java:530)
clojure.core/count (core.clj:839)
pigpen.runtime/map2/fn--1344 (NO_SOURCE_FILE:5)
clojure.lang.LazySeq.sval (LazySeq.java:40)

But then it dawned on us to try a list instead of a vector for the main seq:

= (map2 count (list (repeat 1e8 stuff) (repeat 1e8 stuff) (repeat 1e8 
stuff))) 
(1 1 1)


It does end up thrashing with GCs a bit, but in the end it does the job. It 
seems like the vector was holding on to something that the list doesn't.

It's unfortunate that I would need a custom map implementation to make this 
work. Elsewhere in the code I (somewhat accidentally) ended up using async 
channels to solve the same problem. Instead of modeling the large collection as 
a lazy seq, I have a producer put items into a collection and a consumer read 
from the collection and transform them (count in this example).

In general, would it be better to use channels instead of lazy seqs for very 
large sequences? Lazy seqs seem to have a couple of disadvantages at scale: you 
have to be really careful not to hold on to the head (frequently this is hidden 
anyway), and the evaluation of the lazy seq seems to stress out the GC.

Are there other alternatives for large seqs that are better than either of 
these options?

Thanks,
Matt




On Monday, November 10, 2014 at 10:47 PM, Andy Fingerhut wrote:

 At least in your particular case, replacing map with map2, defined below as a 
 small modification to a subset of map, seems to do the trick:
 
 (defn map2 [f coll]
   (lazy-seq
(when-let [s (seq coll)]
  (let [r (rest s)]
(cons (f (first s)) (map2 f r))
 
 
 (map2 count [(repeat 1e8 stuff)])
 
 I believe this is because the original definition of map, or the subset of it 
 below:
 
 (defn map [f coll]
   (lazy-seq
(when-let [s (seq coll)]
  (cons (f (first s)) (map f (rest s))
 
 
 holds onto the head via needing to keep the value of s around throughout 
 the entire call to (f (first s)) in order to later make the call (map f (rest 
 s)).  In map2, the value of s is no longer needed by the time f is called.
 
 Andy
 
 On Mon, Nov 10, 2014 at 7:48 PM, 'Matt Bossenbroek' via Clojure 
 clojure@googlegroups.com (mailto:clojure@googlegroups.com) wrote:
  Ran into an interesting problem today. In short, this works: 
  
  (count (repeat 1e8 stuff)) 
  
  But this doesn't:
  
  (map count [(repeat 1e8 stuff)])
  
  To be fair, given sufficient memory, it would eventually complete. (If the 
  second example does work for you, change it to 1e10 or something higher).
  
  The first one works because nothing is holding on to the head of the seq. 
  My assumption is that the second is eating memory because map still has a 
  reference to the item being processed, while the call to count is causing 
  it to be evaluated. Thus the whole seq is retained and we run out of memory.
  
  Is my guess correct? If so, is there a workaround for this?
  
  Thanks,
  Matt
  
  -- 
  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 
  (mailto:clojure@googlegroups.com)
  Note that posts from new members are moderated - please be patient with 
  your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com 
  (mailto:clojure%2bunsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
  --- 
  You received this message because you are subscribed to the Google Groups 
  Clojure group.
  To unsubscribe from this group and stop receiving emails from it, send an 
  email to clojure+unsubscr...@googlegroups.com 
  (mailto:clojure+unsubscr...@googlegroups.com).
  For more options, visit https://groups.google.com/d/optout.
 
 -- 
 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 
 (mailto:clojure@googlegroups.com)
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com 
 (mailto:clojure+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

Map holds on to element being processed

2014-11-10 Thread 'Matt Bossenbroek' via Clojure
Ran into an interesting problem today. In short, this works: 

(count (repeat 1e8 stuff)) 

But this doesn't:

(map count [(repeat 1e8 stuff)])

To be fair, given sufficient memory, it would eventually complete. (If the 
second example does work for you, change it to 1e10 or something higher).

The first one works because nothing is holding on to the head of the seq. My 
assumption is that the second is eating memory because map still has a 
reference to the item being processed, while the call to count is causing it to 
be evaluated. Thus the whole seq is retained and we run out of memory.

Is my guess correct? If so, is there a workaround for this?

Thanks,
Matt

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pigpen newbie question

2014-09-15 Thread 'Matt Bossenbroek' via Clojure
Sunil,

I tried upgrading PigPen to Instaparse 1.3.4, but that pulled in Clojure 1.6.0 
 now I'm running into some build/jar/versioning issues. I don't think I'll be 
able to get the update out as soon as promised, but it sounds like not using 
1.7.0 will work for you in the meantime. 

-Matt


On Thursday, September 11, 2014 at 7:52 PM, Sunil S Nandihalli wrote:

 Thanks Mark and Matt, changing the version back to clojure version 1.6.0 
 fixed it.
 Sunil
 
 
 On Fri, Sep 12, 2014 at 7:05 AM, 'Matt Bossenbroek' via Clojure 
 clojure@googlegroups.com (mailto:clojure@googlegroups.com) wrote:
  Just saw this response - disregard the questions I asked you on the pigpen 
  support DL. 
  
  I'll pull in the new instaparse  get a new PigPen build out soonish 
  (within a day or two). 
  
  -Matt
  
  
  On Thursday, September 11, 2014 at 6:28 PM, Mark Engelberg wrote:
  
   You're probably using Clojure 1.7.0 alpha 2, which introduced a new 
   function called cat into the core namespace, which overlaps with a 
   function in instaparse.
   
   A couple nights ago, I updated instaparse to version 1.3.4, with an 
   update to deal with this change in alpha 2, but pigpen has not yet been 
   updated to use that version of instaparse.
   
   You can either go back to a non-alpha release of Clojure, or wait for the 
   pigpen folks to update, or perhaps there is some leiningen-fu you can do 
   in the project.clj file to override the instaparse dependency loaded by 
   pigpen with instaparse 1.3.4.
   
   On Thu, Sep 11, 2014 at 5:16 PM, Sunil S Nandihalli 
   sunil.nandiha...@gmail.com (mailto:sunil.nandiha...@gmail.com) wrote:
Hi ,
 I am trying to compile a simple clj file which does nothing apart from 
requiring the pigpen name-space and it fails to compile with the 
following error. Can anybody help?

Attempting to call unbound fn: #'instaparse.combinators-source/cat

the full stack trace is here. 
https://gist.github.com/sunilnandihalli/b400e21552ca97038e56

Thanks,
Sunil.


-- 
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 
(mailto:clojure@googlegroups.com)
Note that posts from new members are moderated - please be patient with 
your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com 
(mailto:clojure%2bunsubscr...@googlegroups.com)
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google 
Groups Clojure group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to clojure+unsubscr...@googlegroups.com 
(mailto:clojure+unsubscr...@googlegroups.com).
For more options, visit https://groups.google.com/d/optout.
   
   -- 
   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 
   (mailto:clojure@googlegroups.com)
   Note that posts from new members are moderated - please be patient with 
   your first post.
   To unsubscribe from this group, send email to
   clojure+unsubscr...@googlegroups.com 
   (mailto:clojure+unsubscr...@googlegroups.com)
   For more options, visit this group at
   http://groups.google.com/group/clojure?hl=en
   --- 
   You received this message because you are subscribed to the Google Groups 
   Clojure group.
   To unsubscribe from this group and stop receiving emails from it, send an 
   email to clojure+unsubscr...@googlegroups.com 
   (mailto:clojure+unsubscr...@googlegroups.com).
   For more options, visit https://groups.google.com/d/optout.
  
  -- 
  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 
  (mailto:clojure@googlegroups.com)
  Note that posts from new members are moderated - please be patient with 
  your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com 
  (mailto:clojure%2bunsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
  --- 
  You received this message because you are subscribed to the Google Groups 
  Clojure group.
  To unsubscribe from this group and stop receiving emails from it, send an 
  email to clojure+unsubscr...@googlegroups.com 
  (mailto:clojure+unsubscr...@googlegroups.com).
  For more options, visit https://groups.google.com/d/optout.
 
 -- 
 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 
 (mailto:clojure@googlegroups.com)
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe

Re: pigpen newbie question

2014-09-11 Thread 'Matt Bossenbroek' via Clojure
Just saw this response - disregard the questions I asked you on the pigpen 
support DL. 

I'll pull in the new instaparse  get a new PigPen build out soonish (within a 
day or two). 

-Matt


On Thursday, September 11, 2014 at 6:28 PM, Mark Engelberg wrote:

 You're probably using Clojure 1.7.0 alpha 2, which introduced a new function 
 called cat into the core namespace, which overlaps with a function in 
 instaparse.
 
 A couple nights ago, I updated instaparse to version 1.3.4, with an update to 
 deal with this change in alpha 2, but pigpen has not yet been updated to use 
 that version of instaparse.
 
 You can either go back to a non-alpha release of Clojure, or wait for the 
 pigpen folks to update, or perhaps there is some leiningen-fu you can do in 
 the project.clj file to override the instaparse dependency loaded by pigpen 
 with instaparse 1.3.4.
 
 On Thu, Sep 11, 2014 at 5:16 PM, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com (mailto:sunil.nandiha...@gmail.com) wrote:
  Hi ,
   I am trying to compile a simple clj file which does nothing apart from 
  requiring the pigpen name-space and it fails to compile with the following 
  error. Can anybody help?
  
  Attempting to call unbound fn: #'instaparse.combinators-source/cat
  
  the full stack trace is here. 
  https://gist.github.com/sunilnandihalli/b400e21552ca97038e56
  
  Thanks,
  Sunil.
  
  
  -- 
  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 
  (mailto:clojure@googlegroups.com)
  Note that posts from new members are moderated - please be patient with 
  your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com 
  (mailto:clojure%2bunsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
  --- 
  You received this message because you are subscribed to the Google Groups 
  Clojure group.
  To unsubscribe from this group and stop receiving emails from it, send an 
  email to clojure+unsubscr...@googlegroups.com 
  (mailto:clojure+unsubscr...@googlegroups.com).
  For more options, visit https://groups.google.com/d/optout.
 
 -- 
 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 
 (mailto:clojure@googlegroups.com)
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com 
 (mailto:clojure+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com 
 (mailto:clojure+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/d/optout.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: using Stuarts component library correctly

2014-08-10 Thread Matt Mitchell
Here's some relevant info about tools.namespace and 
protocols: https://github.com/clojure/tools.namespace#warnings-for-protocols

- Matt

On Saturday, August 9, 2014 6:04:03 PM UTC-4, Sven Richter wrote:

 Hi,

 First I would like to thank everybody for your answers and hints.

 I setup a small project you can find here: 
 https://github.com/sveri/component_test
 You can run it with lein repl and then calling (go).

 I have three questions/problems for this one:
 1. Did I separate the handler and the server correctly (I was trying to 
 follow your advices)?

 2. In scheduler.clj I defined a protocol (additionally to the lifecycle 
 protocol) and a record implementing that protocol. I create a new instance 
 of that record and pass it down to the handler and there to the routes. 
 Now, when I open a webpage and go to http://localhost:3000/sched 
 everything works fine.
 Next I edit the add-job function in scheduler.cljs to print something 
 different like this:
 (add-job [this]
 (println new sys out))
 Just a small change is enough. If you go to the webpage again and try to 
 reload it an exception will be thrown:
 Sat Aug 09 23:52:28 CEST 2014 [worker-3] ERROR - GET /sched
 java.lang.IllegalArgumentException: No implementation of method: :add-job 
 of protocol: #'component-test.scheduler/ISched found for class: 
 component_test.schedul
 er.Sched
 at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:544)
 at 
 component_test.scheduler$eval6553$fn__6554$G__6544__6559.invoke(scheduler.clj:6)
 at component_test.routes$sched_in.invoke(routes.clj:8)
 at component_test.routes$home_routes$fn__3312.invoke(routes.clj:19)
 at compojure.core$make_route$fn__2331.invoke(core.clj:99)
 at compojure.core$if_route$fn__2315.invoke(core.clj:45)
 ...

 I dont really understand why that happens and any hints regarding what I 
 am doing wrong would be great. And this leads to my last question.

 3. After having an exception I will usually try to reset the system with: 
 (reset), but in this case (and many different other cases) I will just get 
 another error:
 component-test.user= (reset)
 :reloading (component-test.scheduler component-test.routes 
 component-test.server component-test.handler component-test.core 
 component-test.user component-test.c
 ore-test)
 ;; Starting HTTP-Kit server on port 3000

 BindException Address already in use: bind  sun.nio.ch.Net.bind0 
 (Net.java:-2)

 And now all I can do is exit the repl and start it again to get my code 
 running.

 This is exactly what I dont want to do all the time and the problem I 
 thought would be solved by the component library, so once more, every hint 
 you have for me will be valuable about what I can do and what not.

 Best Regards,
 Sven

 Am Freitag, 8. August 2014 13:16:49 UTC+2 schrieb Sven Richter:

 Hi,

 I am trying to integrate Stuarts component library into my application. I 
 am not sure if I use it correctly or do something else wrong or just have a 
 wrong mindset. So I will explain how I am currently using it and the 
 problem I see with it.

 I have three components: database, a scheduler and web application (note 
 that my example is simplified to get faster to the point). These components 
 are built like this:

 (component/system-map
   :database (db db-uri)
   :scheduler (component/using (scheduler) [:database])
   :web-app (component/using (web-app)
 [:database
  :scheduler] ))

 And in my web-app I do something like this:

 (start [component]
 (let [db-conn (get-in web-app [:database :db-conn])]
   (assoc component :server
(run-server (make-handler web-app db-conn) {:port 
 port}

 And make-handler is a middleware that associates the database component 
 into the request map.

 Now as I added the scheduler to my system it occured to me that I will 
 have to associate the scheduler into the request map too to access it and I 
 might have to do that for every other component that is coming along the 
 road.
 So basically I am tying my web-app to to all these components and I am 
 tying some components to other components (like scheduler component to the 
 database component).

 And by tying this things together this way they do depend on each other 
 and I cannot move them anymore. This came to my mind as I started thinking 
 about microservices.

 So let's say I want to convert the scheduler into a restful microservice, 
 it's hard to pass in a database connection into it via HTTP, so it seems 
 like it's not decoupled enough. Does that make sense?

 Am I using it wrong? Is it ok to pass all kind of dependencies into the 
 request map and shove it around in the web application? Any other 
 suggestions / remarks?

 Best Regards,
 Sven



-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure

Re: using Stuarts component library correctly

2014-08-09 Thread Matt Mitchell
I use a closure, but with a slight twist in handler definitions. I close 
over a make-handler fn with the system component.. which returns a 
middleware-wrapped, dispatcher fn; the thing that handles the routing logic 
to a particular handler fun. Each of my handlers are 2 arg fns: (fn [system 
request]) - so the dispatcher passes-in the system to the appropriate 
handler at request-time along with the request.

The system instance is defined in the core ns of my app as a var, and I 
use the same approach Stuart does to deal with app state in a friendly way: 
stop/start and alter-var-root! - that's the only global state, and it's 
really only used for development purposes.

I'm still working out some kinks with testing. I recently moved from Midje 
to clojure.test. I use a lot of reify and proxy for mocking, but I'll 
gladly take this over with-redefs wherever possible. There's definitely 
room for improvement. For example, creating a test system etc..

- Matt

On Saturday, August 9, 2014 9:50:54 AM UTC-4, Brendan Younger wrote:

 I've struggled with the same issue as you, Sven.  In a web app, your 
 handlers wind up needing access to every other component in the system 
 because they are the first point of contact with the outside world.

 In my apps, I've done this one of two ways:

 1. Close over the needed dependencies when creating the ring handlers. 
  (Instead of just associating it into the request map.)  For example:

 (defn make-handler [db sched]
(routes
   (GET / request ...code which uses the db)
   (POST / request ...code which uses the scheduler...)))

 2. Make the system a global variable in your handler namespace.  For 
 example:

 (def system (atom nil))

 (defroutes all-the-routes
(GET / request ...do something with (:db @system)...))

 As long as you don't let code further down the chain rely on having a 
 :system key in the request map or a system global variable, you're still 
 achieving pretty good separation of concerns.

 Brendan

 On Friday, August 8, 2014 7:16:49 AM UTC-4, Sven Richter wrote:

 Hi,

 I am trying to integrate Stuarts component library into my application. I 
 am not sure if I use it correctly or do something else wrong or just have a 
 wrong mindset. So I will explain how I am currently using it and the 
 problem I see with it.

 I have three components: database, a scheduler and web application (note 
 that my example is simplified to get faster to the point). These components 
 are built like this:

 (component/system-map
   :database (db db-uri)
   :scheduler (component/using (scheduler) [:database])
   :web-app (component/using (web-app)
 [:database
  :scheduler] ))

 And in my web-app I do something like this:

 (start [component]
 (let [db-conn (get-in web-app [:database :db-conn])]
   (assoc component :server
(run-server (make-handler web-app db-conn) {:port 
 port}

 And make-handler is a middleware that associates the database component 
 into the request map.

 Now as I added the scheduler to my system it occured to me that I will 
 have to associate the scheduler into the request map too to access it and I 
 might have to do that for every other component that is coming along the 
 road.
 So basically I am tying my web-app to to all these components and I am 
 tying some components to other components (like scheduler component to the 
 database component).

 And by tying this things together this way they do depend on each other 
 and I cannot move them anymore. This came to my mind as I started thinking 
 about microservices.

 So let's say I want to convert the scheduler into a restful microservice, 
 it's hard to pass in a database connection into it via HTTP, so it seems 
 like it's not decoupled enough. Does that make sense?

 Am I using it wrong? Is it ok to pass all kind of dependencies into the 
 request map and shove it around in the web application? Any other 
 suggestions / remarks?

 Best Regards,
 Sven



-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Community Interest in a Clojure Application Config Library, using Zookeeper?

2014-05-22 Thread Matt Mitchell
+1 for open sourcing drcfg!

Might be interesting to apply the same idea (drcfg) to the SS component 
model, where a component manages the atoms instead of having to def them. I 
did something very similar but on top of Curator. One component defined as 
a service discovery component, and others that depend on it. The discovery 
component exposes a listenable interface; when a service is discovered 
the callbacks are fired and the dependent components are notified.

Related but slightly OT - I didn't think the component lib provided the 
ability to restart an individual component within a system?

- Matt

On Thursday, May 22, 2014 10:29:50 AM UTC-4, Thomas Steffes wrote:

 Currently config changes that require restart of a component are not 
 supported by our drcfg

 On Wednesday, May 21, 2014 12:59:18 PM UTC-4, Ben Mabey wrote:

 On 5/20/14, 3:33 PM, Thomas Steffes wrote: 
  Hey folks, 
  
  At Room Key we're using Apache Zookeeper and a home-grown clojure 
  library called drcfg for real-time application configuration 
  management. We're debating open-sourcing drcfg and are trying to gauge 
  community interest in such a tool. 
  
  We think it's got great usage semantics, basically you just def an 
  atom in any namespace where you'd like a variable that can be changed 
  in real-time on a running system. When you define the atom, you can 
  also provide defaults to fall back to if zookeeper is unavailable, a 
  validator to be run on any value when a change is attempted (to 
  prevent invalid configuration data), as well as some meta-data about 
  the variable. 
  
  We've also got a web UI we use to change configuration data, but that 
  would likely be released separate of drcfg itself. 
  
  If anyone's interested, could you reply to this post? I can provide 
  more information as well if need be. 
  
  
  -Thomas Steffes @ Room Key 
  
 Hi Thomas, 
 I'd be interested in learning more about your solution.  Have you ever 
 ran into the case where a config change needs to restart a component?   
 If so, have you written the logic that handles the updating of your 
 entire system based on this change?  e.g. a new DB config requires that 
 your DB component be restarted and each component that relies on the DB 
 component be restarted as well to get the new connection. 

 Thanks, 
 Ben 



-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ANN simple-time

2014-03-24 Thread Matt Bossenbroek
Thanks for the tip - I was not aware of that! 

Thanks,
Matt


On Monday, March 24, 2014 at 4:48 AM, Zoka wrote:

 Hi Matt,
 
 Looks very good  - the little speed up  you can make is to use :const 
 attribute for conversion constants such as
  milliseconds-per-XXX  , so there is no var lookup overhead during runtime.
 
 -- 
 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 
 (mailto:clojure@googlegroups.com)
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com 
 (mailto:clojure+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com 
 (mailto:clojure+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/d/optout.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ANN simple-time

2014-03-23 Thread Matt Bossenbroek
That's correct - I defined timespan to be independent of any specific datetime, 
but there's add-years, add-months, add-days, etc if you do need to move 
relative to a specific date.

I do plan to add timezones as the next feature, just haven't gotten around to 
it yet. For my use cases so far I haven't needed it. Generally all I care about 
is how far I am from UTC, which is available via (- (now) (utc-now)).

I wasn't aware of clojure.joda-time, but I like that it favors LocalDateTime 
(what I use). One motivation for making this in the first place was asking 
clj-time what the date was and it being wrong for 8 hours every day :)

-Matt


On Saturday, March 22, 2014 at 2:35 AM, dm3 wrote:

 Hey, this looks really simple and nice. 
 
 So, to map Joda concepts to simple-time -  a timespan is a standard Period (1 
 day is always 24 hours) and a datetime doesn't have a timezone, so more akin 
 to LocalDateTime, right?
 
 There's also https://github.com/dm3/clojure.joda-time, in case you haven't 
 seen it - more of a complete Joda API wrapper.
 
 On Thursday, 20 March 2014 20:15:55 UTC+2, Matt Bossenbroek wrote:
  It is my pleasure to announce simple-time to the world: 
  https://github.com/mbossenbroek/simple-time
  
  simple-time is a dead simple datetime  timespan library for Clojure. It's 
  an opinionated alternative for clj-time that takes a more functional twist 
  on the object-heavy Joda time library.
  
  Full API is here: 
  http://mbossenbroek.github.io/simple-time/simple-time.core.html
  
  Read more about the motivation for simple-time here: 
  https://github.com/mbossenbroek/simple-time#motivations
  
  Enjoy!
  
  -Matt
  
 -- 
 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 
 (mailto:clojure@googlegroups.com)
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com 
 (mailto:clojure+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com 
 (mailto:clojure+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/d/optout.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ANN simple-time

2014-03-20 Thread Matt Bossenbroek
It is my pleasure to announce simple-time to the 
world: https://github.com/mbossenbroek/simple-time

simple-time is a dead simple datetime  timespan library for Clojure. It's 
an opinionated alternative for clj-time that takes a more functional twist 
on the object-heavy Joda time library.

Full API is 
here: http://mbossenbroek.github.io/simple-time/simple-time.core.html

Read more about the motivation for simple-time 
here: https://github.com/mbossenbroek/simple-time#motivations

Enjoy!

-Matt

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] PigPen 0.2.0

2014-03-05 Thread Matt Bossenbroek
Announcing PigPen 0.2.0!

https://github.com/Netflix/PigPen

PigPen is map-reduce for Clojure, or distributed Clojure. Write idiomatic 
Clojure code and run it on thousands of machines.

New in 0.2.0:
 * Brand new wiki: https://github.com/Netflix/PigPen/wiki
 * Performance improvements!
 * Fold: https://github.com/Netflix/PigPen/wiki/Folding-Data
   - similar to 
https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/reducers.clj#L84
 * Better support for closures: 
https://github.com/Netflix/PigPen/wiki/Closures

Come see my talk at clojure/west: 
http://www.clojurewest.org/speakers/matt-bossenbroek

Questions  Complaints: pigpen-supp...@googlegroups.com

PigPen does use Apache Pig, but it uses it as a host language, similar to 
how Clojure uses the JVM. It's not a Clojure wrapper for writing Pig 
scripts.

Enjoy!

-Matt

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Gorilla REPL initial release (0.1.2)

2014-02-20 Thread Matt Mower
Jony this thing is totally cool. Forget the plotting as a REPL for 
exploring stuff (with the ability to restore sessions) it's very nice.

m/

On Wednesday, 19 February 2014 21:23:02 UTC, Jony Hudson wrote:


  I'm pleased to announce the first release of Gorilla REPL, a rich REPL in 
 the notebook style:



-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Gorilla REPL initial release (0.1.2)

2014-02-20 Thread Matt Mower
Couple of feature requests:

move segment up/down

and

MathML support (it's been 20 years since I did any Latex although its 
undoubtedbly cool!)

m/

On Wednesday, 19 February 2014 21:23:02 UTC, Jony Hudson wrote:

 Hi All,

  I'm pleased to announce the first release of Gorilla REPL, a rich REPL in 
 the notebook style:

 https://github.com/JonyEpsilon/gorilla-repl



-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Is it possible to get Clojure files in Spotlight search?

2014-02-19 Thread Matt Mower
Hi.

I recently bought a nice OSX app called Tembo which makes spotlight 
searching a more pleasant experience. In particular it has a Source Code 
grouping which is handy but know nothing about Clojure files.

I spoke to the author of Tembo and quote his response here

Tembo relies on the Universal Type Identifier hierarchy to map files to 
groups.
It hard-codes only very few exception. In the case of source code, there 
is currently no exception.

It will probably not be possible to hard-code an exception for clj/cljs
Tembo works only with UTIs. The application owning the clj file extension 
will need to provide the mapping from file extension to UTI
When doing so, it can also specify which high level UTI this conforms to. 
I.e. it can declare it to be source code.

Googling the file extension, I found this: 
http://softnoise.wordpress.com/tag/quicklook/

It is a hack to have a QuickLook plug-in declare the UTI. This should be 
good enough and should get QuickLook working.
You probably won't have Spotlight indexing the file contents though.

I had a look at the QLColourCode plugin but it doesn't build for me in 
Xcode4 and doesn't appear to be maintained. There's also a suggestion that 
it stopped working in the 10.6-10.7 transition.

Do any Clojure users on OSX have a working solution for this problem?

Kind regards,

Matt

p.s. I realise this is a Mac specific question but I figured I had a better 
shot of finding an answer among Clojure using Mac folk.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: use/require/import and quoted form

2014-02-07 Thread Matt Mitchell
Can you give a code example?

- Matt

On Thursday, February 6, 2014 3:15:13 AM UTC-5, Andy Smith wrote:

 Hi,

 I was wondering why use/require and import take quoted forms as their 
 arguments, other alternatives could be strings or keywords, so what is 
 special about the choice of quoted form here?

 Andy


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Introducing PigPen: Map-Reduce for Clojure

2014-01-03 Thread Matt Bossenbroek
I would recommend the Pig setup guide 
here: http://pig.apache.org/docs/r0.11.0/start.html

Then you can run it like this:

$ pig -x local -f my-script.pig

That said, you really only have to install Pig if you want to run it on a 
cluster. To run/test/develop queries locally, you can use the dump function 
(http://netflix.github.io/PigPen/pigpen.core.html#var-dump) to return data 
in the REPL.

-Matt


On Friday, January 3, 2014 1:51:36 AM UTC-8, puzzler wrote:

 This is exciting!

 Not knowing anything about Pig, is there a walkthrough somewhere that 
 demonstrates how to set up the kind of environment and install the pig 
 tools necessary to run the pig scripts generated by PigPen?

 Thanks,

 Mark


-- 
-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Introducing PigPen: Map-Reduce for Clojure

2014-01-02 Thread Matt Bossenbroek
Today we (Netflix) released PigPen; Map-Reduce for Clojure!

PigPen allows you to write what looks like regular Clojure code and compile 
it to an Apache Pig script that can be used in a Hadoop map-reduce cluster.

Check out the blog post  other links below for more info:

Blog post: 
http://techblog.netflix.com/2014/01/introducing-pigpen-map-reduce-for.html
Github: https://github.com/Netflix/PigPen
API docs: http://netflix.github.io/PigPen/pigpen.core.html
Tutorial: https://github.com/Netflix/PigPen/blob/master/Tutorial.md

-Matt

-- 
-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Video: Generating Beautiful (and Correct) Documentation from Unit Tests Files

2013-09-26 Thread Matt Mitchell
Very nice! Does lein-midje-doc use the Midje fact(s) labels?

- Matt

On Wednesday, September 25, 2013 10:33:31 PM UTC-4, zcaudate wrote:

 I've put up a video of a new documentation plugin for leiningen

 Project Page:
 https://github.com/zcaudate/lein-midje-doc

 Youtube Video:
 http://www.youtube.com/watch?v=8FjvhDPIUWEfeature=youtu.be


 Sample Generated Documentation:
 http://z.caudate.me/lein-midje-doc/
 http://z.caudate.me/ribol/
 http://z.caudate.me/ova/


 Any Comments or Feedback would be appreciated


-- 
-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Matt Mitchell
And also:

(mapcat identity {:in [1 2 3]}) = '(:in [1 2 3])

But yeah, destructuring with ** then using *apply* is pretty clear too.

- Matt

On Monday, September 9, 2013 10:41:12 PM UTC-4, Leif wrote:

 Careful - `flatten` recursively flattens sequential things.  E.g.
 (flatten (seq {:in [1 2 3]})) = '(:in 1 2 3), which is probably not what 
 you want.

 You really want `flatten1`, which doesn't exist in core.  A version that 
 works on maps is
 (apply concat {:in [1 2 3]}) = '(:in [1 2 3]).  This appears within 
 Alex's solution.

 I would personally go with Meikel's solution, though.  It seems the nicest.

 --Leif

 On Monday, September 9, 2013 7:02:43 PM UTC-4, Mark Mandel wrote:

 The solution I've actually gone with is:

 (apply esd/search es-index mapping-type (- options seq flatten))

 Seems the most consise and shows the intent of what I'm trying to do 
 quite well - better than a (relatively) confusing `reduce` statement.

 Again, the help is appreciated.

 Mark


 On Tue, Sep 10, 2013 at 8:57 AM, Mark Mandel mark@gmail.com wrote:

 Thanks for the help all, that gave me some things to think about.

 Cheers,

 Mark


 On Mon, Sep 9, 2013 at 9:22 PM, Meikel Brandmeyer (kotarak) 
 m...@kotka.de wrote:

 Hi,

 Am Montag, 9. September 2013 12:31:30 UTC+2 schrieb Alex Fowler:

 I would also add that in case, if you *need* to destructure the 
 `options` map for some reason, like:

 `(defn search
   Docstring
   [mapping-type  {:keys [option-1 option-2] :as options}]
   (do-smth-with-option-1 ...)
   (apply esd/search es-index mapping-type options))`

 then you can use `mapply` to apply maps to functions that accept 
 optional args maps. The code of mapply is the fllowing:

 `(defn mapply [f  args] (apply f (apply concat (butlast args) (last 
 args`

 Combining it with partial, as adviced, could give you the 
 functionality you may sometimes need:

 `(mapply (partial es/search es-index) your-options-map)`


 You don't have to destructure in the argument list:

 (defn search
   [mapping-type  options]
   (let [{:keys [option-1]} options
 index (index-based-on option-1)]
 (apply esd/search index mapping-type options)))

 Kind regards
 Meikel

  -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google 
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to clojure+u...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




 -- 
 E: mark@gmail.com
 T: http://www.twitter.com/neurotic
 W: www.compoundtheory.com

 2 Devs from Down Under Podcast
 http://www.2ddu.com/
  



 -- 
 E: mark@gmail.com
 T: http://www.twitter.com/neurotic
 W: www.compoundtheory.com

 2 Devs from Down Under Podcast
 http://www.2ddu.com/
  


-- 
-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Leiningen 2.3.0 released

2013-08-09 Thread Matt Mitchell
The upgrade ended up breaking lein on my system. This fix worked for me. 
Thanks!

On Friday, August 9, 2013 5:30:42 AM UTC-4, Jean Niklas L'orange wrote:

 Hey guys,

 I've hacked together a temporary fix for people who really, really, really 
 want to use 2.3.0 right away, or have broken their lein script and just 
 want to solve this the easy way. I would NOT recommend people to upgrade 
 right now, just wait until the jar has been set up with the right acl. (I 
 would be surprised if that's not the first thing Phil would do in the 
 morning.)

 If you've not tried to upgrade, do so and get the error message in your 
 face: lein upgrade should do the trick. Then go to the directory 
 ~/.lein/self-installs (or your equivalent directory on Windows). Download 
 https://github.com/hyPiRion/leiningen-2.3.0-tempfix/raw/temporary-fix/target/leiningen-2.3.0-standalone.jar
  (wget/curl) 
 and save it in the folder. Ensure that it has the name 
 leiningen-2.3.0-standalone.jar. That's all you need to do to get 2.3.0 
 working.

 Again: this is just a temporary fix, and it is packaged by me, not Phil. 
 However, it should be equivalent in terms of functionality, and there 
 shouldn't be any need to replace the jar once it's downloaded.

 I'll remove the repo with the temporary fix once it is possible to 
 download the official release once again.

 -- Jean Niklas


-- 
-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN Langohr 1.0 (final) is released

2013-07-29 Thread Matt Hoffman
Congrats!  Great library.


On Mon, Jul 29, 2013 at 2:35 AM, Michael Klishin 
michael.s.klis...@gmail.com wrote:

 Langohr [1] is a small, easy to use Clojure client for RabbitMQ.

 1.0.1 is a long overdue 1.0 release of the library that has been 2 years
 in the making and is one of the most popular ClojureWerkz projects.

 Release notes and some notes about future plans:
 http://blog.clojurewerkz.org/blog/2013/07/29/langohr-1-dot-0-1-is-released/

 1. http://clojurerabbitmq.info
 --
 MK

 http://github.com/michaelklishin
 http://twitter.com/michaelklishin

 --
 --
 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, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: is intellij idea a good ide for clojure development?

2013-07-28 Thread Matt Hoffman

 To be honest, I can't wait until we have something like that for Clojure.
 Give me a fast, light, InteliJ based IDE that just works 100% of the
 time, and I'd pay several hundred dollars for that software.


+1 to this.

I've used IntelliJ for years for Java, Javascript, HTML, SQL, ...
development. I've tried Eclipse about once a year for the last several
years, but I still prefer IntelliJ. A lot of that is personal preference
and what I'm used to.

But for Clojure development, I find that I prefer Emacs if I'm doing only
doing Clojure development and Intellij for mixed Java/Clojure development.
I still really like IntelliJ as an editor, but prefer Emacs for Clojure. I
also look forward to the day when I'll be able to use one tool for both.

I didn't know Emacs before starting Clojure, and the learning curve is
definitely steep, but I'm familiar with Vim, so Emacs + Evil mode has made
it a lot easier.

Here's some Emacs-like things in IntelliJ that I like (and Emacs users may
not know about):


- IntelliJ's interface can be scaled back to look like a text editor (see
http://confluence.jetbrains.com/display/IntelliJIDEA/User+Interface). Very
clean and uncluttered.

  -  it now has a dark theme now, which I prefer. Minor thing, but being
able to customize the UI is one of those small things that makes a small
but ongoing difference.

- It has a key sequence that opens up a run this action by name much like
Emacs' M-x. I use that a lot.

- Keybindings are infinitely customizable.


And unlike Emacs, it's Java integration is first-rate.


Here's some things in Emacs that I wish IntelliJ had:


- IntelliJ's has only a very loose approximation of paredit. Emacs is miles
ahead.

- IntelliJ's REPL cannot connect to a running nrepl server, which is a huge
pain for me. There are some branches of the La Clojure plugins that look
like they may address this, but they haven't had a release for a while now.
 Definitely not CCW levels of activity (Larent, are you sure you don't want
to work on IntelliJ? :) ) .

- Emacs is obviously far better over a remote connection of any kind, since
it's fundamentally text-based and works over an SSH connection. IntelliJ
doesn't even work well over a VNC/NX connection because of how it redraws
the screen (although there are some settings that may help with this). And
since IntelliJ's REPL can't connect to a remote nrepl server, you're out of
luck when working with a remote machine.

- That makes pairing with Emacs much easier, if both people happen to
know Emacs.

- Emacs gives the impression of being easier to customize.

- that's *mostly* an intangible thing -- I don't know elisp well enough
to write much, but I know where to start if I wanted to. And as Phil said,
it's low friction.

IntelliJ plugins, on the other hand, have a much higher barrier to entry,
so if I want behavior that doesn't happen to be available via a checkbox
I'm less likely to try adding it. Now, if IntelliJ's Clojure plugin had a
Clojure interface into its runtime, so that I could make changes via a
REPL, I think that'd be a killer feature...


I keep saying I'll try Eclipse again, since it has *much* better Clojure
support than IntelliJ (thanks to Laurent) and it's still a decent Java
environment, but I haven't tried it in a while. Certainly not since the
Kepler release. I'm going to check out Laurent's link above.

- matt




On Fri, Jul 26, 2013 at 10:56 AM, Timothy Baldridge tbaldri...@gmail.comwrote:

 +1 to Charlie. If I ever went back to Python development I would plop down
 whatever the going rate is for PyCharm (InteliJ Python IDE), that thing is
 an awesome piece of tech. There are very few times I've been utterly blown
 away by an idea all the standard features of Python (testing, debugging,
 code coverage, project structure, etc) are defaults in PyCharm. It even
 detects multiple versions of Python on your system and adds them to the
 intelisense and run menus.

 To be honest, I can't wait until we have something like that for Clojure.
 Give me a fast, light, InteliJ based IDE that just works 100% of the
 time, and I'd pay several hundred dollars for that software.

 Timothy


 On Fri, Jul 26, 2013 at 8:29 AM, Charlie Griefer 
 charlie.grie...@gmail.com wrote:

 On Jul 25, 2013, at 8:15 PM, Cedric Greevey cgree...@gmail.com wrote:

 Someone makes free software plugins for nonfree software?!


 On Thu, Jul 25, 2013 at 11:04 PM, Greg g...@kinostudios.com wrote:

 You submit patches to nonfree software?!



 I may regret asking this… but don't people deserve to get paid for their
 work? I mean if they choose to charge (I'm not putting down the free model
 at all)?

 And at $70 for ST 2, well as a developer I use an editor pretty
 frequently. I'm thinking that at $70, if I find the software helps me be
 productive, then it pretty much pays for itself some time during the first
 day.

  --
 Charlie Griefer
 http://charlie.griefer.comhttp://charlie.griefer.com

 Give light, and the darkness

Re: Interest in a commercial IDE for Clojure?

2013-07-28 Thread Matt Hoffman
I've been watching your fork on Github for a while -- I've been excited to
see that someone is actively working on La Clojure. I would pay for an
IntelliJ plugin that was significantly better than La Clojure, but I'm also
aware that I'd be paying just for my preference of IntelliJ over Eclipse
for mixed Java/Clojure development. For pure Clojure development, Emacs
would also be a contender. So that would be a really tough market.
It would be a tough sell for my company, as well. They pay for IntelliJ
Ultimate licenses, and if we told them we wanted to add in $200 more for a
Clojure plugin, I'd have to be prepared to re-open the just use Eclipse
argument.

I'd also contribute to a Kickstarter, if you decided to go that route. I
don't imagine you could make a living off of it that way, but you might be
able to recoup some of your time.  A couple of developers in my company
have talked about funding a bounty for nrepl integration alone.



On Sat, Jul 27, 2013 at 3:20 PM, kovas boguta kovas.bog...@gmail.comwrote:

 My suggestion: release as open source, and then try a kickstarter to see
 if there is interest in extending/continuing the project.

 IDE is a tough business. It has broken many. After all there is a reason
 intellij open-sourced the core in the first place.

 Frankly I think there is a bigger market in using clojure to develop
 better tools for other languages. If you have a nice intellij wrapper, then
 you have a huge advantage in developing tooling in general.

 On a side note, I would love to see intellij's widget library broken out
 in a more stand-alone way, so we can develop sexy clojure apps with pure
 jvm technology. Any thoughts on if that is technically doable?







 On Sat, Jul 27, 2013 at 4:54 AM, Colin Fleming 
 colin.mailingl...@gmail.com wrote:

 Hi all,

 I was planning to wait a little longer before going public, but since
 it's pretty relevant to the other IntelliJ thread going on at the moment I
 thought I'd jump in. For the last couple of months of happy unemployment
 I've been working on a fork of La Clojure which is now about 70% migrated
 to Clojure and significantly improved. It's a lot of work to develop a tool
 like this, and one of the options I'm considering is starting a company to
 develop it as a commercial product - JetBrains have never maintained
 development of La Clojure very actively. I've been doing a little market
 research but there's really not much data around about whether there are
 enough people working with Clojure to sustain a product like that, and also
 the community is currently very focused on open source.

 One problem is that the IDE space is already fairly fractured - there's
 Emacs and CCW, Clooj, Sublime Text and the promise of Light Table at some
 point, and of course the current public version of La Clojure. But there's
 still not a great option for something that's powerful but easy to use -
 CCW is probably the closest thing to this right now. However I think it's
 telling that a large fraction of people in the State of Clojure 2012 survey
 still identified development tools as a major pain point.

 I think that the IntelliJ platform is a fantastic base to build something
 like this on. Clojure as a language makes it pretty challenging to develop
 a lot of the great functionality that JetBrains are famous for, but I think
 there's scope to do a lot of great things. Certainly for mixed Clojure/Java
 projects it would be difficult to beat, but even for Clojure only projects
 I can imagine a lot of fantastic functionality built on their
 infrastructure. My plan would be to release a standalone IDE and a plugin
 for people using IntelliJ Ultimate for web dev, Ruby/Python or whatever.
 Since it's mostly Clojure now (and I'm migrating what's left as I get to
 it) there's a real possibility of a Clojure plugin/extension API. I
 envision charging PyCharm/RubyMine type prices, say $200 for company
 licenses or $100 for individual developers.

 So, I'd love to hear what people think. I'd appreciate it if we could
 stay away from the politics of open source vs proprietary - several people
 have told me privately that they'd rather use OSS and that's fine,
 proprietary isn't for everyone. What I'd like to know is if the idea is
 appealing to many people here?

 In case it's a concern for anyone, I've discussed this with JetBrains.

 Thanks for any feedback,

 Cheers,
 Colin

 --
 --
 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, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from 

using partial with -

2013-06-07 Thread Matt Smith
Newbie question here. This code:

(println (flatten(map first '([1 2] [3 4] [5]

 


(def mapfirst  (partial map first))
(println
 (- '([1 2] [3 4] [5])
 mapfirst
 flatten
 ))

 


(println
 (- '([1 2] [3 4] [5])
 (partial map first)
 flatten
 ))

prints out:

 (1 3 5)
 (1 3 5)
 ()


Could someone help me understand why the last println does not print (1 3 5)

thx.

-- 
-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: using partial with -

2013-06-07 Thread Matt Smith
Got it. Thanks!

On Friday, June 7, 2013 3:29:55 PM UTC-6, Jonathan Fischer Friberg wrote:

 On Fri, Jun 7, 2013 at 11:13 PM, Matt Smith matt.s...@gmail.comjavascript:
  wrote:

 (- '([1 2] [3 4] [5])
  (partial map first)
  flatten
  )


 Because this becomes

 (flatten (partial '([1 2] [3 4] [5]) map first))

 I think I understand how you thought; (partial map first) becomes a
 function, then I call this function with '([1 2] [3 4] [5]) which gives me
 what I want!. That is not how it works, - simple rearranges the forms,
 see the documentation: http://clojuredocs.org/clojure_core/clojure.core/-

 What you want is -
 http://clojuredocs.org/clojure_core/clojure.core/-

 Hope that's understandable.

 Jonathan


 On Fri, Jun 7, 2013 at 11:13 PM, Matt Smith matt.s...@gmail.comjavascript:
  wrote:

 Newbie question here. This code:

 (println (flatten(map first '([1 2] [3 4] [5]

  


 (def mapfirst  (partial map first))
 (println
  (- '([1 2] [3 4] [5])
  mapfirst
  flatten
  ))

  


 (println
  (- '([1 2] [3 4] [5])
  (partial map first)
  flatten
  ))

 prints out:

 (1 3 5)
 (1 3 5)
 ()


 Could someone help me understand why the last println does not print (1 3 
 5)

 thx.

 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+u...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  




-- 
-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Full stack Clojure web/REST framework - is there any mileage in it?

2013-01-11 Thread Matt
Though the Clojure community has traditionally gone with smaller libraries 
rather than large frameworks, there is a full-stack web framework for 
Clojure called Conjure: https://github.com/macourtney/Conjure


On Friday, January 11, 2013 11:52:05 AM UTC-5, Paul Umbers wrote:

 I've been experimenting with Clojure web services recently, and posting 
 the work on GitHub https://github.com/3rddog/doitnow and my 
 bloghttp://internistic.blogspot.ca/search/label/clojure
 .

 When putting this test app together, it occurred to me that most other 
 languages have a full-stack API available which makes life easier when it 
 comes to making decisions about which libraries/APIs/frameworks to use. It 
 also reduces the possibility of impedance mismatch between the libraries. 
 For Java, you can use Spring (or any one of a dozen or more other popular 
 frameworks), for Scala there's Typesafe, and so on. Clojure has Compojure, 
 Ring, several logging, validation and database libraries, and they can be 
 used together but they don't constitute a coordinated full stack - and that 
 creates issues.

 For example, the latest vesion of Compojure (1.1.3) uses Ring 1.1.5 and 
 not the latest version of Ring (1.1.6) which has significantly better util 
 functions available - but I can't use them until Compojure catches up. By 
 the time you add logging, validation, data access, etc the odds of a 
 mismatch between these libraries goes up dramatically.

 This is a concern, because these mismatches must be worked around in *my*code 
 and are likely to break as the libraries are upgraded in future 
 versions. So, I'm having to spend my time maintaining what are essentially 
 patches for third-party libraries just so that they work together.

 Now, it may not be the best decision to try to put together a true 
 full-stack framework from scratch, but is it worth choosing a bunch of 
 existing frameworks and coordinating their releases - in much the same way 
 as Eclipse coordinates plugin releases for major releases - so that putting 
 together a full-stack app becomes easier?

 Projects taking part in the meta-project will work together to harmonize 
 their functionality  APIs, and coordinate their development cycles  
 releases so that the meta-framework remains consistent and easily usable.

 Is this another barrier to adoption the Clojure community can remove? Is 
 this even a barrier? Am I missing something?

 Thoughts?

 [Also posted to http://www.reddit.com/r/Clojure]
  

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Are strings expensive for memory on the JVM?

2013-01-04 Thread Matt Hoyt
 a map where the key is the name of the site
 and the value is another map that has all of the info needed to connect to
 that sites database.
   (println Now we will iterate over the sites again. The time is: 
 (das/current-time-as-string))
   (doseq [[k db] @fg/database-connections]
 (println (apply str  We will now update  (str k)))
 (ura/update-recent-activity-from-this-site db k)
 (println (mem/show-stats-regarding-resources-used-by-this-app))
 (println (apply str (debug/thread-top)))
 (println  We are processing  (str k))
 (println This is what we currently have stored up as recent activity:
 )
   (println We will now wait 1 hour, then iterate over all of the sites
 again. The time is:  (das/current-time-as-string))
   (. java.lang.Thread sleep 360)
   (iterate-through-sites-and-output-files))

 The error I get:

 Exception in thread Thread-0 java.lang.OutOfMemoryError: Java heap space
 at java.util.Arrays.copyOf(Unknown Source)
 at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)
 at java.lang.AbstractStringBuilder.ensureCapacityInternal(Unknown
 Source)
 at java.lang.AbstractStringBuilder.append(Unknown Source)
 at java.lang.StringBuilder.append(Unknown Source)
 at clojure.core$str$fn__3501.invoke(core.clj:500)
 at clojure.core$str.doInvoke(core.clj:502)
 at clojure.lang.RestFn.applyTo(RestFn.java:139)
 at clojure.core$apply.invoke(core.clj:600)
 at
 recent_activity.core$iterate_through_sites_and_output_files.invoke(core.clj:33)
 at clojure.lang.AFn.run(AFn.java:24)
 at java.lang.Thread.run(Unknown Source)

 line 33 is:

   (println We will now wait 1 hour, then iterate over all of the sites
 again. The time is:  (das/current-time-as-string))

 That line looks innocent and it did not cause a problem before. It just
 stared causing a problem when I starting using emit-str to store the XML as
 a string in the atom recent-activity.

 That leads to 2 questions:

 1.) are strings expensive on memory?

 2.) what are the simplest profiling tools I can use to compare the memory
 use of emit-str versus what I was doing previously?

 I am giving up on the use of emit-str and I'm going to try a different
 approach. But I would be grateful for any insights about why I might have
 gotten the OutOfMemory error.




  --
 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, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Matt Hoyt

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Polymorphism based on predicates instead of dispatch value types

2012-11-09 Thread Matt Ridsdale
Thanks for the pointer, I haven't seen it and I'll be sure to give it a 
look when I have some time.

Matt

On Thursday, November 8, 2012 11:29:12 AM UTC+1, Philip Potter wrote:

 Have you seen David Nolen's conj 2011 talk, Predicate Dispatch? It 
 covers exactly this material, but looks at trying to be somewhat more 
 efficient by not making method dispatch O(n) in the number of 
 implementations. At least as far as I understand it anyway. 

 http://lanyrd.com/2011/clojure-conj/shhfg/ 

 Phil 

 On 7 November 2012 18:08, Matt Ridsdale mrid...@gmail.com javascript: 
 wrote: 
  Hi, 
  
  I was thinking about multimethods and the flexibility given by being 
 able to 
  dispatch on the value of an arbitrary function of the arguments, 
  instead of just the class of the first argument as in Java. It seems to 
 me 
  that we could be even more flexible if each method implementation 
  was associated with a predicate function of the args, instead of being 
  associated with a fixed dispatch value. See the below code for an 
 example of 
  what I mean: 
  
  (ns polymorphism 
(:use clojure.test)) 
  
  (def pm-to-dispatch-pred-map (ref {})) 
  
  ; these are kind of like multimethods, so let's give them a similar name 
 - 
  polymethods. 
  (defmacro defpoly [a-name [ args]] 
define a polymethod signature 
`(do 
   (defn ~a-name [~@args] 
   (let [dispatch-pred-to-impl-fn-map# (get 
  @polymorphism/pm-to-dispatch-pred-map ~a-name) 
 matching-keys# (filter #(apply % [~@args]) (keys 
  dispatch-pred-to-impl-fn-map#)) 
 num-matches# (count matching-keys#)] 
 (case num-matches# 
   0 (throw (Exception. (str No matching function defined for 
  polymethod  ~a-name  and args  [~@args]))) 
   1 (apply (get dispatch-pred-to-impl-fn-map# (first 
  matching-keys#)) [~@args]) 
   (throw (Exception. (str num-matches#  matching functions 
  defined for polymethod  ~a-name  and args  [~@args])) 
 (dosync (alter polymorphism/pm-to-dispatch-pred-map assoc ~a-name 
  {} 
  
  (defmacro defpolyimpl [a-name dispatch-pred  body] 
define a polymethod implementation, for a given dispatch predicate 
`(let [dispatch-pred-to-impl-fn-map# (get 
  @polymorphism/pm-to-dispatch-pred-map ~a-name)] 
   (if (nil? dispatch-pred-to-impl-fn-map#) 
 (throw (Exception. No such polymethod:  ~a-name))) 
   (let [impl-fn# (fn ~@body)] 
 (dosync (alter polymorphism/pm-to-dispatch-pred-map assoc ~a-name 
  (assoc dispatch-pred-to-impl-fn-map# ~dispatch-pred impl-fn#))) 
 ~a-name))) 
  
  
  (deftest polymorphism-test 
(defpoly find-name [a-map]) 
  
(defpolyimpl find-name 
  #(and (contains? % :first-name) (contains? % :surname)) 
  [a-map] 
  (str (:first-name a-map)(:surname a-map))) 
  
(defpolyimpl find-name 
  #(contains? % :full-name) 
  [a-map] 
  (:full-name a-map)) 
  
(def personA {:first-name John :surname Smith}) 
(def personB {:full-name Jane Bloggs}) 
(is (= John Smith (find-name personA))) 
(is (= Jane Bloggs (find-name personB 
  
  (run-tests) 
  
  I think this system of dispatch predicates instead of dispatch values 
 is 
  more flexible/expressive, because you can easily emulate multimethods: 
 if 
  your multimethod had dispatch function dispatch-fn and a dispatch value 
  dispatch-val, you would use 
#(isa? (apply dispatch-fn %) dispatch-val) 
  as the dispatch predicate. Whereas I can't see a simple way to express 
 an 
  arbitrary set of polymethods in terms of multimethods. 
  
  There are a few problems I can see with this approach, but none of them 
 seem 
  to be dealbreakers to me: 
  - You need to filter a list to determine the appropriate function 
  implementation, whereas multimethods just look up the dispatch value in 
 a 
  hash map. This could decrease performance if there are many 
 implementations. 
  - In this version, they don't compose well: somebody could define a new 
  implementation somewhere else which breaks your code, because two 
 dispatch 
  predicates match the args you're using. We could get around this with 
  something like prefer-method, or by remembering the order in which 
  implementations are defined, and always taking the first/last one which 
  matches the args. 
  - Maybe this shouldn't be called polymorphism, since there is no notion 
 of 
  type involved anywhere, except for the types defined by the 
 predicates. 
  
  Is there anything wrong with this approach, or any particular reason it 
  wasn't done this way in Clojure? 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.comjavascript: 
  Note that posts from new members are moderated - please be patient with 
 your 
  first post. 
  To unsubscribe from this group, send email to 
  clojure+u

Re: Polymorphism based on predicates instead of dispatch value types

2012-11-08 Thread Matt Ridsdale
Keep your static concerns out of my dynamic language ; )

Seriously, do you think/know that's the reason people don't do this? Even 
in Java, you don't know which method implementation will be called until 
runtime. And you can define a default polyimpl with an always-true 
predicate, once you've chosen a solution for handling cases with more than 
one matching implementation.

On Wednesday, November 7, 2012 7:49:19 PM UTC+1, raould wrote:

 On Wed, Nov 7, 2012 at 10:08 AM, Matt Ridsdale 
 mrid...@gmail.comjavascript: 
 wrote: 
  that we could be even more flexible if each method implementation 
  was associated with a predicate function of the args, instead of being 
  associated with a fixed dispatch value. See the below code for an 
 example of 

 ah, so you can be even less likely to ever statically know what cases 
 you've covered? :-) 


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Polymorphism based on predicates instead of dispatch value types

2012-11-07 Thread Matt Ridsdale
Hi,

I was thinking about multimethods and the flexibility given by being able 
to dispatch on the value of an arbitrary function of the arguments,
instead of just the class of the first argument as in Java. It seems to me 
that we could be even more flexible if each method implementation
was associated with a predicate function of the args, instead of being 
associated with a fixed dispatch value. See the below code for an example 
of what I mean:

(ns polymorphism
  (:use clojure.test))

(def pm-to-dispatch-pred-map (ref {}))

; these are kind of like multimethods, so let's give them a similar name - 
polymethods.
(defmacro defpoly [a-name [ args]]
  define a polymethod signature
  `(do
 (defn ~a-name [~@args]
 (let [dispatch-pred-to-impl-fn-map# (get 
@polymorphism/pm-to-dispatch-pred-map ~a-name)
   matching-keys# (filter #(apply % [~@args]) (keys 
dispatch-pred-to-impl-fn-map#))
   num-matches# (count matching-keys#)]
   (case num-matches#
 0 (throw (Exception. (str No matching function defined for 
polymethod  ~a-name  and args  [~@args])))
 1 (apply (get dispatch-pred-to-impl-fn-map# (first 
matching-keys#)) [~@args])
 (throw (Exception. (str num-matches#  matching functions 
defined for polymethod  ~a-name  and args  [~@args]))
   (dosync (alter polymorphism/pm-to-dispatch-pred-map assoc ~a-name 
{}

(defmacro defpolyimpl [a-name dispatch-pred  body]
  define a polymethod implementation, for a given dispatch predicate
  `(let [dispatch-pred-to-impl-fn-map# (get 
@polymorphism/pm-to-dispatch-pred-map ~a-name)]
 (if (nil? dispatch-pred-to-impl-fn-map#)
   (throw (Exception. No such polymethod:  ~a-name)))
 (let [impl-fn# (fn ~@body)]
   (dosync (alter polymorphism/pm-to-dispatch-pred-map assoc ~a-name 
(assoc dispatch-pred-to-impl-fn-map# ~dispatch-pred impl-fn#)))
   ~a-name)))


(deftest polymorphism-test
  (defpoly find-name [a-map])

  (defpolyimpl find-name
#(and (contains? % :first-name) (contains? % :surname))
[a-map]
(str (:first-name a-map)(:surname a-map)))

  (defpolyimpl find-name
#(contains? % :full-name)
[a-map]
(:full-name a-map))

  (def personA {:first-name John :surname Smith})
  (def personB {:full-name Jane Bloggs})
  (is (= John Smith (find-name personA)))
  (is (= Jane Bloggs (find-name personB

(run-tests)

I think this system of dispatch predicates instead of dispatch values is 
more flexible/expressive, because you can easily emulate multimethods: if 
your multimethod had dispatch function dispatch-fn and a dispatch value 
dispatch-val, you would use
  #(isa? (apply dispatch-fn %) dispatch-val)
as the dispatch predicate. Whereas I can't see a simple way to express an 
arbitrary set of polymethods in terms of multimethods.

There are a few problems I can see with this approach, but none of them 
seem to be dealbreakers to me:
- You need to filter a list to determine the appropriate function 
implementation, whereas multimethods just look up the dispatch value in a 
hash map. This could decrease performance if there are many implementations.
- In this version, they don't compose well: somebody could define a new 
implementation somewhere else which breaks your code, because two dispatch 
predicates match the args you're using. We could get around this with 
something like prefer-method, or by remembering the order in which 
implementations are defined, and always taking the first/last one which 
matches the args.
- Maybe this shouldn't be called polymorphism, since there is no notion of 
type involved anywhere, except for the types defined by the predicates.

Is there anything wrong with this approach, or any particular reason it 
wasn't done this way in Clojure?

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

clojure.java.jdbc create-table

2012-10-05 Thread Matt
Hi,

I'm relatively new to Clojure. This must be easy.
I am trying to write a function that creates a table with a name passed as 
argument, and this naturally requires passing *
clojure.java.jdbc/create-table *a value for the table name, rather than 
specifying the name as a constant. However I'm not insofar able to pull it 
off. 

When I use the form *create-table passed-argument [fields] *as opposed to a 
constant as in *create-table **:hard-coded-entity-name** [fields]*, then 
the table gets successfully created in the database, however my code also 
gets an exception - java.lang.ClassCastException: 
clojure.lang.ArraySeq$ArraySeq_int cannot be cast to clojure.lang.IFn. The 
exception is received even though the table had been seemingly perfectly 
created. I'm probably missing something basic. What do you think can it be?

Thanks,
Matt



-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Handling exceptions (subject renamed)

2012-10-05 Thread Matt
Hi,

Sorry to anyone who read the original post.
Apparently I had malformed the try block encompassing the create-table in a 
very non-clojure-ish way. 
So my problem wasn't with clojure.java.jdbc's create-table. Being 
'dynamic', clojure could not warn me about it until it crashes in 
runtime. I guess I should also learn more about making exception printouts 
contain more details (such as line number as one, if that's at all 
possible?)
I'd appreciate knowing how to get more details when an exception is caught 
by my code e.g. at least a line number if possible -

I was using - 
*(catch Exception e (println (str Exception is:  e)))*

Which only yielded a general description (java.lang.ClassCastException: 
clojure.lang.ArraySeq$ArraySeq_int cannot be cast to clojure.lang.IFn) without 
indicating where my code broke.

Is it possible to get the source line that made the code break?

Thanks!

On Friday, October 5, 2012 5:15:18 PM UTC+2, Matt wrote:

 Hi,

 I'm relatively new to Clojure. This must be easy.
 I am trying to write a function that creates a table with a name passed as 
 argument, and this naturally requires passing *
 clojure.java.jdbc/create-table *a value for the table name, rather than 
 specifying the name as a constant. However I'm not insofar able to pull it 
 off. 

 When I use the form *create-table passed-argument [fields] *as opposed 
 to a constant as in *create-table **:hard-coded-entity-name** [fields]*, 
 then the table gets successfully created in the database, however my code 
 also gets an exception - java.lang.ClassCastException: 
 clojure.lang.ArraySeq$ArraySeq_int cannot be cast to clojure.lang.IFn. 
 The exception is received even though the table had been seemingly 
 perfectly created. I'm probably missing something basic. What do you think 
 can it be?

 Thanks,
 Matt





-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure web framework

2012-09-28 Thread Matt
There is already a rails like Clojure web framework which has been around 
for a while called Conjure: https://github.com/macourtney/Conjure

Here is the wiki to get started: https://github.com/macourtney/Conjure/wiki

The most recent release is out of date, but I have been working on an 
update. I've completed all of the new features of the update and now I'm 
running through tests and making sure the tutorial is still accurate. 
Unfortunately, I haven't had as much time to work on it as I would have 
liked recently.

Though I'm using it at my work, not many others seem to be using it. Most 
people in the community prefer libraries over frameworks. I doubt you'll do 
much better with your own web framework if you don't somehow take that into 
account. After seeing a lot of interest in Drift 
(https://github.com/macourtney/drift) when I broke it out of Conjure into 
its own library, I broke Conjure into a group of libraries for the next 
release. If you do make your own web framework, you may want to use some 
parts of Conjure.

-Matt

On Friday, September 28, 2012 3:36:20 AM UTC-4, goracio wrote:

 Hi
 So i'd like to point to the problem here. Clojure web framework in google 
 get these results, at least for me
 1. noir
 2. stackoverflow question 2008 year
 3. stackoverflow question 2010 year
 4. joodo ( outdated thing developed by one person)
 5. Compojure ( routing dsl)
 So there is no popular framework these days for clojure.
 Noir is mostly Chris Granger thing. As he make Lighttable today Noir 
 developed by some other people ( or may be on person not sure). Main site 
 instructions are nice but already outdated ( lein2). No news, no blog, no 
 new features, no examples, no infrastructure. Lein new project, insert noir 
 in dependencies and you don't have working app, you must add :main and 
 stuff to work. What about testing ? no info, no structure, decide on your 
 own. 
 It's no secret that web development today is biggest and popular trend. If 
 language and it's community have good web framework that language will gain 
 more popularity. 
 Take Ruby on rails it has over 30 core contributers, huuuge community, 
 active development, industry standart web development framework. Good 
 testing, development infrastracture, easy start, sprockets for js css 
 managment and so on. Also it has some books about testing and framework 
 itself which is good start point for newbies. 
 I like Clojure, for simplicity mostly. It has amazing power and i believe 
 it can be very good platform for web development. 
 So what i suggest :
 Take 1 platform for web development in Clojure (for example noir as most 
 mature framework) .
 Form working core group from 5-6 people.
 Decide about name of the project ( or take Noir)
 Make good site about it
 Make a plan for development ( what core features should have first version)
 Make first version
 Make couple good examples
 Make good documentation and maybe a book ( community book for example on 
 github that will be online and updated frequently).
 --
 http://www.playframework.org/ good example what site could be
 Alternative to online book can be guides, as for ruby on rails 
 http://guides.rubyonrails.org/index.html
 Another good news that there is nice web IDE for Clojure by Bodil Stokke 
 https://github.com/bodil/catnip. Super easy install, very nice 
 insterface, reactive interface ( no need for browser refresh, autorecompile 
 when you save ) web based ! and under active development, just perfect 
 place for newbies to start. So this project also can be added to Clojure 
 Web framework project.
 Also we have ClojureScript so Clojure web framework would be perfect place 
 where this thing can shine.
 Let's discuss.


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Why does cljs.core redefine String.prototype.apply?

2012-09-18 Thread Matt Campbell
I noticed that cljs.core redefines String.prototype.apply. Being new to 
Clojure, I don't understand what this redefinition does or what it is 
for. But I do know that redefining functions in the JS standard library, 
or defining new ones on standard objects, is something that should be 
done with great care, to avoid breaking other pieces of JavaScript 
running in the same context (e.g. on the same page). (And lest you think 
your JavaScript is sure to be the only JavaScript on your page, bear in 
mind that some browsers make web pages accessible to blind users by 
injecting their own JS into the page.)


I know there are always trade-offs. And perhaps this definition of 
String.prototype.apply is known not to conflict with any other 
JavaScript code. But I would appreciate an explanation of what purpose 
it serves.


Thanks,
Matt



smime.p7s
Description: S/MIME Cryptographic Signature


Why does cljs.core redefine String.prototype.apply?

2012-09-18 Thread Matt Campbell
 I noticed that cljs.core redefines String.prototype.apply. Being new to 
Clojure, I don't understand what this redefinition does or what it is for. 
But I do know that redefining functions in the JS standard library, or 
defining new ones on standard objects, is something that should be done 
with great care, to avoid breaking other pieces of JavaScript running in 
the same context (e.g. on the same page). (And lest you think your 
JavaScript is sure to be the only JavaScript on your page, bear in mind 
that some browsers make web pages accessible to blind users by injecting 
their own JS into the page.) 

I know there are always trade-offs. And perhaps this definition of 
String.prototype.apply is known not to conflict with any other JavaScript 
code. But I would appreciate an explanation of what purpose it serves. 

Thanks, 
Matt 

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Why does cljs.core redefine String.prototype.apply?

2012-09-18 Thread Matt Campbell

On 9/18/2012 8:06 AM, David Nolen wrote:

It's a yucky bit of code that needs to be removed. It's there to
support using keywords as functions - in ClojureScript keywords are
just JS Strings.


Is there another way to do the same thing, without a significant 
performance penalty?


Matt



smime.p7s
Description: S/MIME Cryptographic Signature


ClojureScript dead-code elimination

2012-09-18 Thread Matt Campbell
When run in advanced mode, the Google Closure Compiler tries to 
eliminate dead code. This currently doesn't seem to be very effective 
for ClojureScript. A minimal hello-world example currently compiles to 
90 KB in advanced mode. Is this the best that can be done? Is Clojure's 
dynamism an insurmountable obstacle at this point? Or does this area 
just need more work?


Matt



smime.p7s
Description: S/MIME Cryptographic Signature


Re: ClojureScript dead-code elimination

2012-09-18 Thread Matt Campbell

On 9/18/2012 8:57 AM, David Nolen wrote:

I've heard of several large
ClojureScript programs that generate 1.2-1.8 *megabytes* of
JavaScript. After advanced compilation and gzipping the applications
are around 40k-50k (http://blog.mezeske.com/?p=552). This is pretty
impressive given that jQuery, which is pretty standard these days,
itself is 32k gzipped.


That is indeed impressive. I'd say the overhead of ClojureScript in 
small programs is a non-issue then. Sorry for making a fuss about it.


Matt



smime.p7s
Description: S/MIME Cryptographic Signature


Re: is this a problem for clojure.contrib.dataflow? Or something else?

2012-08-21 Thread matt hoffman
Great, thanks -- I hadn't looked too closely at Cascalog yet only because I
don't currently have the rest of the Hadoop infrastructure. But adding that
in isn't out of the question, so I'll definitely look at it more closely.
 And I may have underestimated the utility of Cascalog without Hadoop...



On Tue, Aug 21, 2012 at 4:38 AM, Sam Ritchie sritchi...@gmail.com wrote:

 Definitely +1 for Cascalog -- I maintain Cascalog, along with Nathan Marz.
 Here's the wiki:

 https://github.com/nathanmarz/cascalog/wiki

 Head on over to the 
 cascalog-userhttps://groups.google.com/forum/?fromgroups#!forum/cascalog-user
  mailing
 list with any questions. Looking forward to seeing you there.


 On Mon, Aug 20, 2012 at 5:55 PM, ronen nark...@gmail.com wrote:

 Terabyte size and chain of dependent tasks might hint toward 
 Cascaloghttps://github.com/nathanmarz/cascalog/wiki this assumes that
 your doing batch job processing (on top of hadoop)

 If you need a more soft real time datalog based query then I would check
 datomic http://www.datomic.com/ although from your description is
 sounds less so.

 Ronen

 On Tuesday, August 21, 2012 3:14:23 AM UTC+3, Leif wrote:

 +1.  I know of a couple tools in python for this purpose that are called
 workflow management systems.   It would be good to know if there is a
 robust one in clojure.

 On Monday, August 20, 2012 12:18:54 AM UTC-4, matt hoffman wrote:

 I have a problem that I'm trying to figure out how to tackle. I'm new
 to Clojure, but I'm interested, and perhaps this will be my excuse to give
 it a try. Any of the following answers would help:
 What you're describing really sounds like X
 You could think of that problem like this, instead
 You may want to search for term 'Y'...it sounds related (I imagine
 I'm probably describing some well-established domain...I just don't know
 the right terms to search for)

 So, the problem:
 I have an app that is in production doing some fairly complex
 calculations on large-ish (terabyte-range) amounts of data.  The
 calculations are expressed as chains of dependent tasks, where each tasks
 can have a number of inputs and outputs. But the code has become hard to
 maintain, full of accidental complexity and very difficult for newer
 developers to understand. So, I'm trying to find the right abstractions to
 put in place to keep things simple.
 One of the sources of complexity is the intermingling of code involving
 loading data, dividing up data to be executed in parallel, processing data,
 persisting data, and handling the execution flow on an individual datum
 (configuring pipelines of components,etc.) I'd like to keep the functions
 pure and push the other concerns off to a framework -- and, ideally, not
 have to write that framework.

 So I think my problem statement is this:
 I'd like to be able to define functions that specify, somehow, what
 input they want, and perhaps what output they produce. Then I'd like to
 push the concern of how those inputs are calculated -- loaded from a db,
 calculated from source data -- off on some other party.

 For example, if I define a function that requires foo, and I call
 that function without providing foo, I'd like for _something_ to step in
 and say, Ok, you require foo. I have this function over here that produces
 foo. Let me call that for you, then hand you the output.  Perhaps instead
 of a framework that transparently looks up and executes that function and
 provides a Future for the result, perhaps I can explicitly build a
 dependency graph up-front containing all the functions required to produce
 the end result, and then execute them all in order... I think the effect is
 the same.

 From a bit of searching I've done today, dataflow programming like
 clojure.contrib.dataflow sounds like it might be close to what I'm looking
 for, but I'd love to hear ideas.   Am I describing something that already
 exists?  Would this actually be simpler than it seems using some clever
 macros? Are there some keywords I should search for to get started?  Or
 perhaps I'm coming at this problem wrong, and I should think about it a
 different way...

  --
 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, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




 --
 Sam Ritchie, Twitter Inc
 703.662.1337
 @sritchie

 (Too brief? Here's why! http://emailcharter.org)

  --
 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, send email to
 clojure+unsubscr

Re: is this a problem for clojure.contrib.dataflow? Or something else?

2012-08-21 Thread matt hoffman
Thanks for the pointer.  Datomic is definitely on my short list on the 
persistence side of things.   My workflow is unfortunately fairly varied; 
some longer-term batch jobs, and some very-soft-realtime jobs (seconds, not 
milliseconds). 

With a larger dataset (multi-terabyte, maybe) something like Hadoop 
(/Cascalog?) + HBase would be a natural fit, but when you're just around a 
terabyte or so it's a bit more ambiguous. 



On Monday, August 20, 2012 8:55:46 PM UTC-4, ronen wrote:

 Terabyte size and chain of dependent tasks might hint toward 
 Cascaloghttps://github.com/nathanmarz/cascalog/wiki this assumes that 
 your doing batch job processing (on top of hadoop) 

 If you need a more soft real time datalog based query then I would check 
 datomic http://www.datomic.com/ although from your description is 
 sounds less so.

 Ronen

 On Tuesday, August 21, 2012 3:14:23 AM UTC+3, Leif wrote:

 +1.  I know of a couple tools in python for this purpose that are called 
 workflow management systems.   It would be good to know if there is a 
 robust one in clojure.

 On Monday, August 20, 2012 12:18:54 AM UTC-4, matt hoffman wrote:

 I have a problem that I'm trying to figure out how to tackle. I'm new to 
 Clojure, but I'm interested, and perhaps this will be my excuse to give it 
 a try. Any of the following answers would help:
 What you're describing really sounds like X
 You could think of that problem like this, instead
 You may want to search for term 'Y'...it sounds related (I imagine I'm 
 probably describing some well-established domain...I just don't know the 
 right terms to search for)

 So, the problem:
 I have an app that is in production doing some fairly complex 
 calculations on large-ish (terabyte-range) amounts of data.  The 
 calculations are expressed as chains of dependent tasks, where each tasks 
 can have a number of inputs and outputs. But the code has become hard to 
 maintain, full of accidental complexity and very difficult for newer 
 developers to understand. So, I'm trying to find the right abstractions to 
 put in place to keep things simple. 
 One of the sources of complexity is the intermingling of code involving 
 loading data, dividing up data to be executed in parallel, processing data, 
 persisting data, and handling the execution flow on an individual datum 
 (configuring pipelines of components,etc.) I'd like to keep the functions 
 pure and push the other concerns off to a framework -- and, ideally, not 
 have to write that framework. 

 So I think my problem statement is this: 
 I'd like to be able to define functions that specify, somehow, what 
 input they want, and perhaps what output they produce. Then I'd like to 
 push the concern of how those inputs are calculated -- loaded from a db, 
 calculated from source data -- off on some other party. 

 For example, if I define a function that requires foo, and I call that 
 function without providing foo, I'd like for _something_ to step in and 
 say, Ok, you require foo. I have this function over here that produces 
 foo. Let me call that for you, then hand you the output.  Perhaps instead 
 of a framework that transparently looks up and executes that function and 
 provides a Future for the result, perhaps I can explicitly build a 
 dependency graph up-front containing all the functions required to produce 
 the end result, and then execute them all in order... I think the effect is 
 the same. 

 From a bit of searching I've done today, dataflow programming like 
 clojure.contrib.dataflow sounds like it might be close to what I'm looking 
 for, but I'd love to hear ideas.   Am I describing something that already 
 exists?  Would this actually be simpler than it seems using some clever 
 macros? Are there some keywords I should search for to get started?  Or 
 perhaps I'm coming at this problem wrong, and I should think about it a 
 different way...



-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: is this a problem for clojure.contrib.dataflow? Or something else?

2012-08-21 Thread matt hoffman
Thanks, I wasn't aware of those tools in the Python world.  At first 
glance, things like pyutilib.workflow look interesting: I like that they're 
they're explicitly separating the definitions of functions from the wiring 
of inputs and outputs. I wonder if, in the clojure world (and wider JVM 
world), people just tend to approach that problem domain in a different 
way. Or if most people doing that kind of processing have large enough 
datasets that Cascalog is a natural fit. 

Anyway, thanks for the helpful pointer -- I'll do some more searching down 
the workflow management system avenue as well. 


On Monday, August 20, 2012 8:14:23 PM UTC-4, Leif wrote:

 +1.  I know of a couple tools in python for this purpose that are called 
 workflow management systems.   It would be good to know if there is a 
 robust one in clojure.

 On Monday, August 20, 2012 12:18:54 AM UTC-4, matt hoffman wrote:

 I have a problem that I'm trying to figure out how to tackle. I'm new to 
 Clojure, but I'm interested, and perhaps this will be my excuse to give it 
 a try. Any of the following answers would help:
 What you're describing really sounds like X
 You could think of that problem like this, instead
 You may want to search for term 'Y'...it sounds related (I imagine I'm 
 probably describing some well-established domain...I just don't know the 
 right terms to search for)

 So, the problem:
 I have an app that is in production doing some fairly complex 
 calculations on large-ish (terabyte-range) amounts of data.  The 
 calculations are expressed as chains of dependent tasks, where each tasks 
 can have a number of inputs and outputs. But the code has become hard to 
 maintain, full of accidental complexity and very difficult for newer 
 developers to understand. So, I'm trying to find the right abstractions to 
 put in place to keep things simple. 
 One of the sources of complexity is the intermingling of code involving 
 loading data, dividing up data to be executed in parallel, processing data, 
 persisting data, and handling the execution flow on an individual datum 
 (configuring pipelines of components,etc.) I'd like to keep the functions 
 pure and push the other concerns off to a framework -- and, ideally, not 
 have to write that framework. 

 So I think my problem statement is this: 
 I'd like to be able to define functions that specify, somehow, what input 
 they want, and perhaps what output they produce. Then I'd like to push the 
 concern of how those inputs are calculated -- loaded from a db, calculated 
 from source data -- off on some other party. 

 For example, if I define a function that requires foo, and I call that 
 function without providing foo, I'd like for _something_ to step in and 
 say, Ok, you require foo. I have this function over here that produces 
 foo. Let me call that for you, then hand you the output.  Perhaps instead 
 of a framework that transparently looks up and executes that function and 
 provides a Future for the result, perhaps I can explicitly build a 
 dependency graph up-front containing all the functions required to produce 
 the end result, and then execute them all in order... I think the effect is 
 the same. 

 From a bit of searching I've done today, dataflow programming like 
 clojure.contrib.dataflow sounds like it might be close to what I'm looking 
 for, but I'd love to hear ideas.   Am I describing something that already 
 exists?  Would this actually be simpler than it seems using some clever 
 macros? Are there some keywords I should search for to get started?  Or 
 perhaps I'm coming at this problem wrong, and I should think about it a 
 different way...



-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

is this a problem for clojure.contrib.dataflow? Or something else?

2012-08-20 Thread matt hoffman
I have a problem that I'm trying to figure out how to tackle. I'm new to 
Clojure, but I'm interested, and perhaps this will be my excuse to give it 
a try. Any of the following answers would help:
What you're describing really sounds like X
You could think of that problem like this, instead
You may want to search for term 'Y'...it sounds related (I imagine I'm 
probably describing some well-established domain...I just don't know the 
right terms to search for)

So, the problem:
I have an app that is in production doing some fairly complex calculations 
on large-ish (terabyte-range) amounts of data.  The calculations are 
expressed as chains of dependent tasks, where each tasks can have a number 
of inputs and outputs. But the code has become hard to maintain, full of 
accidental complexity and very difficult for newer developers to 
understand. So, I'm trying to find the right abstractions to put in place 
to keep things simple. 
One of the sources of complexity is the intermingling of code involving 
loading data, dividing up data to be executed in parallel, processing data, 
persisting data, and handling the execution flow on an individual datum 
(configuring pipelines of components,etc.) I'd like to keep the functions 
pure and push the other concerns off to a framework -- and, ideally, not 
have to write that framework. 

So I think my problem statement is this: 
I'd like to be able to define functions that specify, somehow, what input 
they want, and perhaps what output they produce. Then I'd like to push the 
concern of how those inputs are calculated -- loaded from a db, calculated 
from source data -- off on some other party. 

For example, if I define a function that requires foo, and I call that 
function without providing foo, I'd like for _something_ to step in and 
say, Ok, you require foo. I have this function over here that produces 
foo. Let me call that for you, then hand you the output.  Perhaps instead 
of a framework that transparently looks up and executes that function and 
provides a Future for the result, perhaps I can explicitly build a 
dependency graph up-front containing all the functions required to produce 
the end result, and then execute them all in order... I think the effect is 
the same. 

From a bit of searching I've done today, dataflow programming like 
clojure.contrib.dataflow sounds like it might be close to what I'm looking 
for, but I'd love to hear ideas.   Am I describing something that already 
exists?  Would this actually be simpler than it seems using some clever 
macros? Are there some keywords I should search for to get started?  Or 
perhaps I'm coming at this problem wrong, and I should think about it a 
different way...

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure Editor

2012-07-16 Thread Matt
Bluefish version 2.2.3 fresh install.
Document -- Language Mode - no clojure on the list.. has support for 
Clojure been dropped?

On Sunday, March 13, 2011 2:09:52 PM UTC+2, WoodHacker wrote:

 If you are looking for a very good editor for Clojure try Bluefish. 
 It's been around for ever, is very stable, and does everything you 
 would want an editor to do.   And it now works with Clojure. 

http://bluefish.openoffice.nl 

 Bill

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Drift-db version 1.1.0 released

2012-07-07 Thread Matt
Forgot the link: https://github.com/macourtney/drift-db

On Saturday, July 7, 2012 9:38:03 AM UTC-4, Matt wrote:

 Drift-db version 1.1.0 released

 Drift-db is a library and companion project to Drift which gives you a 
 standard interface for updating databases from migrations.

 In version 1.1.0:

 1. Added support for Postgresql
 2. Added offset and order-by as parameters to sql-find
 3. Added an update-column function which allows you to alter a column 
 already on a table with out having to remove and add it.


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Lexer and parser generator in Clojure

2012-05-19 Thread Matt Mitchell
Here's a parser: https://github.com/joshua-choi/fnparse

Doesn't look like it's active, but could be a starting point?

- Matt

On Friday, May 18, 2012 8:46:19 AM UTC-4, Alexsandro Soares wrote:

 Hi,

  I'm trying to build a compiler using Clojure. Is there any tools 
 like flex and bison generating Clojure code? 
  I'm interested in a lexer/parser in pure Clojure because I think
  in use the same code with Javascript (via ClojureScript) and Java (via 
 Clojure). 
 I already know isolated tools like Jflex, JavaCup and Bison generating 
 Java and
 Jison, JS/CC and friends for Javascript, but I am just interested in a 
 pure Clojure solution.

 Thanks in advance for any answer.

 Cheers,
 Alex


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Controlling the test environment

2012-01-16 Thread Matt Stump
 

Is there a way to set different values for global vars when running tests 
as opposed to the development or production environment?  I need to control 
which database my tests for a noir project connect to. Ideally I would like 
to do something like the following: for production and development, if 
an environment variable is set connect to the database server at the 
specified URL, if not then fall back to localhost.  For test start up an 
embedded server, and connect. After the test is done, rollback the global 
var to the previous value and resume connecting to the server on localhost 
or at the location specified by the environment variable.

I could create some fixture with-test-database that modifies a global var, 
but that seems a little hackish.

How are other people solving this problem?  Is there something similar 
pre-baked into noir, clojure.test or midje?

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure videos no longer downloadable

2011-12-16 Thread Matt Freeman
Here's an idea. Put the videos on a site that has the best CDN reach
(especially noticeable in Asia), does automatic transcoding to lower
resolutions, and most  importantly can jump to any point in the
videos. Works on android, ipod, wp7, and even blackberry. Youve
probably not heard of it, YouTube!

Not sure why people believe its 'cool' niche video sites, worst
offender is Vimeo (absolute crap - some repackage flash player with no
jumping on top of akamai cdn) or Blip (not as bad, but still poor
playback support, none for Android tablets etc..). Youtube is fine.


On Dec 15, 11:21 am, Baishampayan Ghose b.gh...@gmail.com wrote:
 Every video has an RSS feed which can be mechanically constructed given the 
 URL.

 So forhttp://blip.tv/clojure/rich-hickey-unveils-clojurescript-5399498,
 the RSS feed is athttp://blip.tv/rss/flash/5399498

 IIRC, the RSS feed has the URL to the actual video.

 Regards,
 BG









 On Thu, Dec 15, 2011 at 5:00 AM, Phil Hagelberg p...@hagelb.org wrote:
  So I recently went to clojure.blip.tv to download a video, and I
  noticed my account had been deleted. Apparently they are requiring all
  logins to go through facebook.

  Is there a way we could provide video downloads to people who don't
  have facebook accounts?

  -Phil

  --
  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, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

 --
 Baishampayan Ghose
 b.ghose at gmail.com

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Drift DB

2011-11-30 Thread Matt
This should now be fixed in version 1.0.6.

-Matt

On Nov 29, 12:03 am, Luc Prefontaine lprefonta...@softaddicts.ca
wrote:
 Hi Matt,

 working with this stuff... pretty sure I can make rake obsolete pretty soon :)

 However I am struggling with the auto increment column attribute...

 (create-table
   :meta-entities
   (integer :id {:not-null true :auto-increment true :primary-key true})
   (string :name {:not-null true :unique true })
   (date-time :created_at)
   (date-time :updated_at))

 which looks to me compliant with what your code does in the mysql flavor lib.

 It yields in MySql:

 CREATE TABLE meta_entities  (
     id          int(11) NOT NULL,
     name        varchar(255) NOT NULL,
     created_at  datetime NULL,
     updated_at  datetime NULL,
     PRIMARY KEY(id)
 )
 ENGINE = InnoDB
 AUTO_INCREMENT = 0

 According to the AquaStudio tool I use to reverse engineer the DDL.

 The trace message:

 DEBUG                   Thread-51 2028 234732,063 drift-db-mysql.flavor ] 
 Create table: :meta-entities with specs: ({:not-null true, :primary-key true, 
 :spec-type :column, :type :integer, :name :id} {:not-null true, :spec-type 
 :column, :type :string, :name :name} {:spec-type :column, :type :date-time, 
 :name :created_at} {:spec-type :column, :type :date-time, :name :updated_at})

 Looks like the :auto-increment is dropped. drift_db/core.clj at line 155 is 
 not selecting
 it as a potential attribute of an integer field.

 I'll patch it locally so I can continue to play with it.

 Any reason why the id type does not accept optional attributes ? I use id 
 auto incremented keys
 everywhere :)

 Thank you,

 Luc

 On Thu, 24 Nov 2011 14:58:43 -0800 (PST)









 Matt macourt...@gmail.com wrote:
  Drift DB is a clojure database library focused on migration functions.

  With Drift DB you can create tables, drop tables, add columns to
  tables, remove columns from tables, query tables, and, though it is
  not the focus of Drift DB, you can insert, update, delete and select
  rows from tables.

  The only databases currently supported are H2 and Mysql. However,
  Drift DB uses a protocol to abstract out database specific code. All
  you would have to do to support other databases is implement the Drift
  DB protocol for it.

  Drift DB, like Drift, was originally a part of Conjure. However, I had
  several requests to separate out the function into their own library.

  Drift DB is not supposed to be a replacement for ClojureQL or Korma.
  Instead, Drift DB is focused on table altering and other tasks usually
  done in Drift migrations. Such tasks are currently not well supported
  in any other Clojure database library.

  All of the code for Drift DB can be found on github at:
 http://github.com/macourtney/drift-db

  Drift DB on Clojars:

  Drift DB Core:http://clojars.org/org.drift-db/drift-db
  Drift DB H2:http://clojars.org/org.drift-db/drift-db-h2
  Drift DB Mysql:http://clojars.org/org.drift-db/drift-db-mysql

 --
 Luc P.

 
 The rabid Muppet

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Drift 1.4.0 released.

2011-11-29 Thread Matt
1.4.2 is out now and should work with both Clojure 1.2.1 and 1.3.0.
However, Leiningen currently doesn't work with Clojure 1.3.0.

At work, I actually have a project.clj with Clojure 1.3.0 in the
dependencies, and a Clojure 1.2.1 in the dev-dependencies to make
Leiningen work.

-Matt


On Nov 29, 5:36 am, Edmund edmundsjack...@gmail.com wrote:
 Confirmed, 1.4.2-SNAPSHOT works with 1.3.0 now, thanks for the help.

  Edmund

 On 27/11/2011 16:23, Matt wrote:







  I just sent you a pull request to fix the Clojure 1.3 incompatibility.

  Also, you may want to use the current-version and update-version
  functions in drift-db.migrate instead of your own home grown
  functions. Though you would have to create your own initialize
  function to initialize the drift-db flavor to mysql.

  -Matt

  On Nov 27, 9:25 am, Edmund edmundsjack...@gmail.com wrote:
  Bingo!  Thanks for that, version 1.3.0 incompatibility it is.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Drift DB

2011-11-29 Thread Matt
That looks like a bug. I'll take a look at it, and get a fix in as
soon as possible.

-Matt


On Nov 29, 12:03 am, Luc Prefontaine lprefonta...@softaddicts.ca
wrote:
 Hi Matt,

 working with this stuff... pretty sure I can make rake obsolete pretty soon :)

 However I am struggling with the auto increment column attribute...

 (create-table
   :meta-entities
   (integer :id {:not-null true :auto-increment true :primary-key true})
   (string :name {:not-null true :unique true })
   (date-time :created_at)
   (date-time :updated_at))

 which looks to me compliant with what your code does in the mysql flavor lib.

 It yields in MySql:

 CREATE TABLE meta_entities  (
     id          int(11) NOT NULL,
     name        varchar(255) NOT NULL,
     created_at  datetime NULL,
     updated_at  datetime NULL,
     PRIMARY KEY(id)
 )
 ENGINE = InnoDB
 AUTO_INCREMENT = 0

 According to the AquaStudio tool I use to reverse engineer the DDL.

 The trace message:

 DEBUG                   Thread-51 2028 234732,063 drift-db-mysql.flavor ] 
 Create table: :meta-entities with specs: ({:not-null true, :primary-key true, 
 :spec-type :column, :type :integer, :name :id} {:not-null true, :spec-type 
 :column, :type :string, :name :name} {:spec-type :column, :type :date-time, 
 :name :created_at} {:spec-type :column, :type :date-time, :name :updated_at})

 Looks like the :auto-increment is dropped. drift_db/core.clj at line 155 is 
 not selecting
 it as a potential attribute of an integer field.

 I'll patch it locally so I can continue to play with it.

 Any reason why the id type does not accept optional attributes ? I use id 
 auto incremented keys
 everywhere :)

 Thank you,

 Luc

 On Thu, 24 Nov 2011 14:58:43 -0800 (PST)









 Matt macourt...@gmail.com wrote:
  Drift DB is a clojure database library focused on migration functions.

  With Drift DB you can create tables, drop tables, add columns to
  tables, remove columns from tables, query tables, and, though it is
  not the focus of Drift DB, you can insert, update, delete and select
  rows from tables.

  The only databases currently supported are H2 and Mysql. However,
  Drift DB uses a protocol to abstract out database specific code. All
  you would have to do to support other databases is implement the Drift
  DB protocol for it.

  Drift DB, like Drift, was originally a part of Conjure. However, I had
  several requests to separate out the function into their own library.

  Drift DB is not supposed to be a replacement for ClojureQL or Korma.
  Instead, Drift DB is focused on table altering and other tasks usually
  done in Drift migrations. Such tasks are currently not well supported
  in any other Clojure database library.

  All of the code for Drift DB can be found on github at:
 http://github.com/macourtney/drift-db

  Drift DB on Clojars:

  Drift DB Core:http://clojars.org/org.drift-db/drift-db
  Drift DB H2:http://clojars.org/org.drift-db/drift-db-h2
  Drift DB Mysql:http://clojars.org/org.drift-db/drift-db-mysql

 --
 Luc P.

 
 The rabid Muppet

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Drift 1.4.0 released.

2011-11-27 Thread Matt
I just sent you a pull request to fix the Clojure 1.3 incompatibility.

Also, you may want to use the current-version and update-version
functions in drift-db.migrate instead of your own home grown
functions. Though you would have to create your own initialize
function to initialize the drift-db flavor to mysql.

-Matt

On Nov 27, 9:25 am, Edmund edmundsjack...@gmail.com wrote:
 Bingo!  Thanks for that, version 1.3.0 incompatibility it is.


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Drift 1.4.0 released.

2011-11-26 Thread Matt
)
         at clojure.main$main.doInvoke(main.clj:426)
         at clojure.lang.RestFn.invoke(RestFn.java:421)
         at clojure.lang.Var.invoke(Var.java:405)
         at clojure.lang.AFn.applyToHelper(AFn.java:163)
         at clojure.lang.Var.applyTo(Var.java:518)
         at clojure.main.main(main.java:37)
 Caused by: java.lang.NoSuchMethodError:
 clojure.lang.KeywordLookupSite.init(ILclojure/lang/Keyword;)V
         at drift.core$find_init_fn.clinit(core.clj:25)
         at drift.core__init.load(Unknown Source)
         at drift.core__init.clinit(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:247)
         at clojure.lang.RT.loadClassForName(RT.java:2030)
         at clojure.lang.RT.load(RT.java:417)
         at clojure.lang.RT.load(RT.java:398)
         at clojure.core$load$fn__4610.invoke(core.clj:5386)
         at clojure.core$load.doInvoke(core.clj:5385)
         at clojure.lang.RestFn.invoke(RestFn.java:408)
         at clojure.core$load_one.invoke(core.clj:5200)
         at clojure.core$load_lib.doInvoke(core.clj:5237)
         at clojure.lang.RestFn.applyTo(RestFn.java:142)
         at clojure.core$apply.invoke(core.clj:602)
         at clojure.core$load_libs.doInvoke(core.clj:5271)
         at clojure.lang.RestFn.applyTo(RestFn.java:137)
         at clojure.core$apply.invoke(core.clj:602)
         at clojure.core$require.doInvoke(core.clj:5352)
         at clojure.lang.RestFn.invoke(RestFn.java:457)
         at 
 drift.builder$eval11$loading__4505__auto12.invoke(builder.clj:1)
         at drift.builder$eval11.invoke(builder.clj:1)
         at clojure.lang.Compiler.eval(Compiler.java:6465)
         ... 53 more

 On 24/11/2011 22:38, Matt wrote:







  Drift is a Rails like migration library for Clojure.

  I've recently released version 1.4.0 of Drift which includes:

  A new Java interface. You can now run Drift migrations, find out
  the database version, or determine the highest migration number
  from java.

  User generated migration numbers and time stamp migration numbers.
  You can now create your own migration number generator or use one
  of the ones included with Drift. By default, Drift will now create
  the migration number from the current time. You can still use the
  old incremental migration number generator if you want.

  You can find the code for Drift on Github:
 http://github.com/macourtney/drift

  Drift on Clojars:http://clojars.org/drift

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


[ANN] Drift 1.4.0 released.

2011-11-24 Thread Matt
Drift is a Rails like migration library for Clojure.

I've recently released version 1.4.0 of Drift which includes:

A new Java interface. You can now run Drift migrations, find out the
database version, or determine the highest migration number from java.

User generated migration numbers and time stamp migration numbers. You
can now create your own migration number generator or use one of the
ones included with Drift. By default, Drift will now create the
migration number from the current time. You can still use the old
incremental migration number generator if you want.

You can find the code for Drift on Github: http://github.com/macourtney/drift

Drift on Clojars: http://clojars.org/drift

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


[ANN] Drift DB

2011-11-24 Thread Matt
Drift DB is a clojure database library focused on migration functions.

With Drift DB you can create tables, drop tables, add columns to
tables, remove columns from tables, query tables, and, though it is
not the focus of Drift DB, you can insert, update, delete and select
rows from tables.

The only databases currently supported are H2 and Mysql. However,
Drift DB uses a protocol to abstract out database specific code. All
you would have to do to support other databases is implement the Drift
DB protocol for it.

Drift DB, like Drift, was originally a part of Conjure. However, I had
several requests to separate out the function into their own library.

Drift DB is not supposed to be a replacement for ClojureQL or Korma.
Instead, Drift DB is focused on table altering and other tasks usually
done in Drift migrations. Such tasks are currently not well supported
in any other Clojure database library.

All of the code for Drift DB can be found on github at:
http://github.com/macourtney/drift-db

Drift DB on Clojars:

Drift DB Core: http://clojars.org/org.drift-db/drift-db
Drift DB H2: http://clojars.org/org.drift-db/drift-db-h2
Drift DB Mysql: http://clojars.org/org.drift-db/drift-db-mysql

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ClojureScript: Correct way to call an instance method with parameters?

2011-11-17 Thread Matt Hoyt
(.setDate (goog.date.fromIsoString 2010-12-31) 1)
 
Matt Hoyt



From: Base basselh...@gmail.com
To: Clojure clojure@googlegroups.com
Sent: Thursday, November 17, 2011 2:26 PM
Subject: ClojureScript: Correct way to call an instance method with parameters?

HI

I am attempting to manipulate a goog.date.Date object and am a little
confused on how to call a method on this object in ClojureScript

If I have a date object, how do I , for example, to set the day of the
month to a different day

Both

(. (goog.date.fromIsoString 2010-12-31) (setDate) 1)

and

(. (goog.date.fromIsoString 2010-12-31) (setDate 1))

yield Undefined.

Any thoughts?  I am sure this is an easy one but I am stuck.

Thanks in advance

Base

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Downloading the documentation?

2011-11-12 Thread Matt Hoyt
Checkout the gh-pages branch from github.  The branch has all of the 
documentation for clojure in it.
 
Matt Hoyt



From: Kyle Cordes k...@kylecordes.com
To: clojure@googlegroups.com
Sent: Saturday, November 12, 2011 8:25 PM
Subject: Downloading the documentation?

Is there a readily available download of the Clojure documentation most readily 
viewed at clojure.org, for offline use? I've searched a bit and not found 
anything, though I'd not be surprised to have overlooked it. 


-- 
Kyle Cordes
http://kylecordes.com


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: JavaScript `debugger' statement

2011-11-10 Thread Matt Hoyt
try (js* debugger())
 
Matt Hoyt



From: Stuart Campbell stu...@harto.org
To: Clojure clojure@googlegroups.com
Sent: Thursday, November 10, 2011 9:16 PM
Subject: JavaScript `debugger' statement


I'm trying to enter the Firebug debugger when an exception is caught:

(try
  ; ...
  (catch js/Error e
    js/debugger))

This doesn't work, because js/debugger compiles to debugger$; per 
cljs.compiler/munge.

Any ideas how I can get around this?

Thanks,
Stu

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Newbie question on OO/records

2011-11-05 Thread Matt Hoyt
Protocols are a way to achieve polymorphism.  Clojure protocols are similar to 
Haskell types classes. 

Here is a video that explains clojure protocols: http://vimeo.com/11236603
 
Matt Hoyt



From: stevelewis spiritm...@gmail.com
To: Clojure clojure@googlegroups.com
Sent: Saturday, November 5, 2011 6:40 PM
Subject: Newbie question on OO/records

Okay, I'm trying to understand records. I read this article:
http://freegeek.in/blog/2010/05/clojure-protocols-datatypes-a-sneak-peek/
(Clojure Protocols  Datatypes - A sneak peek by Baishampayan Ghose. I
found it helpful, but the usage of datatypes and protocols looks/feels
very object-oriented to me. Am I wrong? Is it just because the
function comes before the record instance?

(fly hummingbird)

As opposed to calling:

hummingbird.fly() in a standard OO language.

Thanks for any insight.
Steve

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: - vs - and names vs anonymous function

2011-11-02 Thread Matt Hoyt
First question answer:

The code isn't the same.  The ~x is the first argument for - and is the last 
argument for -.  So if you do a long chain of expression the first argument 
is passed into the return value into the next function with - and - pass 
that value as the last parameter.

Second question:

I think what you mean is (- hi println) .   If you wanted to give the 
function multiple arguments you could do this:

(- hello (println world!)) and the other form it would be (- world! 
(println Hello))
 
Matt Hoyt



From: Dennis Haupt d.haup...@googlemail.com
To: clojure@googlegroups.com
Sent: Wednesday, November 2, 2011 4:37 AM
Subject: - vs - and names vs anonymous function

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

hi there,

i stumbled over two odd things
1) - and - have the same source code. why is that?
2) why can't i use (- hi #(println %)) directly? why do i have to
put my function into a symbol first? is there a way to avoid this?

(let [dummy #(println %)]
(- hi dummy))


- -- 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.14 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOsQ9cAAoJENRtux+h35aGle8P/ih+1jVTdmrVUmF1o/QM7N06
s+bWnhkvt9qIcs+jB8dNUSIRLaDkdqQBsO6Aj7SvlGhhgjNjKyKrBBkHwAgriCXj
H95Dk4UPAvkILYe1ztLJNkYde0TbEMiOtSHRza7PWdtMChFYRhdwW5RVQxzWQd1j
VZbp681mfPh2k8NXEo1ywG0XRxpC4/gNdV9I3spfLBO/gvLgPDFHutLKzojZtTr9
Ba8HHXxseF3e9Yp/v+j2NqA05RCWgRMqjtNW0WIXOydgmsyYw/xhUQn+mHtNgd9V
43MP6Z9lbU+ZEJNnlnqP7FQ9M07g96z9iLOkPUKV3zMqwgpu3mTmWcJdN5TtPI1B
Uzt5N6Ds/9Sx4yV3MUEK4ROcN6y94zOgUYMMrE1wdR5PvSTUehPXVWp+WfoOkpxV
HO8Li4bTFIffNx8agHAv8N6U4kO513yUqNcM0HsTMwtOZ98unhWp4xcaypszQs0I
7DBoGdR6RV/bFJV2jp5vc4lGNxEpf1+RzMluh3Z9GPKjatVno2yI4MlEblhl/zXf
SHJyOplR3Csr+ojN7v5IZZrVP+EzC41eHdpAXig4pYpVi3p3P8oAfKke7sY5yHAu
kBVG+Q+gmLH4x7vkZZIu9T7JBEX/lMaGx4/pIW95inkjJKfF9rZMNc8BqN8ezqzv
z6SKrE2KpF5YTEr8CscC
=jkOp
-END PGP SIGNATURE-

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

ClojureScript: Emacs Inferior Lisp Windows Batch Script

2011-10-24 Thread Matt Hoyt
I modified the repljs.bat to include the current directory src/clj, src/cljs, 
lib/, test/cljs, and test/clj to use with emacs inferior lisp mode in Windows.

https://gist.github.com/1310468

Matt Hoyt

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

ClojureScript: Map to ExtJS/Sencha Touch Config Object

2011-10-23 Thread Matt Hoyt
I wrote some functions to convert a map into an  ExtJS/Sencha Touch config 
object.  It converts nested list and vectors into javascript arrays.

https://gist.github.com/1307273

 
Matt Hoyt

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

AMQP

2011-10-15 Thread Matt Hoyt
I've started work on a library for amqp messaging in 
clojure: https://github.com/mrh0057/clj-amqp.  The library matches pretty close 
to the rabbitmq java library.  I didn't port over the consume and wait 
functionality from the rabbitmq library because I can't think of a use case for 
clojure.  

Is there anything I should look at for creating a dsl for distributed 
messaging? 
Is there a better way for dealing with optional arguments when its key/val 
pairs than (apply hash-map opts)?
 
Matt Hoyt

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Are futures garbage-collected?

2011-09-28 Thread Matt Hoyt
It won't get GC until it finishes running unless the thread throws an unhandled 
Exception or the application is terminated.
 
Matt Hoyt



From: Jan Rychter jrych...@gmail.com
To: clojure@googlegroups.com
Sent: Wednesday, September 28, 2011 3:38 PM
Subject: Are futures garbage-collected?


If I create a future but do not hold on to it anywhere and never dereference 
it, is the thread guaranteed to run until successful completion?

In other words, if I create futures entirely for side effects, should I worry 
about them getting terminated and GCd?

I looked for an answer but could not find anything relevant. Any hints 
appreciated.

thanks,
--J.


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: beginner question

2011-09-24 Thread Matt Hoyt
You need a check in the loop to see if the player wants to end the game.  
Clojure doesn't have a break statement like Java so you created a infinite loop 
that will never end.  To make sure the game ends you need to have a base case.  
Example of a main game loop in clojure:

(loop [game-state initial-state]
  (if (game-ends? game-state)
    (close-game game-state)
    (recur (render (logic game-state)

You should also look into records to store the game's state.  Records are 
faster than hash maps and you have polymorphism with protocols.  Be careful of 
the lazy functions in clojure like map.  It will only execute when you ask a 
value for it. 
 
Matt Hoyt



From: Dennis Haupt d.haup...@googlemail.com
To: clojure@googlegroups.com
Sent: Saturday, September 24, 2011 2:36 PM
Subject: beginner question

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

in java, i would start coding a game with a loop like this:
while (true) {
logic();
render();
}

i would store the current state of the world in an object containing
the complete data of the whole game and update its values in each
iteration.

how would i do this in clojure?

the outer loop could look like
(def next [oldstate] ()) - input = current game, return value =
next iteration

(loop [world initalState] (recur (next world))) // - the loop

but how would be world look like? the best (most trivial) thing that
i could think of is for it to be a map which is passed along several
transform functions, for example

(def playerHealthRegen [world] (...)) - input = world (a map), output
= a new map with a new entry at key playerhealth

each function would then return a slightly modified version of the
world, and at the end, i'll have my completely new state.

is that about right? or is there a completely different way i overlooked?

- -- 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.14 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOfjE+AAoJENRtux+h35aGo0MQAMipkc8e0YTPxsWsLzaVoQuz
MtXerKHHqqbuyxy+mzlc4xFfFUfs//wQGdk/ExZhby7eNVBc9AGYKarCyG/DVxfM
HwN7RVHIKDtWoHQk71dthSAzkHgbZvFxjO2W3EkI10rTsCYNFx1WV4o/PMt/KYJj
phmtO9LcHmb/ySsLveTmSdJTYjSDb7ENudLbM2z/4SP9AqN21sU1HRNF/Y4gLnq3
tnnGmbpRU8Xs6xv8O8oluRrhjgpGF58okG+JnnW+aqF95OaDMp2dQ2mPKxcWLzmt
zkMj41jC28By05oVPIIOstB50rOzU0VAQvEJRDohz2E2sxbhFfUci7G/75hvBkYz
vUXeQi4TCYM/gQlOOiAqUuutWpYWBbgL7OOHck3VkGn7UEKBguhkMTO/xGJjFxbY
6/pxIy7i7+DbSXfq+tu5sw2XAS96tctD1dWVdFjfpKukckvcDff3/L0ObKwIxTQu
BN9tqoUOs1Tp2OBJhkEJfaBMgUKqX5+IW/mKARVywNFLRWTAYs74OTO86ei/jTPo
kqwu2NGE9p/iHpLAxin8sz6I34kOlHJ2X7Xi4PBC19mmVgErt+A8MIvELuxhKBYw
BxoWZ11bccphKHFUdEDaj43pd1DqFhLqqpDvFWumUIO48pnDRpYcYcRLZ/6raCXv
apIq/CL5V7UHCJ+d/ANo
=Ckx2
-END PGP SIGNATURE-

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

  1   2   3   >