Re: Sorting Nested Vectors and filter out some

2014-01-04 Thread Jeff Angle
Hi...I get my nested vector from a database, then map a function that 
formats it and computes the deviation, actual data looks like below..so 
I don't have any keys within the the vector, ..would like to sort by 
index 5 in in each vector descending and if index 5 is N/A (not e.g a 
percentage)remove it from the list
[[151819 ANTI HUMAN GLOBULIN SERUM 5ML  6.0 0 0 N/A N/A] 
[151090 ANTI SERUM A 10ML  6.0 0 0 N/A N/A] [151094 ANTI SERUM 
AB 10ML  6.0 0 0 N/A N/A] [151092 ANTI SERUM B 10ML  6.0 0 0 
N/A N/A] [151095 ANTI SERUM D 10ML  6.0 0 0 N/A N/A] 
[151825 BLOOD GLUCOSE GLUCOMETER-CONTOUR  0 0 0 N/A N/A] [151829 
BLOOD GLUCOSE STRIPS(50 STRIPS)-CONTOUR  12.0 360.0 0 3000.00 % 
N/A] [151828 BLOOD GLUCOSE STRIPS(50 STRIPS)-SURESTEP 0 360.0 0 N/A 
N/A]]
Thanks again

On Friday, January 3, 2014 9:33:42 PM UTC+3, john walker wrote:

 You can do something like this.

 https://gist.github.com/johnwalker/8243534

 On Friday, January 3, 2014 12:37:07 PM UTC-5, Jeff Angle wrote:

 Hi guys! this has made me pull quite a load of hair new to clojure..

 have a nested vector say [[salt 0 0  %deviation 00] [sugar 5 10 
 %deviation 5$10] [milk 1 2 %deviation 12 ] [bread] ...] where % 
 deviation is the actual figure of evaluting the deviation between e.g 5 and 
 10 for sugar, I want to sort using % deviation and also filter out those 
 with deviations of 0. Please help, will revenge when I master functional 
 programing with 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
--- 
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-04 Thread jianghui
Hi,Thank you so much ;)
I use load-file at last and it works.


2014/1/3 Gary Trakhman gary.trakh...@gmail.com

 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, jianghui8...@gmail.com 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.


-- 
-- 
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: Sorting Nested Vectors and filter out some

2014-01-04 Thread Jan Herich
Hello Jeff,

This https://gist.github.com/janherich/8255881#file-gistfile1-clj should 
do the trick, at least it worked with data set you provided :)

Dňa sobota, 4. januára 2014 11:31:07 UTC+1 Jeff Angle napísal(-a):

 Hi...I get my nested vector from a database, then map a function that 
 formats it and computes the deviation, actual data looks like below..so 
 I don't have any keys within the the vector, ..would like to sort by 
 index 5 in in each vector descending and if index 5 is N/A (not e.g a 
 percentage)remove it from the list
 [[151819 ANTI HUMAN GLOBULIN SERUM 5ML  6.0 0 0 N/A N/A] 
 [151090 ANTI SERUM A 10ML  6.0 0 0 N/A N/A] [151094 ANTI SERUM 
 AB 10ML  6.0 0 0 N/A N/A] [151092 ANTI SERUM B 10ML  6.0 0 0 
 N/A N/A] [151095 ANTI SERUM D 10ML  6.0 0 0 N/A N/A] 
 [151825 BLOOD GLUCOSE GLUCOMETER-CONTOUR  0 0 0 N/A N/A] [151829 
 BLOOD GLUCOSE STRIPS(50 STRIPS)-CONTOUR  12.0 360.0 0 3000.00 % 
 N/A] [151828 BLOOD GLUCOSE STRIPS(50 STRIPS)-SURESTEP 0 360.0 0 N/A 
 N/A]]
 Thanks again

 On Friday, January 3, 2014 9:33:42 PM UTC+3, john walker wrote:

 You can do something like this.

 https://gist.github.com/johnwalker/8243534

 On Friday, January 3, 2014 12:37:07 PM UTC-5, Jeff Angle wrote:

 Hi guys! this has made me pull quite a load of hair new to clojure..

 have a nested vector say [[salt 0 0  %deviation 00] [sugar 5 10 
 %deviation 5$10] [milk 1 2 %deviation 12 ] [bread] ...] where % 
 deviation is the actual figure of evaluting the deviation between e.g 5 and 
 10 for sugar, I want to sort using % deviation and also filter out those 
 with deviations of 0. Please help, will revenge when I master functional 
 programing with 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
