Re: [ANN] clj-refactor.el - A few Clojure refactorings for Emacs.

2014-01-02 Thread Magnar Sveen
Thanks mate, I'm glad to hear that. And thanks for your contributions too!

Your post reminded me that renaming has an annoying bug - it suggests 
replacing substrings of namespaces too. So I fixed that just now. :-)

- Magnar

On Monday, December 30, 2013 6:30:49 PM UTC+1, Alex Baranosky wrote:
>
> Hi Magnar,
>
> I've been using this library for maybe a month.  The refactorings I use by 
> far the most are renaming files, and threading/unthreading. Thanks for your 
> work on this. 
>

-- 
-- 
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: Parallel http requests

2014-01-02 Thread Glen Mailer
I can't speak for whether this is a truly idiomatic way of doing this, but 
this is a macro i've been using for this case.

(defmacro plet [bindings & body]  "Just like let, but evaluates bindings in 
parallel"  (let [bindings (partition-all 2 bindings)destructs (map 
first bindings)expressions (map second bindings)vars 
(repeatedly (count bindings) gensym)]`(let [~@(mapcat (fn [var expr] `[~var 
(future ~expr)]) vars expressions)   ~@(mapcat (fn [destr var] `[~destr 
(deref ~var)]) destructs vars)]   ~@body)))


This gives me a similar construct to let, but with each binding evaluated 
in parallel using a future. For small sets i think this is less overhead 
than pmap - note that unlike the traditional let, this will not handle 
multiple bindings for the same variable properly.

Usage would then be

(plet [a (http/get "url1")
   b (http/get "url2")]
  (vec a b))

Or similar

Cheers
Glen
On Tuesday, 31 December 2013 08:46:53 UTC, chinmoy debnath wrote:
>
> I am a newbie in clojure. I need to send multiple http requests in 
> parallel and need to have a call back when response for each request come 
> back. What will be the idiomatic way of doing it in clojure?
> Thanks in advacne
>
>

-- 
-- 
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] Generative testing in Clojure

2014-01-02 Thread James Trunk
Thanks for the comment, and I'm very glad you found it useful.

Cheers, 
James

On Wednesday, January 1, 2014 7:30:15 PM UTC+1, Mark N. wrote:
>
> Nicely done, I've been looking for a good intro to generative testing. The 
> real-world example at the end nicely illustrates the value of the 
> "shrinking" part of the algorithm. Thanks for publishing this.
>
>
> On Wed, Jan 1, 2014 at 10:58 AM, James Trunk 
> > wrote:
>
>> Hi everyone,
>>
>> Here is an introduction to generative testing in 
>> Clojure using 
>> simple-check.
>>
>> I hope newcomers to the technique/library find it useful!
>>
>> Cheers, 
>> James
>>
>> -- 
>> -- 
>> 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.
>>
>
>

-- 
-- 
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: Deploying Caribou on Openshift

2014-01-02 Thread Joshua Ballanco
You should be able to deploy with Immutant and then use the 
Immutant-Openshift-Quickstart 
(https://github.com/openshift-quickstart/immutant-quickstart) or the Immutant 
Cart (https://github.com/immutant/openshift-immutant-cart).



On Tuesday, December 31, 2013 at 16:04, Leon Talbot wrote:

> What would be the simplest way to deploy a Caribou app on openshift?
> 
> -- 
> -- 
> 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/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: Akka-like framework in Clojure ?

2014-01-02 Thread Manuel Paccagnella
I think I'd be very useful since understanding Clojure's design philosophy 
is of great value, even outside the Clojure(Script) camp. But I also think 
it'd require work from a certain number of volunteers (sounds like a wiki 
would be a useful tool for this).

There has been some work in this area:

   - A 
suggestionfrom 
Michael Nygard for a book on "the Hickey/Halloway paradigm"
   - An unofficial 
guideto
 Rich Hickey's brain :)
   - The book "The Joy Of Clojure" from Chouser and Fogus (soon to be 
   released the second edition)
   
But certainly a syntesis of the philosophy and design of Clojure, with 
links to presentations, articles and code would be useful.

What do you think? 

Cheers,
Manuel

Il giorno martedì 31 dicembre 2013 19:26:25 UTC+1, Cedric Greevey ha 
scritto:
>
> On Tue, Dec 31, 2013 at 9:26 AM, Jakub Holy 
> > wrote:
>
>> I also believe that Rich Hickey has some good reasons for why / when not 
>> to use actor-based concurrency. I cannot find the reference now, perhaps it 
>> is mentioned (also) in the StrangeLoop 2013 Clojure core.async 
>> Channels
>>  talk.
>>
>
> Does anyone else think we could use a central, searchable clearinghouse 
> containing all of the various arguments, rationales, and philosophical 
> essays underpinning Clojure's design choices in text format? AFAICT a lot 
> of that stuff is currently scattered hither and thither across the web, and 
> a lot of it is buried in the audio tracks of videos where search tools 
> can't find it, and even the videos aren't gathered in one place (e.g. a 
> Youtube channel) but instead are disseminated all over the place across 
> dozens of different hosting sites.
>
>

-- 
-- 
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.


clojure.zip needs a better way to move nodes

2014-01-02 Thread Alex Dowad
Hi, everybody,

I'm just throwing this out to see if the Clojure core team agrees, and if 
they would like me to code something up and send a PR.

clojure.zip works great if you want to walk a tree and add nodes here and 
there -- append-child, insert-child, insert-left, and insert-right cover 
all the important use cases. If you want to walk a tree and filter nodes 
out, remove has you covered. I've discovered, though, that trying to *move* 
nodes is very cumbersome, far more than it needs to be.

The crux of the problem is here (to quote the API docs):

removefunction

Usage: (remove loc)

Removes the node at loc, returning the loc that would have preceded
it in a depth-first walk.


The problem is that remove "returns the loc that would have preceded" the 
removed node "in a depth-first walk". If I want to push a node down below its 
left/right sibling, or pull it up to become a sibling of its parent, or make it 
swap places with its left/right sibling, etc. etc., going to "the loc that 
would have preceded it in a depth-first walk" is useless. Once the node is 
removed, it's very hard to find my way back to the loc where I want to insert 
it.


I'm not saying that the API for remove is faulty -- it's perfect if your goal 
is just to filter nodes out. But functions are needed which can remove a node 
*and* return the loc above/to the left/to the right.


When I ran into this problem, I cracked open the source for clojure.zip, looked 
at the source for "remove", and coded this variant up:


(defn remove-and-up [loc]
  (let [[node {l :l, ppath :ppath, pnodes :pnodes, rs :r, :as path}] loc]
(if (nil? path)
  (throw (new Exception "Remove at top"))
  (if (pos? (count l))
(up (with-meta [(peek l)
(assoc path :l (pop l) :changed? true)]
   (meta loc)))
(with-meta [(make-node loc (peek pnodes) rs) 
(and ppath (assoc ppath :changed? true))]
   (meta loc))


That removes a node, and returns the loc of its parent. My problem is now 
solved. But to a newbie programmer, that problem would have probably been 
insurmountable.


What do you think? Is adding a function or two to clojure.zip warranted?


Thanks, AD

-- 
-- 
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: Storing data on web server with Clojure

2014-01-02 Thread Sean Johnson
Keep in mind that the Heroku file system is a little "funky". Writing 
things there is not like you're used to with your local system or with a 
VPS or dedicated server. It's ephemeral and those files will disappear 
during certain events. I agree with the other Sean, that if the data is 
small and simple and you can just hold onto it in memory as Clojure data 
structures and serialize it to disk, that can be a fine approach (seems 
like an unusual case), but with Heroku, it's all about getting persistent 
data off the dyno and into external permanent storage. That's usually a 
hosted DB solution like Postgres, Redis, Mongo, CouchDB, etc. but if you 
don't have the complexity to justify a full DB, even a simple one like 
Mongo or Couch, then you should probably look into serializing your data 
structures as EDN into/out of redis key/values or an S3 bucket.

Cheers,
A different Sean

On Wednesday, January 1, 2014 4:07:11 AM UTC-5, curiousGuy wrote:
>
> I recently got started with Heroku and Clojure. They provide an optional 
> SQL database for handling data, but it is not enabled by default. I'm 
> wondering how much sense it makes to use SQL on a Clojure environment, vs 
> just using sequence types within the language to store data and backing 
> them up as writes out to a file, then reading them back in when necessary? 
> I suppose for very large data stores, this is not ideal as you'd have a lot 
> of data in memory.
>
> I'm coming from a PHP/MySQL background and am quite new to Clojure so I 
> don't want to shoot myself in the foot by quickly adopting old habits 
> rather than embracing more idiomatic approaches. Any advice, or anyone 
> actively using data in the cloud with Clojure care to comment?
>

-- 
-- 
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: Auto updating Leiningen dependencies?

2014-01-02 Thread Jean Niklas L'orange


On Thursday, January 2, 2014 1:28:19 AM UTC+1, g vim wrote:
>
> Is there are a way to auto-update project.clj dependencies in Leiningen 
> or configure them to simply use the latest stable version?


Instead of using "1.2.3", you can use "RELEASE" to specify the latest 
stable release. I would never recommend to use this in production or 
libraries, though.
 

> I'm also 
> finding `lein search ` pretty useless for quickly getting a dep's 
> latest version when it returns 39 pages for clojure itself, starting 
> with the oldest version. 
>

Yeah, Lein's search functionality is not the best. I looked at the issue 
tracker in Lein, and couldn't find an issue for this, so feel free to add 
in an issue which describes how we can improve 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
--- 
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] Optimus asset loaders and transformations

2014-01-02 Thread Magnar Sveen


Like many others, I am quite enthused about 
React.JS these 
days. I'm looking at 
Om too, 
but would like to learn React first.

If you're interested in using 
JSX with 
your React, then I've created a custom asset loader for Optimus to handle
.jsx files: optimus-jsx .

Enjoy. :-)

-- 
-- 
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.


Require namespace

2014-01-02 Thread jianghui8904

Hi,

I am a newbie of Clojure.I have some confusions of "how to require a namespace".

1、If I want to call a function of file B.clj  in the file A.clj,does I have to 
require the namespace of B.clj in A.clj?

2、In the file A.clj,if I need to call the functions of all *.clj in the special 
directory,how to require the namespace of *.clj dynamically?

Happy New Year!
Thanks in advance!

-- 
-- 
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.


Read Microsoft Word .doc files in Clojure

2014-01-02 Thread Joshua Mendoza
Hi!,

I've been looking for libraries or resources to read MS .doc files in 
Clojure, but found none. Does anyone have tried, used, encountered or 
witnessed such a thing to read them?

I found a lot of info publicly available by the government in .doc files 
but I want to process them automatically with Clojure.

The closest thing I know is using Incanter but to read XLS files, which is 
not useful at all for this...

Well, any help would be great.

Thank you!

-- 
-- 
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: Read Microsoft Word .doc files in Clojure

2014-01-02 Thread Dennis Haupt
use apache poi and write a small wrapper or something
this is what i did


2014/1/2 Joshua Mendoza 

> Hi!,
>
> I've been looking for libraries or resources to read MS .doc files in
> Clojure, but found none. Does anyone have tried, used, encountered or
> witnessed such a thing to read them?
>
> I found a lot of info publicly available by the government in .doc files
> but I want to process them automatically with Clojure.
>
> The closest thing I know is using Incanter but to read XLS files, which is
> not useful at all for this...
>
> Well, any help would be great.
>
> Thank you!
>
> --
> --
> 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: Read Microsoft Word .doc files in Clojure

2014-01-02 Thread Frank Hale
One solution is to use ClojureCLR and the OpenXML SDK.


On Thu, Jan 2, 2014 at 11:08 AM, Dennis Haupt  wrote:

> use apache poi and write a small wrapper or something
> this is what i did
>
>
> 2014/1/2 Joshua Mendoza 
>
>> Hi!,
>>
>> I've been looking for libraries or resources to read MS .doc files in
>> Clojure, but found none. Does anyone have tried, used, encountered or
>> witnessed such a thing to read them?
>>
>> I found a lot of info publicly available by the government in .doc files
>> but I want to process them automatically with Clojure.
>>
>> The closest thing I know is using Incanter but to read XLS files, which
>> is not useful at all for this...
>>
>> Well, any help would be great.
>>
>> Thank you!
>>
>> --
>> --
>> 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.
>

-- 
-- 
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: Require namespace

2014-01-02 Thread Gary Trakhman
There's a reasonable blog post here on the matter:
http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html

It's a bit complicated to regurgitate it all in a mailing list response :-).


On Thu, Jan 2, 2014 at 8:33 AM,  wrote:

>
> Hi,
>
> I am a newbie of Clojure.I have some confusions of "how to require a
> namespace".
>
> 1、If I want to call a function of file B.clj  in the file A.clj,does I
> have to require the namespace of B.clj in A.clj?
>
> 2、In the file A.clj,if I need to call the functions of all *.clj in the
> special directory,how to require the namespace of *.clj dynamically?
>
> Happy New Year!
> Thanks in advance!
>
> --
> --
> 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: clojure.zip needs a better way to move nodes

2014-01-02 Thread Timothy Baldridge
clojure.zip needs to be rewritten IMO. It's written in more of a scheme
style using vectors. Since then protocols have come out and there's no
reason why this can't make use of those. And yes, at the same time new
functions could probably be added.

I've threatened to re-write this lib several times, and always gotten
pulled away into other projects. Code it up though and I'd love to see it
pushed through.

The first thing that would need to happen would be for the library to get
much better testing, right now there aren't any tests around this lib at
all.

Anyway, that's my 2 cents.

Timothy


On Thu, Jan 2, 2014 at 5:07 AM, Alex Dowad  wrote:

> Hi, everybody,
>
> I'm just throwing this out to see if the Clojure core team agrees, and if
> they would like me to code something up and send a PR.
>
> clojure.zip works great if you want to walk a tree and add nodes here and
> there -- append-child, insert-child, insert-left, and insert-right cover
> all the important use cases. If you want to walk a tree and filter nodes
> out, remove has you covered. I've discovered, though, that trying to *move*
> nodes is very cumbersome, far more than it needs to be.
>
> The crux of the problem is here (to quote the API docs):
>
> removefunction
>
> Usage: (remove loc)
>
> Removes the node at loc, returning the loc that would have preceded
> it in a depth-first walk.
>
>
> The problem is that remove "returns the loc that would have preceded" the 
> removed node "in a depth-first walk". If I want to push a node down below its 
> left/right sibling, or pull it up to become a sibling of its parent, or make 
> it swap places with its left/right sibling, etc. etc., going to "the loc that 
> would have preceded it in a depth-first walk" is useless. Once the node is 
> removed, it's very hard to find my way back to the loc where I want to insert 
> it.
>
>
> I'm not saying that the API for remove is faulty -- it's perfect if your goal 
> is just to filter nodes out. But functions are needed which can remove a node 
> *and* return the loc above/to the left/to the right.
>
>
> When I ran into this problem, I cracked open the source for clojure.zip, 
> looked at the source for "remove", and coded this variant up:
>
>
> (defn remove-and-up [loc]
>   (let [[node {l :l, ppath :ppath, pnodes :pnodes, rs :r, :as path}] loc]
> (if (nil? path)
>   (throw (new Exception "Remove at top"))
>   (if (pos? (count l))
> (up (with-meta [(peek l)
> (assoc path :l (pop l) :changed? true)]
>(meta loc)))
> (with-meta [(make-node loc (peek pnodes) rs)
> (and ppath (assoc ppath :changed? true))]
>(meta loc))
>
>
> That removes a node, and returns the loc of its parent. My problem is now 
> solved. But to a newbie programmer, that problem would have probably been 
> insurmountable.
>
>
> What do you think? Is adding a function or two to clojure.zip warranted?
>
>
> Thanks, AD
>
>  --
> --
> 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.
>



-- 
“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 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.


Memory usage of basic Luminus web app

2014-01-02 Thread gvim
I just downloaded Luminus and setup a basic project. On OS X Mountain 
Lion/Oracle JDK 1.7 Activity Monitor shows memory usage as:


- java: 180Mb
- main: 171Mb

Is this typical for a Clojure web app or is Luminus kitchen sink in 
design? I'm new to the JVM so, for all I know, these figures may be normal.


gvim

--
--
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: Memory usage of basic Luminus web app

2014-01-02 Thread Gary Trakhman
Luminus isn't doing anything bad here, and 180MB is actually pretty small
for a clojure heap.

I hit the limits of my laptop's 8GB of memory recently while running a
number of repls simultaneously, with heaps over 700MB*4 or so.  The
simplest win for me was to enable the G1 collector by default (will be
default eventually) in all my java processes via the flag: '-XX:+UseG1GC'.
The g1 collector is much more aggressive with freeing unused memory back to
the OS than the default collector, which will be relevant to you if that's
why your heap bigger than expected.

If you're curious about the actual memory profile of your app, jvisualvm is
a handy and free tool that's distributed with an oracle JDK or available as
a separate download.


On Thu, Jan 2, 2014 at 2:11 PM, gvim  wrote:

> I just downloaded Luminus and setup a basic project. On OS X Mountain
> Lion/Oracle JDK 1.7 Activity Monitor shows memory usage as:
>
> - java: 180Mb
> - main: 171Mb
>
> Is this typical for a Clojure web app or is Luminus kitchen sink in
> design? I'm new to the JVM so, for all I know, these figures may be normal.
>
> gvim
>
> --
> --
> 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: clojure.zip needs a better way to move nodes

2014-01-02 Thread kovas boguta
There is a protocol-based zipper lib at
https://github.com/akhudek/fast-zip

In my experience it can be made even faster if perf is a huge concern.

If this lib gets upgraded, another big item is built-in support for
the full range of clojure datastructures. Currently zippers are more
limited than walk, which already has known issues in that regard.




On Thu, Jan 2, 2014 at 12:09 PM, Timothy Baldridge  wrote:
> clojure.zip needs to be rewritten IMO. It's written in more of a scheme
> style using vectors. Since then protocols have come out and there's no
> reason why this can't make use of those. And yes, at the same time new
> functions could probably be added.
>
> I've threatened to re-write this lib several times, and always gotten pulled
> away into other projects. Code it up though and I'd love to see it pushed
> through.
>
> The first thing that would need to happen would be for the library to get
> much better testing, right now there aren't any tests around this lib at
> all.
>
> Anyway, that's my 2 cents.
>
> Timothy
>
>
> On Thu, Jan 2, 2014 at 5:07 AM, Alex Dowad  wrote:
>>
>> Hi, everybody,
>>
>> I'm just throwing this out to see if the Clojure core team agrees, and if
>> they would like me to code something up and send a PR.
>>
>> clojure.zip works great if you want to walk a tree and add nodes here and
>> there -- append-child, insert-child, insert-left, and insert-right cover all
>> the important use cases. If you want to walk a tree and filter nodes out,
>> remove has you covered. I've discovered, though, that trying to *move* nodes
>> is very cumbersome, far more than it needs to be.
>>
>> The crux of the problem is here (to quote the API docs):
>>
>> remove
>>
>> function
>>
>> Usage: (remove loc)
>>
>> Removes the node at loc, returning the loc that would have preceded
>> it in a depth-first walk.
>>
>>
>> The problem is that remove "returns the loc that would have preceded" the
>> removed node "in a depth-first walk". If I want to push a node down below
>> its left/right sibling, or pull it up to become a sibling of its parent, or
>> make it swap places with its left/right sibling, etc. etc., going to "the
>> loc that would have preceded it in a depth-first walk" is useless. Once the
>> node is removed, it's very hard to find my way back to the loc where I want
>> to insert it.
>>
>>
>> I'm not saying that the API for remove is faulty -- it's perfect if your
>> goal is just to filter nodes out. But functions are needed which can remove
>> a node *and* return the loc above/to the left/to the right.
>>
>>
>> When I ran into this problem, I cracked open the source for clojure.zip,
>> looked at the source for "remove", and coded this variant up:
>>
>>
>> (defn remove-and-up [loc]
>>   (let [[node {l :l, ppath :ppath, pnodes :pnodes, rs :r, :as path}] loc]
>> (if (nil? path)
>>   (throw (new Exception "Remove at top"))
>>   (if (pos? (count l))
>> (up (with-meta [(peek l)
>> (assoc path :l (pop l) :changed? true)]
>>(meta loc)))
>> (with-meta [(make-node loc (peek pnodes) rs)
>> (and ppath (assoc ppath :changed? true))]
>>(meta loc))
>>
>>
>> That removes a node, and returns the loc of its parent. My problem is now
>> solved. But to a newbie programmer, that problem would have probably been
>> insurmountable.
>>
>>
>> What do you think? Is adding a function or two to clojure.zip warranted?
>>
>>
>> Thanks, AD
>>
>> --
>> --
>> 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.
>
>
>
>
> --
> “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 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 th

Re: Read Microsoft Word .doc files in Clojure

2014-01-02 Thread Ron Toland
If all you need is the text, you could use Apache Tika to extract 
it: http://tika.apache.org/

There's a simple clojure lib to get you 
started: https://github.com/alexott/clj-tika

I've used it to pull text out of .doc, .pdf, and .odt files.

Ron

On Wednesday, January 1, 2014 11:49:30 PM UTC-8, Joshua Mendoza wrote:
>
> Hi!,
>
> I've been looking for libraries or resources to read MS .doc files in 
> Clojure, but found none. Does anyone have tried, used, encountered or 
> witnessed such a thing to read them?
>
> I found a lot of info publicly available by the government in .doc files 
> but I want to process them automatically with Clojure.
>
> The closest thing I know is using Incanter but to read XLS files, which is 
> not useful at all for this...
>
> Well, any help would be great.
>
> Thank you!
>

-- 
-- 
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: Om, a ClojureScript binding to Facebook's React

2014-01-02 Thread David Pidcock
Very nice. Relatively easy to follow.  Basically it's re-implementing the 
drag-list behaviour  in React.  I had thought to re-use some existing code, 
provided I could inform React that the DOM was changing. (This is the 
approach used by the example in the fiddler, albeit with jquery instead of 
goog.closure as the UI manipulation library)

I'm very interested to see what you do with this, in Om.
This example is complex enough that following along would most likely fill 
in the conceptual gaps for me, that the TODO example lacks.

Again - inspiring work.. 

-- David

On Monday, December 30, 2013 10:02:37 PM UTC-8, David Nolen wrote:
>
> From a React dev:
>
> https://www.khanacademy.org/preview/content/items/xfa03b103
> https://github.com/Khan/perseus/blob/master/src/widgets/orderer.jsx#L6-L439
>
> I'm sure this can be adapted for Om. I may write up a simpler Om example 
> in the future.
>
> David
>
>
> On Tue, Dec 31, 2013 at 12:43 AM, David Pidcock 
> 
> > wrote:
>
>> On Thursday, December 19, 2013 11:12:12 AM UTC-8, David Nolen wrote:
>> > Enjoy, 
>> http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/
>> >
>> >
>> >
>> > David
>>
>> I've been playing around with some basics. I'm still a relative n00b when 
>> it comes to functional programming, and I've never looked at React before.
>>
>> Very cool stuff.
>>
>> I managed to get Om+React to display a list of items that are sorted by a 
>> given key, and I have a content-editable span which updates the state of 
>> the owner with new value of that key for a given item, and voila! the list 
>> item moves to the correct position. (as expected)
>>
>> Now here's the tricky part...
>> I want to implement a drag-list, where I can drag-drop items into a new 
>> position, and update the key based on the new position. I have that 
>> algorithm working in a different project (using goog.DragListGroup) , but 
>> React does not like you to manipulate the DOM outside it's knowledge.
>>
>> I found this :
>>
>> https://groups.google.com/forum/#!searchin/reactjs/sortable/reactjs/mHfBGI3Qwz4/rXSr-1QUcKwJ
>>
>> which lead to
>> http://jsfiddle.net/LQxy7/
>>
>> Unfortunately,  I can't get this to work with Om. I am having trouble 
>> navigating the data structures.
>>
>> How are "props" created/accessed? I followed the TodoMVC example, but 
>> that seems to be using "state", which I am given to understand should be 
>> kept as high in the hierarchy as possible (per the React recommendations). 
>>  I tried something like  (:value (om/get-props this)) from within IRender, 
>> but that doesn't work. Also : (om/get-props this [:items] )  (following the 
>> idiom established by get-state.
>>
>> I'm probably missing something obvious, so I thought I'd pop in here to 
>> see if there's someone who can point me in the right direction.
>>
>>
>> --
>> --
>> 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.
>>
>
>

-- 
-- 
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.


Inconsistent Ref Values

2014-01-02 Thread Stefan Kamphausen
Hi,

I've probably been staring at this for too long to see, what I am doing 
wrong.

I have a Ref which contains a vector similar to the following

(def data
  [{:a {:b 1 :c 0}}
   {:a {:d 1 :g 0}}
   {:a {:e 1 :h 0}}
   {:a {:f 1 :i 0}}])

There is a second ref, which is similar but without the :a-nesting.  
Between those I move values by decreasing the int for a key in one ref and 
increasing it in the other.

As long as I i use a function like the following, everything works fine:

(defn upd1 [d id k v]
  (if-not (get-in d [id :a k])
(assoc-in  d [id :a k] 1)
(update-in d [id :a k] inc)))


But when I use something like this I manage to get my Refs into 
inconsistent state, where the overall sum of all ints is not constant 
anymore.

(defn upd2 [d id k v]
  (let [keyseq [id :a k]]
(update-in d 
   keyseq
   #(inc (get-in % keyseq 0)

(Actually, this is a simplified example.  I'll try to reproduce with this 
simpler setup.)

Can anyone see an obvious reason why this fails?  I am on Clojure 1.5.1.


Thanks,
stefan

-- 
-- 
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: Inconsistent Ref Values

2014-01-02 Thread Stefan Kamphausen
OK,

got it. The get-in is stupid and is always returning 0.

Please excuse the noise
stefan

-- 
-- 
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.


ANN: [vinyasa 0.1.5] - dynamic reloading of java code without repl restart

2014-01-02 Thread zcaudate

I've added a new functionality for vinyasa 0.1.5 - a much needed function 
for reloading java code

the repo is here: https://github.com/zcaudate/vinyasa

Enjoy!

---
reimport

Don't you wish that you could make some changes to your java files and have 
them instantly loaded into your repl without restarting? Well now you can!

For example, in project.clj, you have specified your :java-source-paths

(defproject .
   :source-paths ["src/clojure"]
   :java-source-paths ["src/java"]
   )

and you have a file src/java/testing/Dog.java

package testing;public class Dog{
  public int legs = 3;  
  public Dog(){};}

You can load it into your library dynamically using reimport

(reimport '[testing.Dog]);;=> 'testing.Dog' imported from 
/target/reload/testing/Dog.class
(.legs (Dog.));; => 3

You can then change legs in testing.Dog from 3 to 4, save and go back to 
your repl:

(reimport '[[testing Dog]]) ;; supports multiple classes;;=> 'testing.Dog' 
imported from /target/reload/testing/Dog.class
(.legs (Dog.));; => 4

If you have more files, ie. copy your Dog.java file to Cat.java and do a 
global replace:

(reimport) ;; will load all classes into your namespace;;=> 'testing.Dog' 
imported from /target/reload/testing/Dog.class;;   'testing.Cat' 
imported from /target/reload/testing/Cat.class
(.legs (Cat.));; => 4

Now the pain associated with mixed clojure/java development is gone!


---
installation

inject allows easy customisation of your clojure.core namespace by allowing 
injecting of the functions that you have always wanted to have in your 
profiles.clj file. Here is an example taken from myprofiles.clj.

{:user {:plugins [...]
 :dependencies [[spyscope "0.1.4"]
[org.clojure/tools.namespace "0.2.4"]
[io.aviso/pretty "0.1.8"]
[leiningen "2.3.4"]
[im.chit/vinyasa "0.1.5"]]
 :injections [(require 'spyscope.core)
  (require 'vinyasa.inject)
  (vinyasa.inject/inject 'clojure.core
'[[vinyasa.inject inject]
  [vinyasa.pull pull]
  [vinyasa.lein lein]
  [vinyasa.reimport reimport]])
  (vinyasa.inject/inject 'clojure.core '>
'[[cemerick.pomegranate add-classpath get-classpath 
resources]
  [clojure.tools.namespace.repl refresh]
  [clojure.repl apropos dir doc find-doc source pst 
[root-cause >cause]]
  [clojure.pprint pprint]
  [clojure.java.shell sh]])]}}

I have now imported the following vars into clojure.core and they will stay 
with me as I am coding in emacs:

   - from vinyasa:
   - inject as #'clojure.core/inject
  - pull as #'clojure.core/pull
  - lein as #'clojure.core/lein
  - reimport as #'clojure.core/reimport
   - from tools.namespace:
  - refresh as #'clojure.core/refresh
   - from clojure.repl:
   - apropos as #'clojure.core/>apropos
  - dir as #'clojure.core/>dir
  - doc as #'clojure.core/>doc
  - find-doc as #'clojure.core/>find-doc
  - root-cause as #'clojure.core/>cause`
  - pst as #'clojure.core/>pst
   - from clojure.pprint:
  - pprint as #'clojure.core/>pprint
   - from clojure.java.shell:
  - sh as #'clojure.core/>sh
   - from cemerick.pomegranate:
  - add-classpath as #'clojure.core/>add-classpath
  - get-classpath as #'clojure.core/>get-classpath
  - resources as #'clojure.core/>resources
   


-- 
-- 
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] bouncer 0.3.0

2014-01-02 Thread Leonardo Borges
Just a quick note to let people know I've released bouncer 0.3.0 final.

The only extra change was this pull request:

- Merge [PR #18](https://github.com/leonardoborges/bouncer/pull/18):
"Minor readme change to not make it seem a strange design decision was
taken, and very minor (somewhat random) syntax change"

Happy new year!

Cheers,
Leonardo Borges
www.leonardoborges.com


On Thu, Aug 15, 2013 at 11:01 PM, Leonardo Borges
 wrote:
> Hi all,
>
> bouncer is a validation library for Clojure apps
>
> Github: https://github.com/leonardoborges/bouncer
> Clojars: https://clojars.org/bouncer
>
> Version 0.3.0-alpha1 has undergone major, breaking changes:
>
> - My original design made heavy use of macros for a nicer, more natural DSL
> at the expense of composition;
> - This turned out not to be the best option as I received a few bug reports
> related to issues composing validations;
> - As a result I removed almost all macros in favour of functions
>
> In a nutshell what this means is that where once you wrote this:
>
> (b/validate {:postcode -1}
>   :postcode [(v/required :message "required") (v/number :message
> "number")])
>
> You will now write this:
>
> (b/validate {:postcode -1}
>   :postcode [[v/required :message "required"] [v/number :message
> "number"]])
>
> The difference is minimal, but the gains are great as I was able to
> completely eliminate the defvalidatorset macro in favour of clojure maps:
>
> (def address-validations {:postcode [v/required v/number]})
>
> (b/validate {} address-validations)
>
> Please check out the README for updated docs as well as the CHANGELOG for
> details.
>
> Feedback on this version and the new API is greatly appreciated.
>
> Cheers,
> Leonardo Borges
> www.leonardoborges.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.


[ANN] bouncer 0.3.1-beta1 released

2014-01-02 Thread Leonardo Borges
bouncer is a validation DSL for Clojure apps

Github: https://github.com/leonardoborges/bouncer
Clojars: https://clojars.org/bouncer

TL;DR; of version 0.3.1-beta1:

You can now customise error messages however you like:

(def person {:name "Leo" :age "NaN"})

(defn custom-message-fn [{:keys [path value metadata]}]
  (format "'%s' in field %s should be a %s" value path (:validator
metadata)))

(b/validate custom-message-fn
person
:name v/required
:age  v/number)

;; [{:age ("'NaN' in field [:age] should be a :bouncer.validators/number")}
;;  {:age "NaN",
;;   :name "Leo",
;;   :bouncer.core/errors
;;   {:age
;;("NaN in field [:age] should be a :bouncer.validators/number")}}]

To learn more about this new feature please have a look at the section
"Internationalization and advanced error messages"* in the
README
.

Hats off to Vadim Platonov (https://github.com/dm3) for this pull request.

This feature is backwards compatible so existing code will be unaffected.

A 
CHANGELOGis
also available.

Feedback welcome.

Cheers,
Leonardo Borges
www.leonardoborges.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.


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.


Seeking remote Clojure work

2014-01-02 Thread Iro Wright
Anyone out there hiring remotely for contract, part time, or full time?
Please leave an email address - I'll reply with my resume and GitHub handle.

Thanks

-- 
-- 
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: Seeking remote Clojure work

2014-01-02 Thread Marcus Blankenship
Iro, you might check out Cognitect…

http://cognitect.com/jobs


On Jan 2, 2014, at 2:38 PM, Iro Wright  wrote:

> Anyone out there hiring remotely for contract, part time, or full time?
> Please leave an email address - I'll reply with my resume and GitHub handle.
> 
> Thanks
> 
> -- 
> -- 
> 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.

Marcus Blankenship
\\\ Partner, Problem Solver, Linear Thinker
\\\ 541.805.2736 \ @justzeros \ skype:marcuscreo

-- 
-- 
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.