--- 
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.


Contributors needed for Rouge (Clojure on Ruby)

2014-01-04 Thread gvim
I have recently moved most of my work to Clojure and Clojurescript but 
neither of these implementations seem suitable for non-http scripting, 
for which I currently use Ruby. So, you can imagine my elation when I 
discovered Rouge which is Clojure implemented on Ruby:


https://github.com/rouge-lang/rouge

The project looks fantastic but they seem to be short of contributors. 
My programming skills are nowhere near advanced enough to work on this 
myself so, please, if any of you Clojurians have proficiency in Ruby and 
Clojure please consider contributing.


I looked at Python's Hy (hylang.org) which is an excellent project in 
its own right and is heavily influenced by Clojure but its taregt is 
generic Lisp 1 rather than Clojure. Rouge will enable Clojure to occupy 
the non-http scripting space without competing directly with Clojure and 
Clojurescript.


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.


Core.logic from Java

2014-01-04 Thread Timothy Washington
Is there an easy way to use core.logic from Java, or any other JVM language
(Groovy, Scala, etc)? Of course there's the standard way of calling Clojure
from 
Javahttp://walkwithoutrhythm.net/blog/2012/03/26/how-to-call-clojure-1-dot-3-functions-from-java/
(:gen-class,
etc). But I'm just checking that there's not some wrapping code or project
that wraps core.logic for Java (before I try to do it myself).


Thanks

Tim Washington
Interruptsoftware.com http://interruptsoftware.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: Core.logic from Java

2014-01-04 Thread David Nolen
I haven't heard of anything.

David


On Sat, Jan 4, 2014 at 10:28 AM, Timothy Washington twash...@gmail.comwrote:

 Is there an easy way to use core.logic from Java, or any other JVM
 language (Groovy, Scala, etc)? Of course there's the standard way of calling
 Clojure from 
 Javahttp://walkwithoutrhythm.net/blog/2012/03/26/how-to-call-clojure-1-dot-3-functions-from-java/
  (:gen-class,
 etc). But I'm just checking that there's not some wrapping code or project
 that wraps core.logic for Java (before I try to do it myself).


 Thanks

 Tim Washington
 Interruptsoftware.com http://interruptsoftware.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.


-- 
-- 
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: Contributors needed for Rouge (Clojure on Ruby)

2014-01-04 Thread Hajime Branko Yamasaki Vukelic
On Sat, Jan 4, 2014 at 3:43 PM, gvim gvi...@gmail.com wrote:
 I looked at Python's Hy (hylang.org) which is an excellent project in its
 own right and is heavily influenced by Clojure but its taregt is generic
 Lisp 1 rather than Clojure. Rouge will enable Clojure to occupy the non-http
 scripting space without competing directly with Clojure and Clojurescript.

FYI, there's also Clojure-Py https://github.com/halgari/clojure-py


-- 
Branko
bra...@brankovukelic.com

/dev/blog: brankovukelic.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: Contributors needed for Rouge (Clojure on Ruby)

2014-01-04 Thread gaz jones
Why not just use Ruby or (my preference) Python? Both are great for quick
CLI apps / scripts. Best tool for the job, and all that?


On Sat, Jan 4, 2014 at 8:43 AM, gvim gvi...@gmail.com wrote:

 I have recently moved most of my work to Clojure and Clojurescript but
 neither of these implementations seem suitable for non-http scripting, for
 which I currently use Ruby. So, you can imagine my elation when I
 discovered Rouge which is Clojure implemented on Ruby:

 https://github.com/rouge-lang/rouge

 The project looks fantastic but they seem to be short of contributors. My
 programming skills are nowhere near advanced enough to work on this myself
 so, please, if any of you Clojurians have proficiency in Ruby and Clojure
 please consider contributing.

 I looked at Python's Hy (hylang.org) which is an excellent project in its
 own right and is heavily influenced by Clojure but its taregt is generic
 Lisp 1 rather than Clojure. Rouge will enable Clojure to occupy the
 non-http scripting space without competing directly with Clojure and
 Clojurescript.

 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: Contributors needed for Rouge (Clojure on Ruby)

2014-01-04 Thread gvim

On 04/01/2014 17:28, gaz jones wrote:

Why not just use Ruby or (my preference) Python? Both are great for
quick CLI apps / scripts. Best tool for the job, and all that?



A Clojure layer on top of Ruby means less context switching which works 
better for me as the Lisp mindset is very different from Ruby or Python. 
However, I just looked at the Rouge docs and very little seems to have 
been implemented so maybe it's dying. If so, I'll go with Hy which looks 
much more mature.


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: Contributors needed for Rouge (Clojure on Ruby)

2014-01-04 Thread gvim

On 04/01/2014 15:01, Hajime Branko Yamasaki Vukelic wrote:


FYI, there's also Clojure-Py https://github.com/halgari/clojure-py



This looks like the best of the scripting language implementations of 
Clojure in that it attempts to match the JVM implementation on PyPy. 
Sadly, however, there doesn't seem to have been any activity since last 
April so it may be a dead project.


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.


core.async/map: channels should be last argument?

2014-01-04 Thread pentaside
Hi,

core.async/map's signature:
  (map f chs buf-or-n)
... but shouldn't `chs` be the last arg?

Or do people never use the arrow operators (-) with core.async?

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: Contributors needed for Rouge (Clojure on Ruby)

2014-01-04 Thread Michael Gardner
On Jan 4, 2014, at 11:52 , gvim gvi...@gmail.com wrote:

 This looks like the best of the scripting language implementations of Clojure 
 in that it attempts to match the JVM implementation on PyPy. Sadly, however, 
 there doesn't seem to have been any activity since last April so it may be a 
 dead project.

It’s dead, Jim [1]. Hopefully the landscape for alternative Clojure hosts will 
improve with the completion of CinC [2].

[1] https://groups.google.com/d/msg/clojure-py-dev/HbeNEkIG23U/61rN0wR2qDwJ
[2] https://github.com/Bronsa/CinC

-- 
-- 
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-04 Thread Curtis Gagliardi
I'm also interested in Clojure contract work (though local would be fine if 
it's in SF), do we have any sort of place/list for Clojure jobs or is the 
supply low enough that this list is the main place?

On Saturday, January 4, 2014 9:39:38 AM UTC-8, Iro Wright wrote:

 Thanks for the tip Marcus.

 On Friday, January 3, 2014 1:52:03 AM UTC-5, Marcus Blankenship wrote:

 Iro, you might check out Cognitect…

 http://cognitect.com/jobs


 On Jan 2, 2014, at 2:38 PM, Iro Wright iro.w...@gmail.com 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 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.


 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.


Re: Seeking remote Clojure work

2014-01-04 Thread Timothy Washington
There are a few places you can look.

   - Functional Jobs // Dream Jobs for Functional
Programmershttp://functionaljobs.com/

   - Lispjobs | A gift to Lisp hackers from Will
Fitzgeraldhttp://lispjobs.wordpress.com/

   - (18) London Clojurian Jobs - Google
Groupshttps://groups.google.com/forum/?fromgroups=#!forum/london-clojurian-jobs

   - Remote Jobs: Design, Programming, Rails, Executive, and
morehttps://weworkremotely.com/



This article, Top software dev job
boardshttp://www.maxmasnick.com/articles/jobs/,
also gives a good breakdown of more general, but really good job boards.


Hth

Tim Washington
Interruptsoftware.com http://interruptsoftware.com



On Sat, Jan 4, 2014 at 2:13 PM, Curtis Gagliardi gagliardi.cur...@gmail.com
 wrote:

 I'm also interested in Clojure contract work (though local would be fine
 if it's in SF), do we have any sort of place/list for Clojure jobs or is
 the supply low enough that this list is the main place?


 On Saturday, January 4, 2014 9:39:38 AM UTC-8, Iro Wright wrote:

 Thanks for the tip Marcus.

 On Friday, January 3, 2014 1:52:03 AM UTC-5, Marcus Blankenship wrote:

 Iro, you might check out Cognitect…

 http://cognitect.com/jobs


 On Jan 2, 2014, at 2:38 PM, Iro Wright iro.w...@gmail.com 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 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.


  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.


-- 
-- 
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] core.rrb-vector 0.0.10 -- vector concatenation for Clojure(Script)

2014-01-04 Thread Michał Marczyk
Hi,

I am pleased to announce the immediate availability of version 0.0.10
of core.rrb-vector, a Clojure Contrib library enabling
logarithmic-time concatenation and slicing of Clojure(Script) vectors.

Leiningen:

  [org.clojure/core.rrb-vector 0.0.10]

Maven:

  dependency
groupIdorg.clojure/groupId
artifactIdcore.rrb-vector/artifactId
version0.0.10/version
  /dependency

Gradle:

  compile org.clojure:core.rrb-vector:0.0.10

The public API is exported by the clojure.core.rrb-vector namespace:

  (require '[clojure.core.rrb-vector :as fv])

Most users will only be interested in two functions: fv/catvec and
fv/subvec. These can be used with regular Clojure vectors (including
vectors of primitives and view vectors created with
clojure.core/subvec); there is no need to construct RRB vectors by
hand.

  (fv/catvec (fv/subvec [0 1 2] 1 2) [3 4 5])
  ;= [1 3 4 5]

New in this release:

 * Several important bug fixes; existing users should upgrade ASAP!

 * Stress testing using Zach Tellman's great collection-check library
   (which helped catch some of the aforementioned bugs); many thanks
   for this one, Zach!

 * Support for the transient API.

 * ClojureScript version (same API minus vector-of).

 * Some forgotten Java interfaces implemented for RRB vectors.

 * New behaviour of fv/vec (when passed a vector, reuses its tree).

The repository for this project is located here:

  https://github.com/clojure/core.rrb-vector

See the README or (doc clojure.core.rrb-vector) for additional details.

Cheers,
Michał

-- 
-- 
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: [vinyasa 0.1.5] - dynamic reloading of java code without repl restart

2014-01-04 Thread pmf
Very nice; I also found your Clojure workflow article (
http://z.caudate.me/give-your-clojure-workflow-more-flow/) tremendously 
useful.

-- 
-- 
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: Sorting Nested Vectors and filter out some

2014-01-04 Thread Cedric Greevey
You might wish to consider a different data structure. For example, the
inner objects might be better off as maps with named keys, so your lookup
keys would be things like :amount rather than 5. And instead of out of band
values like the string N/A you'd just omit a mapping in such cases. At
the very least you may wish to consider using nil instead of N/A as an
out of band value for not there.

But a map would allow easily adding more data later on, as well as enable
giving the lookup keys meaningful names, and would keep the existing keys
stable when new ones were added. A map may also perform better if you end
up with a lot of optional keys, as missing mappings don't take up space
while N/A values in a vector do.

As for naming integer positions using constants, such as (def amount 5),
there are two weaknesses with that approach.

First, inserting new values will shift all of the existing ones that are
farther to the right to higher indices, so you'd have to change amount to
6 and hope you hadn't missed any direct lookups with 5 instead of amount.
But if you use a map with a key of :amount, adding more keys can never move
the actual amount value away from :amount.

And second, you can namespace keys to avoid collisions, with :my-ns/amount
and :other-ns/amount not colliding. You can namespace def'd integer
constants too, with (in-ns 'my-ns) (def amount 5) and (in-ns 'other-ns)
(def amount 7), but if one day you end up with a situation where two
namespaces def two different things to the key 5, the namespacing isn't
going to help you.

Maps with named and namespaceable :keyword keys are much more robust and
scalable in large (or potentially-in-the-future-large) projects and in the
presence of many optional keys. With Clojure, it's strongly recommended to
use maps with named keys instead of positionally-significant entries in
vectors to represent structured tuples of data like you seem to have here.
The robustness becomes especially significant if you save and load data and
keep old data around as the application grows. If you reorder the vectors,
or insert new fields before existing ones, and then read in old data, the
values will end up with the wrong keys, whereas if you use maps, keywords,
and edn format the values in old data can never end up reading back in with
the wrong keys (as long as you never rename already-used keys for any
reason, which with meaningful names and especially namespacing you should
never need to do).

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


clj-http over SSL?

2014-01-04 Thread aidy lewis
Hi,

Is it possible to use clj-http over SSL, and if so could someone please
post an example which uses a SSL client cert?

Many Thanks

-- 
@AidyLewis

-- 
-- 
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] data.avl 0.0.10 -- fast sorted maps and sets with log-time rank queries

2014-01-04 Thread Michał Marczyk
Hi,

I am pleased to announce the initial Clojure Contrib release of
data.avl (previously known as avl.clj), a library implementing drop-in
replacements for Clojure(Script)'s sorted maps and sets with faster
lookups, support for the transient API (leading to unambiguously
improved performance for many usage patterns) and log-time rank
queries (via clojure.core/nth and clojure.data.avl/rank-of).

There are two relevant trade-offs: higher memory usage (a pointer and
two ints per key) and somewhat slower single updates. See below for
an extended discussion and some benchmark results.

For users of avl.clj 0.0.9: this release fixes a bug in rank-of and a
single reflective call I missed previously. Upgrading requires no
changes other than to the namespace name, which is now
clojure.data.avl.

The Maven artefact is now available from Maven Central; dependency
information is as follows (Leiningen / Maven / Gradle):

  [org.clojure/data.avl 0.0.10]

  dependency
groupIdorg.clojure/groupId
artifactIddata.avl/artifactId
version0.0.10/version
  /dependency

  compile org.clojure:data.avl:0.0.10

The repository for this project is located here:

  https://github.com/clojure/data.avl

data.avl uses persistent AVL trees as the underlying data structure.
AVL trees tend to be significantly shallower than red-black trees;
since the built-in sorted collections use red-black trees, data.avl
maps and sets offer noticeably improved expected lookup times.

The trade-off here is that updates (assoc / dissoc / conj / disj)
must perform more work in rebalancing the trees, so they are typically
slower than with the built-ins. However, data.avl maps and sets
support the transient API, which can be used to speed up long chains
of updates. Thanks to this, data.avl types tend to outperform the
built-ins for batch updates. One particularly important case of this
type is that of the initial construction of large instances; this
tends to be noticeably faster with data.avl types (on a par with the
built-ins worst-case in my benchmarking so far).

(Of course the time to complete all operations varies with tree
structure. When comparing lookup times for nodes occupying the same
positions in both trees, the built-in red-black trees have a very
slight edge; see for example (get avl 0) and (get rb 0) in the
benchmark results below. Updates involving identically placed nodes
may be faster in either tree type depending on the overall shape of
the tree; see for example (dissoc avl 131071) and (dissoc rb 131071)
below, where the AVL map completes the operation twice as fast. On
average, however, performance is as described above.)

Besides supporting transients, data.avl types offer two additions to
the sorted collection API:

  (require '[clojure.data.avl :as avl])

  ;; nth can be used to look up the nth smallest item in a sorted
  ;; collection, as determined by the comparator being used:

  (nth (avl/sorted-set 0 2 4) 2)
  ;= 4

  (nth (avl/sorted-set-by  0 2 4) 2)
  ;= 0

  ;; for maps, nth returns map entry objects:

  (nth (avl/sorted-map 0 0 2 2 4 4) 2)
  ;= [4 4]

  ;; clojure.data.avl/rank-of can be used to query for the index of a
  ;; given key in a data.avl collection:

  (avl/rank-of (avl/sorted-set 3 4 5) 4)
  ;= 1

  ;; if the key is not present in the collection, -1 is returned:
  (avl/rank-of (avl/sorted-set 3 4 5) 0)
  ;= -1

As mentioned above, the new functionality comes at a cost in memory
consumption. To support transients, each node in a data.avl tree must
carry an extra reference field -- that's one pointer per key. To
support efficient rank queries, each pointer needs to carry an extra
int field. Finally, another int field is used by the rebalancing
algorithm itself.

The library carries its own test suite used in both Clojure and
ClojureScript. Additionally, the Clojure version is stress-tested with
Zach Tellman's collection-check library.

I attach some Criterium benchmark results below.

Cheers,
Michał


Benchmark environment:

  OpenJDK 1.7, Clojure 1.5.1, Criterium 0.4.2.

Relevant defs:

  (def ks   (range 30))
  (def ksks (interleave ks ks))

  (def rb  (apply sorted-map ksks))
  (def avl (apply avl/sorted-map ksks))

  (defn rb-rank-of [rb-map k]
(if (contains? rb k)
  (count (take-while #(not= k (key %)) (seq rb)))
  -1))

Benchmark results:

(lookup-benchmarks)
===
(c/bench (get avl 0))
WARNING: Final GC required 17.30960512486499 % of runtime
WARNING: Final GC required 1.487642242862071 % of runtime
Evaluation count : 184965780 in 60 samples of 3082763 calls.
 Execution time mean : 320.595187 ns
Execution time std-deviation : 2.710112 ns
   Execution time lower quantile : 316.756609 ns ( 2.5%)
   Execution time upper quantile : 325.833642 ns (97.5%)
   Overhead used : 2.128084 ns
(c/bench (get rb 0))
WARNING: Final GC required 1.481744139127142 % of runtime
Evaluation count : 192022740 in 60 samples of 3200379 calls.