How should I begin this project?

2014-03-20 Thread kurofune

At my job, I have to meet clients multiple times a week and schedule 
appointments with them at various places around town. Recently, I have seen 
a boom in business and while this is very fortunate it has made scheduling 
tedious. Lamenting this fact, it dawned on me that I might be able to make 
a web-application that tells me if there are any scheduling asymmetries 
between me and my clients. I am thinking of something with a front page 
like this:

| myself: 
| other-person:  
| appointment-time:
| location:   

Both parties would enter the appropriate information on separate devices or 
desktops. The information would be pushed to a database, new users would be 
automatically added. A scan will be made at intervals to find mismatched 
appointments, the asymmetry logged and a notice sent out to one or both of 
the users, suggesting they reconfirm the appointment. Well aligned 
appointments will have green status; mis-aligned ones, red, both viewable 
via a monitoring screen that updates automatically. Of course, there might 
be other functionality that I will want to add in later: login/security, 
aesthetics, customized behavior for appointments with multiple users and 
clear distinctions between business and client. In the beginning, however, 
I just want to breathe a little easier knowing that my appointments are 
sorted, something that simple calendar apps cannot do.

I am relatively new to both Clojure and programming, but have managed to 
get myself to a point where I can make websites that include functionality 
and rendering. I have done a few tutorials utilizing databases (Datomic, 
jdbc, postgresql), read a handful of books, and completed a lot of 
tutorials. I still feel, however, that I don't know how to tie everything I 
have learned together to tackle larger tasks that require complexity 
management. I don't really know where to start, and would be grateful if 
someone could give me advice in terms of what technologies I should use and 
how I should organize the project. Should I use Clojures built in state 
management features  and jdbc/postgresql or view this as an opportunity to 
dip into Datomic and core.async. I am excited about making something that 
utilizes all of Clojure's technologies that other people can use and learn 
from, but is it possible to go too far down the Clojure rabbit-hole? Also, 
if this type of web-app already exists and you happen to have heard of it, 
please tell me and I will be happy to use it instead of having to make it 
from scratch. 

Jesse

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


Re: [GSoC] Proposal: persistent probabilistic data structures

2014-03-20 Thread Matteo Ceccarello
Thank you Nicola :D

Il giorno mercoledì 19 marzo 2014 13:42:31 UTC+1, Nicola Mometto ha scritto:


 Matteo, 
 When sending the CA adding a project name is optional, you can leave 
 it empty. 

 Usually the name for a contrib project will be chosen in the thread in 
 clojure-dev when proposing the library as a contrib project, see 

 http://dev.clojure.org/display/community/Guidelines+for+Clojure+Contrib+committers
  
 for more details 

 Nicola 

 Matteo Ceccarello writes: 

  I just had a short conversation with Ambrose through comments on my 
  proposal. He suggests to offer this library to Clojure contrib. 
  So I have to sign a Clojure CA, however I don't know what project name 
 to 
  put in the form, since the project has yet to start. 
  
  Any suggestion? What should I do? 
  
  Thanks 
  Matteo 
  
  Il giorno venerdì 14 marzo 2014 14:53:44 UTC+1, Matteo Ceccarello ha 
  scritto: 
  
  Nicola, 
  thank you :) It's really nice to see that I'm not alone! 
  
  Everybody, I just updated the proposal, following the guidelines 
 suggested 
  by the wiki. 
  
  Cheers, 
  Matteo 
  
  Il giorno giovedì 13 marzo 2014 23:06:11 UTC+1, Nicola Mometto ha 
 scritto: 
  
  
  Matteo, 
  best of luck with your proposal, all of those seem like good potential 
  additions to the clojure data-structure landscape. 
  
  BTW I'm too a fellow UniPD clojure user so you can inc the counter :) 
  
  Nicola 
  
  Matteo Ceccarello writes: 
  
   Hello everybody, 
   
   I just submitted my proposal for this year's GSoC. I already 
 introduced 
  the 
   topic on this mailing list. 
   Here you can find the complete proposal: 
   
   
  
 http://www.google-melange.com/gsoc/proposal/public/google/gsoc2014/matteo_ceccarello/5778586438991872
  
   
   So, if you have suggestions on how to improve it, or if you have any 
   request, please tell me :) 
   
   I'm really looking forward to work with Clojure for this year's 
 GSoC: I 
   want to learn it really well, since 
   my long term goal is to make more and more people at my University 
 use 
  it. 
   Working on an open source project 
   under the guidance of an expert mentor seems to me the best way to 
  achieve 
   this. 
   
   Bests 
   Matteo 
  
  


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


Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-20 Thread Michał Marczyk
On 19 March 2014 21:14, Alex Miller a...@puredanger.com wrote:

 Rich just pushed a change to the String hashing to address this. We're
 going to grab the string hashcode (which is cached after first call) and
 murmur the result of that. This gives us constant time hashcode after first
 call with better distribution for combinations in nested collections.  Will
 be in presumed RC2.


If I understand correctly, this means that keywords and symbols use
String.hashCode-based hashing in this commit. They are, however, capable of
caching their Murmur3 hashes, so I was wondering if it might be better to
have them use Murmur3 to hash name  ns?

Rationale: murmuring hashCode results in collisions whenever hashCode does,
plus possibly some additonal collisions if ints collide under murmur;
murmur is better all around.

Potential problems: not sure if things like case depend on symbol/keyword
hashes being directly based on string hashes; hopefully not?

Cheers,
Michał





 On Wednesday, March 19, 2014 11:26:51 AM UTC-5, Stefan Kamphausen wrote:



 On Wednesday, March 19, 2014 4:34:45 PM UTC+1, Alex Miller wrote:

 Thanks, this is all really useful. I would appreciate any more detailed
 info.



 * No atoms, agents, refs
 * Almost purely functional plus logging and I/O
 * Multi-threaded using latest core.async with thread, no go
 * JVisualVM reports top methods in CPU sampling c.l.LazySeq.sval,
 c.c$promise$reify_6310.deref, c.l.LazySeq.seq no notable difference for me
 to see.

 A few experiments on two data-sets (dat1 and dat2) using either a call to
 set or to doall:

Clojure Op Time (dat1) Time (dat1) Average dat1 Time (dat2)  1.5.1 set
 19,1 19 19,05 323  1.5.1 doall 19 19,4 19,2 330  1.6.0-RC1 set 19,5 19,8
 19,65 350  1.6.0-RC1 doall 20,2 19,8 20 351




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


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


Re: STM and persistent data structures performance on mutli-core archs

2014-03-20 Thread François Rey

On 20/03/14 04:03, Andy C wrote:
So, the following test puzzles me. Not because it takes virtually the 
same time (I know that Fork/Join is not cheap and memory is probably 
the biggest bottleneck here). But because I do not get why map (as 
opposed to r/ma) uses all 8 cores on my MacBookPro.  All of them seem 
to be running according to Activity Monitor at more less the same level.


user= (def l (into [] (range 6000)))
#'user/l
user= (time (def a (doall (map #(Math/sin (* % %)) l
Elapsed time: 19986.18 msecs

user= (time (def a (doall (into [] (r/map #( Math/sin (* % %)) l)
Elapsed time: 18980.583 msecs
I would also expect this code to run on a single CPU at any one time, 
however process/thread scheduling can make this thread run on different 
cores at different times. Depending on the sampling method the activity 
monitor may display another picture of what you would expect. On my 
linux machine, the cpu history graph shows it's using mostly one cpu at 
any one time, but it's not always the same cpu.
I think the JVM uses all cores by default, and there's no standard way 
to specify thread affinity 
http://stackoverflow.com/questions/2238272/java-thread-affinity.



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

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: STM and persistent data structures performance on mutli-core archs

2014-03-20 Thread László Török
into uses reduce under the hood, you probably need fold to have the
computation to run on FJ:

(def a (time (r/foldcat (r/map #( Math/sin (* % %)) l)


this runs more than 2x as fast on my macbook pro

Las



On Thu, Mar 20, 2014 at 10:34 AM, François Rey fmj...@gmail.com wrote:

  On 20/03/14 04:03, Andy C wrote:

  So, the following test puzzles me. Not because it takes virtually the
 same time (I know that Fork/Join is not cheap and memory is probably the
 biggest bottleneck here). But because I do not get why map (as opposed to
 r/ma) uses all 8 cores on my MacBookPro.  All of them seem to be running
 according to Activity Monitor at more less the same level.

  user= (def l (into [] (range 6000)))
 #'user/l
 user= (time (def a (doall (map #(Math/sin (* % %)) l
 Elapsed time: 19986.18 msecs

 user= (time (def a (doall (into [] (r/map #( Math/sin (* % %)) l)
 Elapsed time: 18980.583 msecs

 I would also expect this code to run on a single CPU at any one time,
 however process/thread scheduling can make this thread run on different
 cores at different times. Depending on the sampling method the activity
 monitor may display another picture of what you would expect. On my linux
 machine, the cpu history graph shows it's using mostly one cpu at any one
 time, but it's not always the same cpu.
 I think the JVM uses all cores by default, and there's no standard way to
 specify thread 
 affinityhttp://stackoverflow.com/questions/2238272/java-thread-affinity
 .


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




-- 
László Török
Checkout Lollyrewards.com http://www.lollyrewards.com - Giving credit,
getting credit.
Follow us on Twitter @lollyrewards https://twitter.com/lollyrewards
Stay up to date on the latest offers by liking our Facebook
pagehttps://www.facebook.com/lollyrewards
.

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


Re: STM and persistent data structures performance on mutli-core archs

2014-03-20 Thread François Rey

On 20/03/14 12:26, László Török wrote:
into uses reduce under the hood, you probably need fold to have 
the computation to run on FJ:

Yes, now I see all my CPUs being maxed-out.

francois@laptop:~$ perf stat java -cp 
~/.m2/repository/org/clojure/clojure/1.5.1/clojure-1.5.1.jar 
clojure.main -e (require '[clojure.core.reducers :as r]) (let [l (into 
[] (range 1000))] (time (r/fold + (r/map #(Math/sin (* % %)) l

Elapsed time: 1594.89737 msecs
678.1151045769922

 Performance counter stats for 'java -cp 
/home/francois/.m2/repository/org/clojure/clojure/1.5.1/clojure-1.5.1.jar clojure.main 
-e (require '[clojure.core.reducers :as r]) (let [l (into [] (range 
1000))] (time (r/fold + (r/map #(Math/sin (* % %)) l':


  23460.971496 task-clock# *4.728**CPUs utilized*
 7,663 context-switches  #0.000 M/sec
   570 CPU-migrations#0.000 M/sec
   174,586 page-faults   #0.007 M/sec
68,361,248,389 cycles#2.914 
GHz [83.33%]
44,379,949,020 stalled-cycles-frontend   #   64.92% frontend cycles 
idle[83.21%]
22,520,594,887 stalled-cycles-backend#   32.94% backend cycles 
idle[66.75%]

63,715,541,342 instructions  #0.93  insns per cycle
 #0.70  stalled cycles 
per insn [83.39%]
11,104,063,057 branches  #  473.299 
M/sec   [83.25%]
   155,172,776 branch-misses #1.40% of all 
branches [83.46%]


   4.962656410 seconds time elapsed

francois@laptop:~$ perf stat java -cp 
~/.m2/repository/org/clojure/clojure/1.5.1/clojure-1.5.1.jar 
clojure.main -e (require '[clojure.core.reducers :as r]) (let [l (into 
[] (range 1000))] (time (reduce + (map #(Math/sin (* % %)) l

Elapsed time: 5694.224824 msecs
678.1151045768991

 Performance counter stats for 'java -cp 
/home/francois/.m2/repository/org/clojure/clojure/1.5.1/clojure-1.5.1.jar clojure.main 
-e (require '[clojure.core.reducers :as r]) (let [l (into [] (range 
1000))] (time (reduce + (map #(Math/sin (* % %)) l':


  21365.047020 task-clock# *2.324 CPUs utilized*
 9,443 context-switches  #0.000 M/sec
   375 CPU-migrations#0.000 M/sec
   164,960 page-faults   #0.008 M/sec
64,028,578,416 cycles#2.997 
GHz [83.21%]
39,016,283,425 stalled-cycles-frontend   #   60.94% frontend cycles 
idle[83.26%]
21,038,585,232 stalled-cycles-backend#   32.86% backend cycles 
idle[66.77%]

63,857,091,972 instructions  #1.00  insns per cycle
 #0.61  stalled cycles 
per insn [83.29%]
11,161,960,110 branches  #  522.440 
M/sec   [83.48%]
   138,372,839 branch-misses #1.24% of all 
branches [83.28%]


   9.195138860 seconds time elapsed

francois@laptop:~$

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

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How should I begin this project?

2014-03-20 Thread Tim Visher
I would just use Google Calendar for that.

On Thu, Mar 20, 2014 at 3:53 AM, kurofune jesseluisd...@gmail.com wrote:

 At my job, I have to meet clients multiple times a week and schedule
 appointments with them at various places around town. Recently, I have seen
 a boom in business and while this is very fortunate it has made scheduling
 tedious. Lamenting this fact, it dawned on me that I might be able to make a
 web-application that tells me if there are any scheduling asymmetries
 between me and my clients. I am thinking of something with a front page like
 this:

 | myself:
 | other-person:
 | appointment-time:
 | location:

 Both parties would enter the appropriate information on separate devices or
 desktops. The information would be pushed to a database, new users would be
 automatically added. A scan will be made at intervals to find mismatched
 appointments, the asymmetry logged and a notice sent out to one or both of
 the users, suggesting they reconfirm the appointment. Well aligned
 appointments will have green status; mis-aligned ones, red, both viewable
 via a monitoring screen that updates automatically. Of course, there might
 be other functionality that I will want to add in later: login/security,
 aesthetics, customized behavior for appointments with multiple users and
 clear distinctions between business and client. In the beginning, however, I
 just want to breathe a little easier knowing that my appointments are
 sorted, something that simple calendar apps cannot do.

 I am relatively new to both Clojure and programming, but have managed to get
 myself to a point where I can make websites that include functionality and
 rendering. I have done a few tutorials utilizing databases (Datomic, jdbc,
 postgresql), read a handful of books, and completed a lot of tutorials. I
 still feel, however, that I don't know how to tie everything I have learned
 together to tackle larger tasks that require complexity management. I don't
 really know where to start, and would be grateful if someone could give me
 advice in terms of what technologies I should use and how I should organize
 the project. Should I use Clojures built in state management features  and
 jdbc/postgresql or view this as an opportunity to dip into Datomic and
 core.async. I am excited about making something that utilizes all of
 Clojure's technologies that other people can use and learn from, but is it
 possible to go too far down the Clojure rabbit-hole? Also, if this type of
 web-app already exists and you happen to have heard of it, please tell me
 and I will be happy to use it instead of having to make it from scratch.

 Jesse

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

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


Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-20 Thread Alex Miller
Yes, agreed.

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


Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-20 Thread Alex Miller
case depends on hashCode, not hasheq, so should be unaffected by these changes.

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


om component state

2014-03-20 Thread Adrian Miron

I'm starting to use om in some projects and one of the first components I 
had to build was a simple notification component. It shows a message at the 
top of the page. Other components in the page will use it to display 
messages when errors happen.

My idea was to send the message string to it via a channel and store it in 
local state. From there it will be rendered by the component.

The component doesn't use any application state so I build it with what I 
believed to be a nil cursor (om/build notification *nil* {...}). The 
problem is that when the component gets rendered I get a No protocol 
method ICursor.-path defined for type null error.

I'm not sure if my design of this component is ok (core.async channel to 
send messages and use of local state) or should I change it and remove the 
use of channels and put the message in the application state. I kinda like 
the channel approach :)

Any ideas?


Thank you,
Adrian



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


Clojure Cookbook is out

2014-03-20 Thread Nando Breiter
I got an email from O'Reilly this morning saying that the Clojure Cookbook
had been released, and bought it immediately. Thanks to everyone who
contributed! It's very helpful.

http://shop.oreilly.com/product/0636920029786.do

Nando


Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamedia

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


Re: Clojure Cookbook is out

2014-03-20 Thread Thomas
woooh

More good books is good for Clojure. Going to order mine today. And a BIG 
BIG BIG thank you for everyone who has contributed, that is what I love 
about Clojure (almost ;) ) most, the community!!!

Thomas

On Thursday, March 20, 2014 1:15:57 PM UTC, Nando Breiter wrote:

 I got an email from O'Reilly this morning saying that the Clojure Cookbook 
 had been released, and bought it immediately. Thanks to everyone who 
 contributed! It's very helpful.

 http://shop.oreilly.com/product/0636920029786.do

 Nando


 Aria Media Sagl
 Via Rompada 40
 6987 Caslano
 Switzerland

 +41 (0)91 600 9601
 +41 (0)76 303 4477 cell
 skype: ariamedia
  

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


Re: How should I begin this project?

2014-03-20 Thread Nando Breiter
I'm not sure what you mean by scheduling asymmetries. If you mean that
someone misunderstood where and when you are supposed to meet, that's one
thing. Instead of a web application, you could use a simple email to
confirm appointments in this way. At least your clients already use email
and would not need to be motivated to use a separate web application to
confirm appointments only with you.

If confirming appointments is your main goal, then you could build a simple
application to enter your appointments and send out confirmation emails
with a link to click, which would back to your application and would
register the appointment as confirmed while displaying a Thanks!
Appointment confirmed message. That makes it simple, both for your clients
and for you. If your clients have to log into an app to confirm
appointments only will you, you might wind up sending emails to to remind
them to do it more often than you'd like, and they might simply reply to
your email saying appointment ok for tuesday.

If you mean that the application should assist users to find possible
meeting times, calculating how their schedules overlap with conflicting
appointment times and then finding gaps where a meeting could possibly
occur, well, having worked on a scheduling application for the last several
years, I'd say this might be more complex than it first seems, especially
if you are new to programming. We have an intuitive grasp of time periods
that may make it *seem* deceptively simple to program. I'm not saying it's
especially difficult, but it is challenging.

In the real world, people use different applications to schedule their
appointments, and to be effective, your application would need to grab that
data from various sources from all users. I don't think people would easily
enter appointments in multiple applications, even if there are unique
benefits to your app.

Nando




Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamedia


On Thu, Mar 20, 2014 at 1:52 PM, Tim Visher tim.vis...@gmail.com wrote:

 I would just use Google Calendar for that.

 On Thu, Mar 20, 2014 at 3:53 AM, kurofune jesseluisd...@gmail.com wrote:
 
  At my job, I have to meet clients multiple times a week and schedule
  appointments with them at various places around town. Recently, I have
 seen
  a boom in business and while this is very fortunate it has made
 scheduling
  tedious. Lamenting this fact, it dawned on me that I might be able to
 make a
  web-application that tells me if there are any scheduling asymmetries
  between me and my clients. I am thinking of something with a front page
 like
  this:
 
  | myself:
  | other-person:
  | appointment-time:
  | location:
 
  Both parties would enter the appropriate information on separate devices
 or
  desktops. The information would be pushed to a database, new users would
 be
  automatically added. A scan will be made at intervals to find mismatched
  appointments, the asymmetry logged and a notice sent out to one or both
 of
  the users, suggesting they reconfirm the appointment. Well aligned
  appointments will have green status; mis-aligned ones, red, both viewable
  via a monitoring screen that updates automatically. Of course, there
 might
  be other functionality that I will want to add in later: login/security,
  aesthetics, customized behavior for appointments with multiple users and
  clear distinctions between business and client. In the beginning,
 however, I
  just want to breathe a little easier knowing that my appointments are
  sorted, something that simple calendar apps cannot do.
 
  I am relatively new to both Clojure and programming, but have managed to
 get
  myself to a point where I can make websites that include functionality
 and
  rendering. I have done a few tutorials utilizing databases (Datomic,
 jdbc,
  postgresql), read a handful of books, and completed a lot of tutorials. I
  still feel, however, that I don't know how to tie everything I have
 learned
  together to tackle larger tasks that require complexity management. I
 don't
  really know where to start, and would be grateful if someone could give
 me
  advice in terms of what technologies I should use and how I should
 organize
  the project. Should I use Clojures built in state management features
  and
  jdbc/postgresql or view this as an opportunity to dip into Datomic and
  core.async. I am excited about making something that utilizes all of
  Clojure's technologies that other people can use and learn from, but is
 it
  possible to go too far down the Clojure rabbit-hole? Also, if this type
 of
  web-app already exists and you happen to have heard of it, please tell me
  and I will be happy to use it instead of having to make it from scratch.
 
  Jesse
 
  --
  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 

[ANN] Eastwood 0.1.1 Clojure lint tool

2014-03-20 Thread Andy Fingerhut
Eastwood is a Clojure lint tool.  It analyzes Clojure source code in
Leiningen projects, reporting things that may be errors.

Installation instructions are in the documentation here:

https://github.com/jonase/eastwood/#installation--quick-usage

The previous release was in January 2014.  Updates since then are described
in the change log here:


https://github.com/jonase/eastwood/blob/master/changes.md#changes-from-version-010-to-011

Probably the most noticeable changes for Eastwood users will be the errors
if namespace/file name inconsistencies are found, and the reduction in bad
reflection warnings.

Below is the description Eastwood from the January 2014 release:

For example, did you know that if you use clojure.test to write tests, and
have multiple deftest definitions in the same namespace with the same name,
then the tests in all but the last deftest will never be run, whether those
tests would pass or fail?  Eastwood can find those duplicate names, as well
as other occurrences of the same Var name defined more than once.

Eastwood can also warn about misplaced doc strings, calling deprecated
functions or Java methods, expressions that are suspicious because they
always return the same value (e.g. (= expr) is always true), expressions
whose return value is not used and appear to have no side effects, and a
few others.  See the documentation linked above for a complete list.

Jonas Enlund wrote the original version of Eastwood with the help of
several other contributors.  Version 0.1.1 is an update by Jonas, Nicola
Mometto, and myself.  It uses the new Clojure contrib libraries
tools.reader for reading the code, and tools.analyzer and
tools.analyzer.jvm for parsing the source into abstract syntax trees,
making it straightforward to write many of the linters.  Thanks especially
to Nicola Mometto for tireless enhancements and bug fixes to those
libraries.

You can file issues on the Github issue tracker if you encounter problems,
but please read the Known Issues section of the documentation before
filing problems.  Several issues have already been discovered, and their
causes documented, while testing Eastwood on most of the Clojure contrib
libraries, Clojure itself, and over 35 other open source libraries.

Go squash some bugs!

Andy Fingerhut

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


Re: How should I begin this project?

2014-03-20 Thread kurofune
Thanks for the responses. I looked into google calendar but I couldn't find 
anything about this feature. I agree that things can get complex and unwieldy 
really quick. I am of course using emails and calendars. The problem is that 
when dealing with large numbers of customers it would be nice to have a black 
and white system to make clear whether or not an appointment was scheduled. 
Some people forget to enter things into their calendars after reading the 
emails oar enter them wrong, others think that the next appointment is 
implicit, even on national holidays, because it is a weekly event. I just want 
to eliminate room for error. asymmetry would be  when one person has an 
appointment scheduled for a time and the other person doesn't. I thought that 
was pretty clear from the context but I guess I should have explained more. I 
will look more into google calendar to see if scheduling can be automatically 
verified between users like I am hoping. 

Cheers, 

Jesse

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


Re: How should I begin this project?

2014-03-20 Thread Gary Trakhman
This sounds like exactly what doodle does: http://doodle.com/en/


On Thu, Mar 20, 2014 at 11:43 AM, kurofune jesseluisd...@gmail.com wrote:

 Thanks for the responses. I looked into google calendar but I couldn't
 find anything about this feature. I agree that things can get complex and
 unwieldy really quick. I am of course using emails and calendars. The
 problem is that when dealing with large numbers of customers it would be
 nice to have a black and white system to make clear whether or not an
 appointment was scheduled. Some people forget to enter things into their
 calendars after reading the emails oar enter them wrong, others think that
 the next appointment is implicit, even on national holidays, because it is
 a weekly event. I just want to eliminate room for error. asymmetry would be
  when one person has an appointment scheduled for a time and the other
 person doesn't. I thought that was pretty clear from the context but I
 guess I should have explained more. I will look more into google calendar
 to see if scheduling can be automatically verified between users like I am
 hoping.

 Cheers,

 Jesse

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


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


Re: How should I begin this project?

2014-03-20 Thread Gary Trakhman
Also, general programming advice:

I find myself switching between top-down and bottom-up approaches
willy-nilly, but in either case I would avoid worrying about choosing
components and impls right away.  With both approaches, when prototyping,
I'd favor use of core functions and data structures wherever possible at
first as it provides the most generic ways to change your mind in the
future.

Top-down: 'programming by wishful thinking', assume functions will
implement your desired inputs and outputs, this is kind of like TDD.

Bottom-up: draw out the components and boundaries between them, spec out
one component, implement it, revisit the interconnections and iterate.

If the data-model code (I'd just use simple maps and an atom or something)
starts becoming too specific, at that point you should consider
re-implementing it in datomic.  By then, you'd have a body of code with
some semantics and tests that constrain the design, and the design-space is
smaller, therefore easier to wrap your head around.

You have to know when it's possible and beneficial to defer decisions, and
this is an exercise in visualizing dependency graphs and thinking through
ramifications.  Eventually you'll have an idea of what 'complex' feels
like, with language to explain it, and techniques to avoid it.

I draw boxes with inputs and outputs on them in a make-up-as-I-go-along
notation..  that's beneficial for me usually.


On Thu, Mar 20, 2014 at 11:47 AM, Gary Trakhman gary.trakh...@gmail.comwrote:

 This sounds like exactly what doodle does: http://doodle.com/en/


 On Thu, Mar 20, 2014 at 11:43 AM, kurofune jesseluisd...@gmail.comwrote:

 Thanks for the responses. I looked into google calendar but I couldn't
 find anything about this feature. I agree that things can get complex and
 unwieldy really quick. I am of course using emails and calendars. The
 problem is that when dealing with large numbers of customers it would be
 nice to have a black and white system to make clear whether or not an
 appointment was scheduled. Some people forget to enter things into their
 calendars after reading the emails oar enter them wrong, others think that
 the next appointment is implicit, even on national holidays, because it is
 a weekly event. I just want to eliminate room for error. asymmetry would be
  when one person has an appointment scheduled for a time and the other
 person doesn't. I thought that was pretty clear from the context but I
 guess I should have explained more. I will look more into google calendar
 to see if scheduling can be automatically verified between users like I am
 hoping.

 Cheers,

 Jesse

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




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


Re: [GSoC] Proposal, question and possible call for menthor

2014-03-20 Thread Reid Draper
I think #2 would be a great addition to test.check, and I'd be happy to be 
a mentor.

Reid

On Wednesday, March 19, 2014 3:49:30 PM UTC-5, Dmitry Groshev wrote:

 Hello, Clojurians!

 GSoC application deadline is dangerously close and it's time to fill an 
 application, at last. But here is a problem: I don't know what will be the 
 best for community. I have a few ideas and I will present them here to get 
 some feedback. Sorry for a bit late posting!

 First: this is the idea listed on Ideas Page [1], Data Visualization 
 Components with Om / React.js. I would like to participate; in particular, 
 I'm very interested in building a decent graph rendering library. It seems 
 like there are a lot of JS libraries to draw graphs out there, but all of 
 them lack features that I needed one time or another:
 -composable layouts/transformations, like in Gephi (you can run one 
 transformation after another there);
 -static rendering without fancy animation of force-based layout;
 -efficient handling of data changes (here is where React can be useful);
 -ability to add user-defined forces. It's very useful when you have 
 special nodes that should be pulled to particular points.
 Of course, this should be based on top of React's model, which adds an 
 interesting exploratory aspect to the project.
 Mentor: I've tried to contact Kovas about this project, but wasn't 
 successful. I hope that was a mail quirk.

 Second: when I write Erlang, I enjoy PropEr (an Erlang property testing 
 library) a lot. Some time ago a similar system was created for Clojure 
 (test.check [2]). It's a decent property-based checker, but a couple of 
 things are still lacking:
 -support for stateful system checking. This is called statem in PropEr 
 and described in [3]. It's based on modelling stateful system as FSM and 
 comparing behaviour of model and system under test. One of interesting 
 usages of statem in PropEr is to test external servers: for example, 
 properly-designed REST API can be modelled pretty easily by a FSM.
 -support for automatic generator inference from type specifications (in 
 Clojure Prismatic's Schema can be used) [4]. Obviously, it makes using 
 property-testing a lot easier.
 -support for generator statistics — what instances was generated, what was 
 the distribution of test sizes and so on.
 In this project, if it will be selected, I will implement this three 
 features for test.check. I had very positive experience with PropEr and I 
 hope that this project can help more people start using property-based 
 testing.
 Mentor: Reid Draper. I contacted him and he agreed to mentor the project.

 Third: arguably, one of the best plotting libraries around is R's ggplot 
 [5]. It was recently ported to Python, as well [6]. It's different from all 
 other libraries of the kind in that it implements a grammar of graphics: 
 small pieces of reusable functionality that together constitute plots. Here 
 is an example:

 ggplot(mry, aes(x=year, y=number, group=rating)) + geom_line(aes(colour = 
 rating)) + scale_colour_gradient(low=red) # produces [7]

 This fits Clojure's ideology nicely. It can also be even better in Clojure 
 after a small modification of original ggplot design, which is replacing 
 overloaded plus style with plain vectors. This is a big project, but I 
 believe I can port this library to Clojure and ClojureScript in GSoC 
 timeframe. The majority of code will be the same, and because this will not 
 be a core.X project, I will be able to use cljx to share code. One of 
 spin-offs from this project will be a simple dataframe-like (think R or 
 Python's pandas [8]) data structure usable in both languages.
 Mentor: there is no at this point. I will appreciate a lot if someone will 
 volunteer.

 This concludes the list of ideas. Please share your thoughts and let me 
 know, if you are able to mentor me on third project! I will fill an 
 application in 36 hours from now.

 [1]: http://dev.clojure.org/display/community/Project+Ideas
 [2]: https://github.com/clojure/test.check
 [3]: http://proper.softlab.ntua.gr/papers/eirini-thesis.pdf
 [4]: http://proper.softlab.ntua.gr/papers/proper_types.pdf
 [5]: http://ggplot2.org/
 [6]: https://pypi.python.org/pypi/ggplot
 [7]: http://docs.ggplot2.org/current/geom_line-8.png
 [8]: http://pandas.pydata.org/


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@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 

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-20 Thread Tim McCormack
On Wednesday, March 19, 2014 4:14:38 PM UTC-4, Alex Miller wrote:
 Rich just pushed a change to the String hashing to address this. We're 
going to grab the string hashcode (which is cached after first call) and 
murmur the result of that. This gives us constant time hashcode after first 
call with better distribution for combinations in nested collections. Will 
be in presumed RC2.

(Discussion continued from IRC and Github.)

This does make PHM vulnerable to hashDoS attacks again -- [AaAa  
AaBB BBAa] will all hash to the same value, so an attacker can pass a 
ton of these colliding strings to a webapp as a querystring or POST body 
and really bog down the machine. Best article I could find on this attack: 
http://cryptanalysis.eu/blog/2011/12/28/effective-dos-attacks-against-web-application-plattforms-hashdos/

Is there some compromise we can make between caching and good hashing?

My naïve thought would be to combine the native String hashCode with a 
Murmur hash of a fixed chunk of the string, then possibly run that 
combination through Murmur. This avoids hashing unbounded data more than 
once, and would be effective against basic hashDoS. (Intelligently picking 
the fixed chunk of the string would be essential for protecting against an 
adaptive hashDoS attack.)

 - Tim McCormack

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


Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-20 Thread Michał Marczyk
We're vulnerable to this problem anyway as long as hashing is
deterministic, which is why I think it would be cool to use some
universal-hashing-like scheme...

I think Murmur3 actually uses a seed that could be randomized? Not
really safe in the cryptographic sense of the word, but would make
this sort of attack more challenging.

The way to avoid the problem completely is to use BST-based
dictionaries -- slower, but free from pathological edge cases.

Murmuring a short initial fragment could still be cool, just because
we'd probably get a better hash.

Cheers,
Michał


On 20 March 2014 17:40, Tim McCormack group-cloj...@brainonfire.net wrote:
 On Wednesday, March 19, 2014 4:14:38 PM UTC-4, Alex Miller wrote:
 Rich just pushed a change to the String hashing to address this. We're
 going to grab the string hashcode (which is cached after first call) and
 murmur the result of that. This gives us constant time hashcode after first
 call with better distribution for combinations in nested collections. Will
 be in presumed RC2.

 (Discussion continued from IRC and Github.)

 This does make PHM vulnerable to hashDoS attacks again -- [AaAa 
 AaBB BBAa] will all hash to the same value, so an attacker can pass a
 ton of these colliding strings to a webapp as a querystring or POST body and
 really bog down the machine. Best article I could find on this attack:
 http://cryptanalysis.eu/blog/2011/12/28/effective-dos-attacks-against-web-application-plattforms-hashdos/

 Is there some compromise we can make between caching and good hashing?

 My naïve thought would be to combine the native String hashCode with a
 Murmur hash of a fixed chunk of the string, then possibly run that
 combination through Murmur. This avoids hashing unbounded data more than
 once, and would be effective against basic hashDoS. (Intelligently picking
 the fixed chunk of the string would be essential for protecting against an
 adaptive hashDoS attack.)

  - Tim McCormack

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

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


Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-20 Thread Andy Fingerhut
Regarding Michal's comment of using BST (binary search tree)-based
dictionaries, Clojure does already have sorted-maps and sorted-sets that do
this, for comparable keys/elements.

A nice hybrid of the nearly-O(1) typical case of hash maps/sets, and
simultaneously protecting against the cases where there are many hash
collisions, is to have the 'leaves' of the current hash maps/sets be binary
search trees, rather than linked lists.

That requires the keys/element to be comparable, but today's
clojure.core/compare cannot compare all pairs of things, and perhaps there
is no practical way to try to include everything in a more general
compare function so that everything hashable (i.e. every Java object) is
also comparable.  Would it be easier to create a 'universal compare'
function for all Clojure values, assuming they only contained Clojure
values inside of them?

Andy


On Thu, Mar 20, 2014 at 9:56 AM, Michał Marczyk michal.marc...@gmail.comwrote:

 We're vulnerable to this problem anyway as long as hashing is
 deterministic, which is why I think it would be cool to use some
 universal-hashing-like scheme...

 I think Murmur3 actually uses a seed that could be randomized? Not
 really safe in the cryptographic sense of the word, but would make
 this sort of attack more challenging.

 The way to avoid the problem completely is to use BST-based
 dictionaries -- slower, but free from pathological edge cases.

 Murmuring a short initial fragment could still be cool, just because
 we'd probably get a better hash.

 Cheers,
 Michał


 On 20 March 2014 17:40, Tim McCormack group-cloj...@brainonfire.net
 wrote:
  On Wednesday, March 19, 2014 4:14:38 PM UTC-4, Alex Miller wrote:
  Rich just pushed a change to the String hashing to address this. We're
  going to grab the string hashcode (which is cached after first call) and
  murmur the result of that. This gives us constant time hashcode after
 first
  call with better distribution for combinations in nested collections.
 Will
  be in presumed RC2.
 
  (Discussion continued from IRC and Github.)
 
  This does make PHM vulnerable to hashDoS attacks again -- [AaAa
 
  AaBB BBAa] will all hash to the same value, so an attacker can pass a
  ton of these colliding strings to a webapp as a querystring or POST body
 and
  really bog down the machine. Best article I could find on this attack:
 
 http://cryptanalysis.eu/blog/2011/12/28/effective-dos-attacks-against-web-application-plattforms-hashdos/
 
  Is there some compromise we can make between caching and good hashing?
 
  My naïve thought would be to combine the native String hashCode with a
  Murmur hash of a fixed chunk of the string, then possibly run that
  combination through Murmur. This avoids hashing unbounded data more than
  once, and would be effective against basic hashDoS. (Intelligently
 picking
  the fixed chunk of the string would be essential for protecting against
 an
  adaptive hashDoS attack.)
 
   - Tim McCormack
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
 your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
  ---
  You received this message because you are subscribed to the Google Groups
  Clojure group.
  To unsubscribe from this group and stop receiving emails from it, send an
  email to clojure+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.

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


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

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-20 Thread Andy Fingerhut
In case it isn't clear, I don't think such drastic changes could ever hope
to be done in a reasonable time frame for Clojure 1.6.0.  Probably better
to have a different thread for this if there is interest in discussing it.

Andy


On Thu, Mar 20, 2014 at 10:03 AM, Andy Fingerhut
andy.finger...@gmail.comwrote:

 Regarding Michal's comment of using BST (binary search tree)-based
 dictionaries, Clojure does already have sorted-maps and sorted-sets that do
 this, for comparable keys/elements.

 A nice hybrid of the nearly-O(1) typical case of hash maps/sets, and
 simultaneously protecting against the cases where there are many hash
 collisions, is to have the 'leaves' of the current hash maps/sets be binary
 search trees, rather than linked lists.

 That requires the keys/element to be comparable, but today's
 clojure.core/compare cannot compare all pairs of things, and perhaps there
 is no practical way to try to include everything in a more general
 compare function so that everything hashable (i.e. every Java object) is
 also comparable.  Would it be easier to create a 'universal compare'
 function for all Clojure values, assuming they only contained Clojure
 values inside of them?

 Andy


 On Thu, Mar 20, 2014 at 9:56 AM, Michał Marczyk 
 michal.marc...@gmail.comwrote:

 We're vulnerable to this problem anyway as long as hashing is
 deterministic, which is why I think it would be cool to use some
 universal-hashing-like scheme...

 I think Murmur3 actually uses a seed that could be randomized? Not
 really safe in the cryptographic sense of the word, but would make
 this sort of attack more challenging.

 The way to avoid the problem completely is to use BST-based
 dictionaries -- slower, but free from pathological edge cases.

 Murmuring a short initial fragment could still be cool, just because
 we'd probably get a better hash.

 Cheers,
 Michał


 On 20 March 2014 17:40, Tim McCormack group-cloj...@brainonfire.net
 wrote:
  On Wednesday, March 19, 2014 4:14:38 PM UTC-4, Alex Miller wrote:
  Rich just pushed a change to the String hashing to address this. We're
  going to grab the string hashcode (which is cached after first call)
 and
  murmur the result of that. This gives us constant time hashcode after
 first
  call with better distribution for combinations in nested collections.
 Will
  be in presumed RC2.
 
  (Discussion continued from IRC and Github.)
 
  This does make PHM vulnerable to hashDoS attacks again -- [AaAa
 
  AaBB BBAa] will all hash to the same value, so an attacker can pass
 a
  ton of these colliding strings to a webapp as a querystring or POST
 body and
  really bog down the machine. Best article I could find on this attack:
 
 http://cryptanalysis.eu/blog/2011/12/28/effective-dos-attacks-against-web-application-plattforms-hashdos/
 
  Is there some compromise we can make between caching and good hashing?
 
  My naïve thought would be to combine the native String hashCode with a
  Murmur hash of a fixed chunk of the string, then possibly run that
  combination through Murmur. This avoids hashing unbounded data more than
  once, and would be effective against basic hashDoS. (Intelligently
 picking
  the fixed chunk of the string would be essential for protecting against
 an
  adaptive hashDoS attack.)
 
   - Tim McCormack
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
 your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
  ---
  You received this message because you are subscribed to the Google
 Groups
  Clojure group.
  To unsubscribe from this group and stop receiving emails from it, send
 an
  email to clojure+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.

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




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

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-20 Thread Alex Miller

On Thursday, March 20, 2014 11:56:46 AM UTC-5, Michał Marczyk wrote:

 We're vulnerable to this problem anyway as long as hashing is 
 deterministic, which is why I think it would be cool to use some 
 universal-hashing-like scheme... 


Agreed - whether it's the old algorithm or new, it's still a deterministic 
function from input to hash and an attacker could create inputs that 
generate the same hash regardless.
 

 I think Murmur3 actually uses a seed that could be randomized? Not 
 really safe in the cryptographic sense of the word, but would make 
 this sort of attack more challenging. 


It does and we currently set that seed to 0. It would be completely 
feasible to randomize that seed on a per-VM basis thus hashing differently 
on different JVM instances. Java 7 includes an implementation of this 
(after u7) for Strings. 

In Java 8, interestingly they removed all of that and just fixed the hash 
collection implementation to use balanced trees for collisions instead of 
lists. Seems like something similar could potentially be done in the 
HashCollisionNode impl in PHM.
 


 The way to avoid the problem completely is to use BST-based 
 dictionaries -- slower, but free from pathological edge cases. 

 Murmuring a short initial fragment could still be cool, just because 
 we'd probably get a better hash. 


That's an interesting conjecture, but I wouldn't judge it until I saw data 
on the hash quality and performance impact.

I do not expect that any of these changes would be in 1.6.0 - a workaround 
for any of these problems would be to create a deftype that wrapped a 
String, implemented IHashEq, and hashed with a VM-specific seed.
 


 Cheers, 
 Michał 


 On 20 March 2014 17:40, Tim McCormack 
 group-...@brainonfire.netjavascript: 
 wrote: 
  On Wednesday, March 19, 2014 4:14:38 PM UTC-4, Alex Miller wrote: 
  Rich just pushed a change to the String hashing to address this. We're 
  going to grab the string hashcode (which is cached after first call) 
 and 
  murmur the result of that. This gives us constant time hashcode after 
 first 
  call with better distribution for combinations in nested collections. 
 Will 
  be in presumed RC2. 
  
  (Discussion continued from IRC and Github.) 
  
  This does make PHM vulnerable to hashDoS attacks again -- [AaAa 
  
  AaBB BBAa] will all hash to the same value, so an attacker can pass 
 a 
  ton of these colliding strings to a webapp as a querystring or POST body 
 and 
  really bog down the machine. Best article I could find on this attack: 
  
 http://cryptanalysis.eu/blog/2011/12/28/effective-dos-attacks-against-web-application-plattforms-hashdos/
  
  
  Is there some compromise we can make between caching and good hashing? 
  
  My naïve thought would be to combine the native String hashCode with a 
  Murmur hash of a fixed chunk of the string, then possibly run that 
  combination through Murmur. This avoids hashing unbounded data more than 
  once, and would be effective against basic hashDoS. (Intelligently 
 picking 
  the fixed chunk of the string would be essential for protecting against 
 an 
  adaptive hashDoS attack.) 
  
   - Tim McCormack 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.comjavascript: 
  Note that posts from new members are moderated - please be patient with 
 your 
  first post. 
  To unsubscribe from this group, send email to 
  clojure+u...@googlegroups.com javascript: 
  For more options, visit this group at 
  http://groups.google.com/group/clojure?hl=en 
  --- 
  You received this message because you are subscribed to the Google 
 Groups 
  Clojure group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to clojure+u...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/d/optout. 


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


Re: How should I begin this project?

2014-03-20 Thread David Pidcock
I second Google Calendar. 
You can make appointments show as busy so the details are not shared with all 
clients. Then share your calendar with each client. You can invite specific 
clients to specific appointments via email, make some of them recurring, and 
it's up to the client to respond to say they can make it or not. 
If a client uses iCal or Google calendar themselves they can share that with 
you and you can overlay multiple calendars on the same view so it's easy to 
spot conflicts 
 

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


Re: How should I begin this project?

2014-03-20 Thread kurofune
Thank you very much for both of those emails Gary. Your programming advice rang 
very true and doodle does look almost exactly like what I need. I'll look into 
that and google calendar, but now I need a good project to work on! How does 
one go about getting mentored in Clojure? Is that even a thing? 

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


ANN simple-time

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

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

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

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

Enjoy!

-Matt

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


local mutable state

2014-03-20 Thread Andy Smith

Is is very bad form to use local mutable state to solve problems like :

https://www.4clojure.com/problem/114

i.e. 

(fn [n f xs] (let [c (atom 0)] (take-while #(if (f %) ( n (swap! c inc)) 
true) xs)))

If so, what is the strongest reason to reject this kind of code? Since its 
a local atom it ought to be thread-safe right?

Thanks

Andy

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


Re: Defining custom tags using hiccup ?

2014-03-20 Thread Carlos Fontes
Dave Sann

Custom tags are awesome! Just what I was looking for!
Do you have this anywhere in clojars.org?

On Thursday, April 25, 2013 10:17:42 AM UTC+1, Dave Sann wrote:

 see this commit for main changes to hiccup


 https://github.com/davesann/hiccup/commit/e8c06d884eb22a2cdd007f880a9dd5e1c13669a4

 On Thursday, 25 April 2013 18:55:52 UTC+10, Dave Sann wrote:

 I replied to this a long time ago and in the original case - I did not 
 see huge value in the suggestion. But recently I wanted to do exactly what 
 Murtaza suggests.

 There are a couple of reasons why I think this capability would be 
 useful. (And rereading Murtaza's email - I think this is what he meant)

 1. The functions defined in hiccup and other libraries are not portable. 
 if you rely on these, they will only work if the library maintained has 
 copied the function interface exactly. This is not always the case. (as a 
 separate comment these utility functions 
 would be better separated from the rendering code).

 2. I would be great to write markup that describes your domain, not HTML 
 so
 [:address :street here :city there]

 rather than [:div lots of html specific bits ... street...]

 3. It would be great to be able to switch the rendering of your domain 
 without editing the overall markup structure.

 4. if webcomponents take off - which I hope they do - you may be able to 
 gracefully transition by disabling the various tag rewriting again, not 
 touching the main markup logic.

 So I had a look to see if this can be done - and it can - relatively 
 easily. 
 I implemented it the easiest way initially - but there are alternative 
 possibilities for how this might work. Currently it uses a multimethod - 
 but it might be better to pass in tag expanding functions when rendering 
 - this would be more flexible.

 The changes to hiccup to achieve this are quite minor.

 See here: https://github.com/davesann/hiccup/commit/custom-tags

 I added a basic repl example file
 https://github.com/davesann/hiccup/blob/custom-tags/repl/example.clj

 A nice thing here is that incompatibilities between hiccup and cljs 
 equivalents could be mitigated if we could agree on a standard for 
 allowing custom tags.

 Thoughts anyone?

 Dave








 On Monday, 14 May 2012 00:31:48 UTC+10, Walter Tetzner wrote:

 You could do this without adding anything to hiccup.

 If you wrote a function that, say, used walk, you could have it go
 through the vectors, and replace the custom tags with what they
 represent. Then you could just call that before calling `html'.

 (html
   (transform
 [:html
   [:head
 [:title some page]]
   [:body
 [:link-to {:url http://www.google.com/} Hi this is 
 Google]]]))

 The benefit to doing it this way over having the macro is that it's
 clear where the custom tags come from when looking at the invocation
 of `html'.

 If you really want `html' to handle it, maybe it could be called with
 a map of tranform functions?

 (html {:link-to link-to}
  [:html
[:head
  [:title some page]]
   [:body
 [:link-to {:url http://www.google.com/} Hi this is Google]]])

 Either way, I think this ends up being nicer than a macro that changes
 the behavior of `html'.


 On Sunday, May 13, 2012 12:35:46 AM UTC-4, Murtaza Husain wrote:




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


Re: ANN simple-time

2014-03-20 Thread James Trunk
Hi Matt,

Thanks for your work on this library, it looks truly excellent.

The next time I need to deal with dates or times I'll be reaching straight 
for simple-time.

Cheers, 
James

On Thursday, March 20, 2014 7:15:55 PM UTC+1, Matt Bossenbroek wrote:

 It is my pleasure to announce simple-time to the world: 
 https://github.com/mbossenbroek/simple-time

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

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

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

 Enjoy!

 -Matt



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


Re: local mutable state

2014-03-20 Thread Jacob Goodson
I suggest using proteus https://github.com/ztellman/proteus for performant 
local mutation.

On Thursday, March 20, 2014 3:34:20 PM UTC-4, Andy Smith wrote:


 Is is very bad form to use local mutable state to solve problems like :

 https://www.4clojure.com/problem/114

 i.e. 

 (fn [n f xs] (let [c (atom 0)] (take-while #(if (f %) ( n (swap! c inc)) 
 true) xs)))

 If so, what is the strongest reason to reject this kind of code? Since its 
 a local atom it ought to be thread-safe right?

 Thanks

 Andy


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


Re: local mutable state

2014-03-20 Thread James Reeves
There are a few reasons to reject this style of code:

1. It's typically less performant.
2. It's more prone to error.
3. It's not particularly idiomatic.

Also, as this is a learning exercise, I suspect that the question is
directing you toward a more functional solution.

- James


On 20 March 2014 19:34, Andy Smith the4thamig...@googlemail.com wrote:


 Is is very bad form to use local mutable state to solve problems like :

 https://www.4clojure.com/problem/114

 i.e.

 (fn [n f xs] (let [c (atom 0)] (take-while #(if (f %) ( n (swap! c inc))
 true) xs)))

 If so, what is the strongest reason to reject this kind of code? Since its
 a local atom it ought to be thread-safe right?

 Thanks

 Andy

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


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


Re: local mutable state

2014-03-20 Thread Timothy Baldridge
Not to mention that this isn't local mutation. You are handing the atom to
a closure that then gets wrapped by lazy-seq and returned. So the atom may
actually sit around for some time.


On Thu, Mar 20, 2014 at 2:26 PM, James Reeves ja...@booleanknot.com wrote:

 There are a few reasons to reject this style of code:

 1. It's typically less performant.
 2. It's more prone to error.
 3. It's not particularly idiomatic.

 Also, as this is a learning exercise, I suspect that the question is
 directing you toward a more functional solution.

 - James


 On 20 March 2014 19:34, Andy Smith the4thamig...@googlemail.com wrote:


 Is is very bad form to use local mutable state to solve problems like :

 https://www.4clojure.com/problem/114

 i.e.

 (fn [n f xs] (let [c (atom 0)] (take-while #(if (f %) ( n (swap! c inc))
 true) xs)))

 If so, what is the strongest reason to reject this kind of code? Since
 its a local atom it ought to be thread-safe right?

 Thanks

 Andy

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


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




-- 
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/d/optout.


Re: local mutable state

2014-03-20 Thread Andy Smith
Also from the proteus link, i read 'these variables cannot escape the local 
scope; if passed into a function or closed over', which is a problem with 
code such as in my example I suppose.

I wasnt trying to avoid the functional approach but just being devils 
advocate. Thanks for your comments.

P.S. This forum is great. Although I keep asking dumb newbie questions, 
everyone still gives helpful replies, Thanks all...

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


Re: [ANN] Eastwood 0.1.1 Clojure lint tool

2014-03-20 Thread Sean Corfield
Thanx for Eastwood - it's a great tool!

Just FYI, using Clojure 1.6.0 builds produces these warnings:

WARNING: record? already refers to: #'clojure.core/record? in namespace: 
clojure.tools.analyzer.utils, being replaced by: 
#'clojure.tools.analyzer.utils/record?
WARNING: record? already refers to: #'clojure.core/record? in namespace: 
clojure.tools.analyzer, being replaced by: 
#'clojure.tools.analyzer.utils/record?

We've had to disable :wrong-arity due to our use of java.jdbc / congomongo but 
our code - including all our Expectations tests - is clean of lint otherwise!

Sean

On Mar 20, 2014, at 8:02 AM, Andy Fingerhut andy.finger...@gmail.com wrote:
 Eastwood is a Clojure lint tool.  It analyzes Clojure source code in 
 Leiningen projects, reporting things that may be errors.
 
 Installation instructions are in the documentation here:
 
 https://github.com/jonase/eastwood/#installation--quick-usage
 
 The previous release was in January 2014.  Updates since then are described 
 in the change log here:
 
 
 https://github.com/jonase/eastwood/blob/master/changes.md#changes-from-version-010-to-011
 
 Probably the most noticeable changes for Eastwood users will be the errors if 
 namespace/file name inconsistencies are found, and the reduction in bad 
 reflection warnings.
 
 Below is the description Eastwood from the January 2014 release:
 
 For example, did you know that if you use clojure.test to write tests, and 
 have multiple deftest definitions in the same namespace with the same name, 
 then the tests in all but the last deftest will never be run, whether those 
 tests would pass or fail?  Eastwood can find those duplicate names, as well 
 as other occurrences of the same Var name defined more than once.
 
 Eastwood can also warn about misplaced doc strings, calling deprecated 
 functions or Java methods, expressions that are suspicious because they 
 always return the same value (e.g. (= expr) is always true), expressions 
 whose return value is not used and appear to have no side effects, and a few 
 others.  See the documentation linked above for a complete list.
 
 Jonas Enlund wrote the original version of Eastwood with the help of several 
 other contributors.  Version 0.1.1 is an update by Jonas, Nicola Mometto, and 
 myself.  It uses the new Clojure contrib libraries tools.reader for reading 
 the code, and tools.analyzer and tools.analyzer.jvm for parsing the source 
 into abstract syntax trees, making it straightforward to write many of the 
 linters.  Thanks especially to Nicola Mometto for tireless enhancements and 
 bug fixes to those libraries.
 
 You can file issues on the Github issue tracker if you encounter problems, 
 but please read the Known Issues section of the documentation before filing 
 problems.  Several issues have already been discovered, and their causes 
 documented, while testing Eastwood on most of the Clojure contrib libraries, 
 Clojure itself, and over 35 other open source libraries.
 
 Go squash some bugs!
 
 Andy Fingerhut




signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: local mutable state

2014-03-20 Thread Jacob Goodson
You can use proteus with a while loop and be as imperative as you like, 
however, I think the point of 4clojure is to learn the functional approach 
to solving problems(I do not really advocate one over the other honestly; 
multiparadigm ftw)

On Thursday, March 20, 2014 4:35:14 PM UTC-4, Andy Smith wrote:

 Also from the proteus link, i read 'these variables cannot escape the 
 local scope; if passed into a function or closed over', which is a problem 
 with code such as in my example I suppose.

 I wasnt trying to avoid the functional approach but just being devils 
 advocate. Thanks for your comments.

 P.S. This forum is great. Although I keep asking dumb newbie questions, 
 everyone still gives helpful replies, Thanks all...


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


Re: [ANN] Eastwood 0.1.1 Clojure lint tool

2014-03-20 Thread Nicola Mometto

Are you sure it's pulling the last tools.analyzer version?
That warning has been disabled by this commit in tools.analyzer
https://github.com/clojure/tools.analyzer/commit/89d98b688448fe3d02bcabea240bcb2f6d2bbd70
which is two months old

Nicola

Sean Corfield writes:

 Thanx for Eastwood - it's a great tool!

 Just FYI, using Clojure 1.6.0 builds produces these warnings:

 WARNING: record? already refers to: #'clojure.core/record? in namespace: 
 clojure.tools.analyzer.utils, being replaced by: 
 #'clojure.tools.analyzer.utils/record?
 WARNING: record? already refers to: #'clojure.core/record? in namespace: 
 clojure.tools.analyzer, being replaced by: 
 #'clojure.tools.analyzer.utils/record?

 We've had to disable :wrong-arity due to our use of java.jdbc / congomongo 
 but our code - including all our Expectations tests - is clean of lint 
 otherwise!

 Sean

 On Mar 20, 2014, at 8:02 AM, Andy Fingerhut andy.finger...@gmail.com wrote:
 Eastwood is a Clojure lint tool.  It analyzes Clojure source code in 
 Leiningen projects, reporting things that may be errors.

 Installation instructions are in the documentation here:

 https://github.com/jonase/eastwood/#installation--quick-usage

 The previous release was in January 2014.  Updates since then are described 
 in the change log here:

 
 https://github.com/jonase/eastwood/blob/master/changes.md#changes-from-version-010-to-011

 Probably the most noticeable changes for Eastwood users will be the errors 
 if namespace/file name inconsistencies are found, and the reduction in bad 
 reflection warnings.

 Below is the description Eastwood from the January 2014 release:

 For example, did you know that if you use clojure.test to write tests, and 
 have multiple deftest definitions in the same namespace with the same name, 
 then the tests in all but the last deftest will never be run, whether those 
 tests would pass or fail?  Eastwood can find those duplicate names, as well 
 as other occurrences of the same Var name defined more than once.

 Eastwood can also warn about misplaced doc strings, calling deprecated 
 functions or Java methods, expressions that are suspicious because they 
 always return the same value (e.g. (= expr) is always true), expressions 
 whose return value is not used and appear to have no side effects, and a few 
 others.  See the documentation linked above for a complete list.

 Jonas Enlund wrote the original version of Eastwood with the help of several 
 other contributors.  Version 0.1.1 is an update by Jonas, Nicola Mometto, 
 and myself.  It uses the new Clojure contrib libraries tools.reader for 
 reading the code, and tools.analyzer and tools.analyzer.jvm for parsing the 
 source into abstract syntax trees, making it straightforward to write many 
 of the linters.  Thanks especially to Nicola Mometto for tireless 
 enhancements and bug fixes to those libraries.

 You can file issues on the Github issue tracker if you encounter problems, 
 but please read the Known Issues section of the documentation before 
 filing problems.  Several issues have already been discovered, and their 
 causes documented, while testing Eastwood on most of the Clojure contrib 
 libraries, Clojure itself, and over 35 other open source libraries.

 Go squash some bugs!

 Andy Fingerhut

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


Re: om component state

2014-03-20 Thread Moritz Ulrich

Adrian Miron writes:

 I'm starting to use om in some projects and one of the first components I 
 had to build was a simple notification component. It shows a message at the 
 top of the page. Other components in the page will use it to display 
 messages when errors happen.

 My idea was to send the message string to it via a channel and store it in 
 local state. From there it will be rendered by the component.

 The component doesn't use any application state so I build it with what I 
 believed to be a nil cursor (om/build notification *nil* {...}). The 
 problem is that when the component gets rendered I get a No protocol 
 method ICursor.-path defined for type null error.

 I'm not sure if my design of this component is ok (core.async channel to 
 send messages and use of local state) or should I change it and remove the 
 use of channels and put the message in the application state. I kinda like 
 the channel approach :)

 Any ideas?


 Thank you,
 Adrian

My gut feeling tells me to put notifications into the application state:
They get conj'ed into a ::notifications or similar and the
event-view-component (or some other mechanism) removes old ones from the
list after a timeout or similar.

Your approach should be fine too - just give it a try. The simplest
solution to your problem is passing the whole application state to
`build' - the performance penalty on state-changes should be negligible
as long as React doesn't need to modify the DOM.

-- 
Moritz Ulrich

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


Re: om component state

2014-03-20 Thread David Nolen
On Thu, Mar 20, 2014 at 5:57 AM, Adrian Miron adrian.miron...@gmail.comwrote:


 I'm starting to use om in some projects and one of the first components I
 had to build was a simple notification component. It shows a message at the
 top of the page. Other components in the page will use it to display
 messages when errors happen.

 My idea was to send the message string to it via a channel and store it in
 local state. From there it will be rendered by the component.

 The component doesn't use any application state so I build it with what I
 believed to be a nil cursor (om/build notification *nil* {...}). The
 problem is that when the component gets rendered I get a No protocol
 method ICursor.-path defined for type null error.


If you don't pass app state data to this component then you don't need to
bother with build at all. If you need a component that doesn't need app
state but does need component local state you need to use om.core/graft.
Refer to the documentation on om.core/graft and look at the examples in the
repo.

Channels could work. However :shared was also designed with this scenario
in mind, you could use an atom with the message in it and placed it in
:shared if the message is not an important piece of state for the rest of
your application. There are also examples of :shared in the repo as well.

HTH,
David

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


Perfect Functional Shuffle in Clojure

2014-03-20 Thread Peter Brachwitz
I tried to implement perfect functional shuffle in Clojure as outlined in 
http://okmij.org/ftp/Haskell/perfect-shuffle.txt

This is purely for educational purposes as I am learning Clojure (so please 
don't be too hard on me if I did something silly)

The code:
https://github.com/pebrc/ninety-nine-clojure/blob/master/src/ninety_nine_clojure/lists.clj#L267

A related blog post:
http://pbrc.blogspot.com/2014/03/99-clojure-problems-25-generate-random.html

I would be very happy about any feedback/review. If you have a look at the 
blog post you will find a histogram that seems to indicate that my perfect 
functional shuffle is not quite perfect because it is not a uniform 
distribution. That is almost certainly a mistake on my part, again, I would 
be very grateful for any hints.

Cheers,
Peter

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


[ANN] Counterclockwise 0.24.0

2014-03-20 Thread Laurent PETIT
Hello,

New release for Counterclockwise.

With this release of Counterclockwise, Leiningen projects are automatically
started by Leiningen itself. not by some Counterclockwise code trying to
mimic / understand leiningen project.clj.

This means you can Run as  ... and you will get everything running as you
would expect from the command line, should you have issue lein repl.

The standalone product has also been reworked internally to facilitate
upgrades from one version of Counterclockwise/Standalone to the other, even
if Counterclockwise/Standalone gets some major updates such as underlying
Eclipse Platform version, etc.


Whole story in the ChangeLog, as usual.

Install
=

Installation instructions are in the documentation:

http://doc.ccw-ide.org/documentation.html#_install_counterclockwise


Release Note
==

http://doc.ccw-ide.org/ChangeLog.html#_changes_between_counterclockwise_0_23_0_and_0_24_0


Cheers,

-- 
Laurent Petit

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


[ANN] stch.dom 0.1.0 - A new jQuery-like DOM manipulation library for ClojureScript

2014-03-20 Thread david
https://github.com/stch-library/dom

Add the following to your project dependencies to use:

[stch-library/dom 0.1.0]

BTW, I'm currently looking for work as a Clojure developer.  If you like 
what you see, please hit me up.

David

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


Re: local mutable state

2014-03-20 Thread James Trunk
Hi Andy,

I think Mr. Reeves gave you some excellent reasons to avoid using local 
mutable state, especially when trying to learn functional programming. If 
you're interested in seeing a spoiler for 114 you can look at one approach 
below (if you don't want a spoiler, then close this tab post-haste! ;-)

(fn my-take-while [n pred coll]
  (lazy-seq
(let [first-element (first coll)
  n (if (pred first-element) (dec n) n)]
  (when ( n 0)
(cons first-element (my-take-while n pred (rest coll)))

Cheers, 
James

On Thursday, March 20, 2014 8:34:20 PM UTC+1, Andy Smith wrote:


 Is is very bad form to use local mutable state to solve problems like :

 https://www.4clojure.com/problem/114

 i.e. 

 (fn [n f xs] (let [c (atom 0)] (take-while #(if (f %) ( n (swap! c inc)) 
 true) xs)))

 If so, what is the strongest reason to reject this kind of code? Since its 
 a local atom it ought to be thread-safe right?

 Thanks

 Andy


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


Re: [ANN] Eastwood 0.1.1 Clojure lint tool

2014-03-20 Thread Andy Fingerhut
Sean, which version of Eastwood are you using when you see those warnings
about record?  Eastwood output has a line like this near the beginning of
its output that should verify:

== Eastwood 0.1.1 Clojure 1.6.0-master-SNAPSHOT JVM 1.7.0_51

Does your project depend on the clojure.tools.analyzer library, directly or
indirectly?

I just re-checked my test run output, and do not see warning lines like
those in the output, except for Clojure code that specifically defines a
function called 'record?' (e.g. like midje, core.logic, and a few others).
clojure.tools.analyzer latest version no longer does, and Eastwood 0.1.1
does depend on the latest release 0.1.0-beta8 of that lib.

Eastwood 0.1.0 uses an older one that I think would show the warnings you
see.

Andy


On Thu, Mar 20, 2014 at 1:37 PM, Sean Corfield s...@corfield.org wrote:

 Thanx for Eastwood - it's a great tool!

 Just FYI, using Clojure 1.6.0 builds produces these warnings:

 WARNING: record? already refers to: #'clojure.core/record? in namespace:
 clojure.tools.analyzer.utils, being replaced by:
 #'clojure.tools.analyzer.utils/record?
 WARNING: record? already refers to: #'clojure.core/record? in namespace:
 clojure.tools.analyzer, being replaced by:
 #'clojure.tools.analyzer.utils/record?

 We've had to disable :wrong-arity due to our use of java.jdbc / congomongo
 but our code - including all our Expectations tests - is clean of lint
 otherwise!

 Sean

 On Mar 20, 2014, at 8:02 AM, Andy Fingerhut andy.finger...@gmail.com
 wrote:

 Eastwood is a Clojure lint tool.  It analyzes Clojure source code in
 Leiningen projects, reporting things that may be errors.

 Installation instructions are in the documentation here:

 https://github.com/jonase/eastwood/#installation--quick-usage

 The previous release was in January 2014.  Updates since then are
 described in the change log here:


 https://github.com/jonase/eastwood/blob/master/changes.md#changes-from-version-010-to-011

 Probably the most noticeable changes for Eastwood users will be the errors
 if namespace/file name inconsistencies are found, and the reduction in bad
 reflection warnings.

 Below is the description Eastwood from the January 2014 release:

 For example, did you know that if you use clojure.test to write tests, and
 have multiple deftest definitions in the same namespace with the same name,
 then the tests in all but the last deftest will never be run, whether those
 tests would pass or fail?  Eastwood can find those duplicate names, as well
 as other occurrences of the same Var name defined more than once.

 Eastwood can also warn about misplaced doc strings, calling deprecated
 functions or Java methods, expressions that are suspicious because they
 always return the same value (e.g. (= expr) is always true), expressions
 whose return value is not used and appear to have no side effects, and a
 few others.  See the documentation linked above for a complete list.

 Jonas Enlund wrote the original version of Eastwood with the help of
 several other contributors.  Version 0.1.1 is an update by Jonas, Nicola
 Mometto, and myself.  It uses the new Clojure contrib libraries
 tools.reader for reading the code, and tools.analyzer and
 tools.analyzer.jvm for parsing the source into abstract syntax trees,
 making it straightforward to write many of the linters.  Thanks especially
 to Nicola Mometto for tireless enhancements and bug fixes to those
 libraries.

 You can file issues on the Github issue tracker if you encounter problems,
 but please read the Known Issues section of the documentation before
 filing problems.  Several issues have already been discovered, and their
 causes documented, while testing Eastwood on most of the Clojure contrib
 libraries, Clojure itself, and over 35 other open source libraries.

 Go squash some bugs!

 Andy Fingerhut





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


Re: Help a Startup use Clojure!

2014-03-20 Thread Ravindra Jaju
David,

While it is a very detailed and good document, my reaction is that it isn't
an appropriate one for business to make the switch. I suspect they will not
see any value. I'm not sure what background your boss has, but if the
boss isn't into code and only cares about managing the team and the product
and the timelines, this document will not help sell.

I'm in a similar boat, but luckily in a position to drive some change. I'm
the only technical guy (out of 2), but the product was developed for a long
time before I joined (outsourced). It's PHP, and cost and finding people to
do it were the main reasons my partner went that route.

I'm a big fan of Clojure, with little to no Javascript experience. And we
are building (of course) a web application. PHP will not go away any time
soon from our app. So, I'm trying to find the best way to move away from
PHP, and into Clojure-land, but via familiar territory.

Right now, I am building some new features for our Chrome extension, and
need Javascript. Every time I tried doing JS, I would compare (mentally)
with how easy it would be in Clojure. I finally just threw away a big part
of it (a pre-existing version) and started coding it in Clojurescript. It's
just the beginning, but I've seen substantial progress in a single day,
given my JS experience - lack of it. So, this is the way I am going.

[I wrote the above a week ago, and it was in draft]

And just now, we released a chrome extension, with a big chunk written with
clojurescript (and reagent, sablono, storage-atom, and really great help
from weasel). Extremely happy about it, and excited because of the
new-found confidence in being able to do UI.

I feel the safest way to go (with nay-sayers, or hurdles along the way) is
the one-small-step-at-a-time. But I'm just repeating common knowledge,
which is always profound with the benefit of hindsight. :)

My 0.02 is a currency unit of your choice.

Ravindra




On Wed, Mar 12, 2014 at 5:00 PM, da...@dsargeant.com wrote:

 I just spent the day writing this document for my boss, called The case
 for Clojure.  I hope it helps.  We are in exactly the same boat, so it
 should be extremely relevant.

 P.S. If the company I work doesn't make the switch I plan on looking for a
 new position.  So hit me up if you're in need of another Clojure developer.

 David

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


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


How to update an atom return the change?

2014-03-20 Thread Jakub Holy
I have couple of times run into a situation where I want to update a state 
map held in an atom
and return the change, not the new value. I haven't found a good way to do 
it so either I am missing
something obvious or there are more idiomatic ways to achieve what I need. 
Could you advise me?

A concrete example: In ma webapp I want to assign a unique random ID to 
each user. Creating that ID is simple:

(def state (atom {:teams {}}))

;; Remove already used IDs from a lazy seq of random IDs (= unique), take 
the 1st one
(defn unique-rand-id [id-set]
  (first (remove id-set (repeatedly #(rand-int Integer/MAX_VALUE))

;; Add a new team with a unique random ID to the teams map
(defn make-team [teams]
  (let [id (unique-rand-id (set (keys teams)))]
(assoc teams id {})))

;; Create a new team; TODO: How to get the new team's ID?!
(swap! state #(update-in % [:teams] make-team))

So I can generate and remember a new unique random ID but there is no way 
to find out
what ID it was (I cannot just take diff of state before and after since 
other threads could
have also added new IDs to it in the meanwhile.)

Any advice is appreciated. 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/d/optout.


[ANN] stch.html 0.1.0 - A brand new library for HTML generation that supports Clojure and ClojureScript

2014-03-20 Thread david
Announcing stch.html.  A library for HTML generation that supports Clojure 
and ClojureScript.  Based on ideas from Hoplon.  Feedback is welcome.

Full documentation and examples can be found at 
https://github.com/stch-library/html.

Add the following to your project dependencies to use:

[stch-library/html 0.1.0]

Example code:

(defhtml main [users]
  (html5)
  (html
(head
  (title My Page))
(body
  (section
(header
  (h1 Users))
(ul :id users
  (for [x users]
(li x
  (footer Copyright 2014

BTW, I'm currently looking for work as a Clojure developer.  If you like 
what you see, please hit me up.

David

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


Re: Perfect Functional Shuffle in Clojure

2014-03-20 Thread Andy Fingerhut
I haven't read all of your code, but note that the Haskell algorithm says
it takes a sequence of random values where the first is in the range
[0,n-1], the second in the range [0,n-2], third in [0,n-3], etc.  Your
repeatedly call here:


https://github.com/pebrc/ninety-nine-clojure/blob/master/src/ninety_nine_clojure/lists.clj#L273

Is generating a sequence of random values that are all in the range [0,n-1].

A couple of style comments on your function perfect-functional-shuffle:

I find it easier to read when a let or loop has multiple bindings on one
line if it has commas between the symbol value pairs, e.g.:

(loop [bst bst, rnds rnds, acc []]

Clojure treats commas in source code as white space.

The default case in a cond is most often written :else rather than
:otherwise, but both are clear in their meaning and have the same behavior
(i.e. any value there other than nil or false will be treated as true).

I prefer to write two-branch cond statements using if rather than cond.

Andy


On Thu, Mar 20, 2014 at 1:59 PM, Peter Brachwitz
peter.brachw...@gmail.comwrote:

 I tried to implement perfect functional shuffle in Clojure as outlined in
 http://okmij.org/ftp/Haskell/perfect-shuffle.txt

 This is purely for educational purposes as I am learning Clojure (so
 please don't be too hard on me if I did something silly)

 The code:

 https://github.com/pebrc/ninety-nine-clojure/blob/master/src/ninety_nine_clojure/lists.clj#L267

 A related blog post:

 http://pbrc.blogspot.com/2014/03/99-clojure-problems-25-generate-random.html

 I would be very happy about any feedback/review. If you have a look at the
 blog post you will find a histogram that seems to indicate that my perfect
 functional shuffle is not quite perfect because it is not a uniform
 distribution. That is almost certainly a mistake on my part, again, I would
 be very grateful for any hints.

 Cheers,
 Peter

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


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


Re: How to update an atom return the change?

2014-03-20 Thread Stephen Gilardi
There was a stackoverflow question recently that requested a solution for a 
similar problem:

https://stackoverflow.com/questions/22409638/remove-first-item-from-clojure-vector-atom-and-return-it

One solution there is similar to this:

(defn swap*!
  Like swap! but returns a vector of [old-value new-value]
  [atom f  args]
  (loop [old-value @atom]
(let [new-value (apply f old-value args)]
  (if (compare-and-set! atom old-value new-value)
[old-value new-value]
(recur @atom)

This will return the correct old-value and new-value which you can diff.

Another note: 

 (swap! state #(update-in % [:teams] make-team))

can be written more succinctly:

(swap! state update-in [:teams] make-team)

--Steve

On Mar 20, 2014, at 6:28 PM, Jakub Holy jakub.h...@iterate.no wrote:

 I have couple of times run into a situation where I want to update a state 
 map held in an atom
 and return the change, not the new value. I haven't found a good way to do it 
 so either I am missing
 something obvious or there are more idiomatic ways to achieve what I need. 
 Could you advise me?
 
 A concrete example: In ma webapp I want to assign a unique random ID to each 
 user. Creating that ID is simple:
 
 (def state (atom {:teams {}}))
 
 ;; Remove already used IDs from a lazy seq of random IDs (= unique), take 
 the 1st one
 (defn unique-rand-id [id-set]
   (first (remove id-set (repeatedly #(rand-int Integer/MAX_VALUE))
 
 ;; Add a new team with a unique random ID to the teams map
 (defn make-team [teams]
   (let [id (unique-rand-id (set (keys teams)))]
 (assoc teams id {})))
 
 ;; Create a new team; TODO: How to get the new team's ID?!
 (swap! state #(update-in % [:teams] make-team))
 
 So I can generate and remember a new unique random ID but there is no way to 
 find out
 what ID it was (I cannot just take diff of state before and after since other 
 threads could
 have also added new IDs to it in the meanwhile.)
 
 Any advice is appreciated. 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/d/optout.

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


Re: [ANN] Eastwood 0.1.1 Clojure lint tool

2014-03-20 Thread Sean Corfield
On Mar 20, 2014, at 3:07 PM, Andy Fingerhut andy.finger...@gmail.com wrote:
 Sean, which version of Eastwood are you using when you see those warnings 
 about record?  Eastwood output has a line like this near the beginning of its 
 output that should verify:

Ugh! I updated project.clj to use Eastwood 0.1.1 but still had Eastwood 0.1.0 
in my ~/.lein/profiles.clj file which was overriding it. Once I removed that 
old dependency, the warning went away. Thank you!

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)





signature.asc
Description: Message signed with OpenPGP using GPGMail


How did you learn Clojure?

2014-03-20 Thread Marcus Blankenship
Hi Folks,

I'm a post technical PM who's fascinated by Clojure, and want to learn it, but 
am having a hard time without a real project to work on. It's actually 
excited me so much I'm considering hanging up my PM hat and diving back in the 
programmer pool again!

My problem appears to be 1) focus, and 2) fear. Focus because I can't (yet) 
earn a living on a clojure project, so it must be done during off hours. Fear 
because it's harder and more different than the old OO languages I've used in 
the past. 

So I'm curious: how did you learn Clojure well enough to be proficient with it, 
or how are you working on learning it?

Anyone else facing the focus + fear dilemma?

Sent from my iPhone

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


Re: Defining custom tags using hiccup ?

2014-03-20 Thread Carlos Fontes
Hey, I provided it here: [ccfontes/hiccup 1.0.3-custom-tags] so don't 
bother if you didn't do it.
Btw, it's working alright, thanks!

On Thursday, March 20, 2014 8:01:55 PM UTC, Carlos Fontes wrote:

 Dave Sann

 Custom tags are awesome! Just what I was looking for!
 Do you have this anywhere in clojars.org?

 On Thursday, April 25, 2013 10:17:42 AM UTC+1, Dave Sann wrote:

 see this commit for main changes to hiccup


 https://github.com/davesann/hiccup/commit/e8c06d884eb22a2cdd007f880a9dd5e1c13669a4

 On Thursday, 25 April 2013 18:55:52 UTC+10, Dave Sann wrote:

 I replied to this a long time ago and in the original case - I did not 
 see huge value in the suggestion. But recently I wanted to do exactly what 
 Murtaza suggests.

 There are a couple of reasons why I think this capability would be 
 useful. (And rereading Murtaza's email - I think this is what he meant)

 1. The functions defined in hiccup and other libraries are not portable. 
 if you rely on these, they will only work if the library maintained has 
 copied the function interface exactly. This is not always the case. (as a 
 separate comment these utility functions 
 would be better separated from the rendering code).

 2. I would be great to write markup that describes your domain, not HTML 
 so
 [:address :street here :city there]

 rather than [:div lots of html specific bits ... street...]

 3. It would be great to be able to switch the rendering of your domain 
 without editing the overall markup structure.

 4. if webcomponents take off - which I hope they do - you may be able to 
 gracefully transition by disabling the various tag rewriting again, not 
 touching the main markup logic.

 So I had a look to see if this can be done - and it can - relatively 
 easily. 
 I implemented it the easiest way initially - but there are alternative 
 possibilities for how this might work. Currently it uses a multimethod - 
 but it might be better to pass in tag expanding functions when rendering 
 - this would be more flexible.

 The changes to hiccup to achieve this are quite minor.

 See here: https://github.com/davesann/hiccup/commit/custom-tags

 I added a basic repl example file
 https://github.com/davesann/hiccup/blob/custom-tags/repl/example.clj

 A nice thing here is that incompatibilities between hiccup and cljs 
 equivalents could be mitigated if we could agree on a standard for 
 allowing custom tags.

 Thoughts anyone?

 Dave








 On Monday, 14 May 2012 00:31:48 UTC+10, Walter Tetzner wrote:

 You could do this without adding anything to hiccup.

 If you wrote a function that, say, used walk, you could have it go
 through the vectors, and replace the custom tags with what they
 represent. Then you could just call that before calling `html'.

 (html
   (transform
 [:html
   [:head
 [:title some page]]
   [:body
 [:link-to {:url http://www.google.com/} Hi this is 
 Google]]]))

 The benefit to doing it this way over having the macro is that it's
 clear where the custom tags come from when looking at the invocation
 of `html'.

 If you really want `html' to handle it, maybe it could be called with
 a map of tranform functions?

 (html {:link-to link-to}
  [:html
[:head
  [:title some page]]
   [:body
 [:link-to {:url http://www.google.com/} Hi this is Google]]])

 Either way, I think this ends up being nicer than a macro that changes
 the behavior of `html'.


 On Sunday, May 13, 2012 12:35:46 AM UTC-4, Murtaza Husain wrote:




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


Re: How did you learn Clojure?

2014-03-20 Thread blake . watson
I'm learning it now. In my case, we had a single Clojure programmer who's 
leaving and I was volunteered to take his place. =)

So, in this case, fear is very focusing. Heh.

Fun, though. He's been giving lessons and I've been reading books, using 
4Clojure, looking at a variety of different programs (Twitter, asteroids, 
Caves of 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/d/optout.


Re: How did you learn Clojure?

2014-03-20 Thread Marcus Blankenship
Cool, thanks!  Nice to have a project to work on, I'm sure!

Sent from my iPhone

 On Mar 20, 2014, at 6:52 PM, blake.wat...@pnmac.com wrote:
 
 I'm learning it now. In my case, we had a single Clojure programmer who's 
 leaving and I was volunteered to take his place. =)
 
 So, in this case, fear is very focusing. Heh.
 
 Fun, though. He's been giving lessons and I've been reading books, using 
 4Clojure, looking at a variety of different programs (Twitter, asteroids, 
 Caves of 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/d/optout.

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


Re: How did you learn Clojure?

2014-03-20 Thread Alex Miller
Hi Marcus, 

Some great problem sites that can provide opportunities for practice:
- http://clojurescriptkoans.com/ (I think everything here is actually 
Clojure)
- http://4clojure.com - make sure to turn on code golf mode and look at 
others' solutions too
- http://exercism.io - get feedback from others on your solutions
- https://projecteuler.net/
- http://codingforinterviews.com/ - great email series with practice 
problems

Clojure for Web Development from Pragmatic Press is a new Clojure book 
that is a little more focused on a problem domain and build a web app.

Hope that helps...
Alex Miller

On Thursday, March 20, 2014 8:08:41 PM UTC-5, Marcus Blankenship wrote:

 Hi Folks, 

 I'm a post technical PM who's fascinated by Clojure, and want to learn it, 
 but am having a hard time without a real project to work on. It's 
 actually excited me so much I'm considering hanging up my PM hat and diving 
 back in the programmer pool again! 

 My problem appears to be 1) focus, and 2) fear. Focus because I can't 
 (yet) earn a living on a clojure project, so it must be done during off 
 hours. Fear because it's harder and more different than the old OO 
 languages I've used in the past. 

 So I'm curious: how did you learn Clojure well enough to be proficient 
 with it, or how are you working on learning it? 

 Anyone else facing the focus + fear dilemma? 

 Sent from my iPhone

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


Re: Creating multi-module projects with dependencies between modules

2014-03-20 Thread Jim Crossley
Hi again David,

I just released lein-modules 0.2.1 that hopefully addresses your concerns:

1) Dependency symbols in the :versions map are more lenient now. You can 
use either the group id or the artifact id by itself.
2) You exposed a bug where versions for dependencies specified in the 
:inherited profile (or directly on the project) weren't being resolved 
correctly. Fixed now.
3) I updated the README to emphasize the requirement that 'lein modules 
install' must be run before attempting any other task. I confirmed that 
Maven projects work the exact same way.

Thanks for the feedback,
Jim

On Monday, March 17, 2014 11:19:37 PM UTC-4, Dave Kincaid wrote:

 Thanks, I'll try to show you what I have pieced together from your example 
 and the immutant project. Right now I'm just trying to make it work, so I 
 just have a project with 2 modules. There is lambda-common and lambda-etl. 
 lambda-etl should depend on lambda-common. When I run something like lein 
 modules deps or lein modules javac I get the following output:

 Could not find artifact lambda-common-module:lambda-common-module:jar:_ in 
 central (http://repo1.maven.org/maven2/)
 Could not find artifact lambda-common-module:lambda-common-module:jar:_ in 
 clojars (https://clojars.org/repo/)
 This could be due to a typo in :dependencies or network issues.
 If you are behind a proxy, try setting the 'http_proxy' environment 
 variable.
 Error encountered performing task 'deps' with profile(s): 
 'inherited,default'
 Could not resolve dependencies

 Here are the relevant files:

 project.clj in root of project:
 (def version 0.1.0-SNAPSHOT)

 (defproject lambda-clj version
   :description 
   :packaging pom
   :profiles {:dev {:dependencies [[midje/midje _]]}}

   :modules {:inherited
 {:source-paths [src/clj]
  :java-source-paths [src/java]
  :test-paths [test/clj test/java]
  :dependencies [[org.clojure/clojure _]
 [com.taoensso/timbre _]]}

 :versions {org.clojure/clojure 1.5.1
midje/midje 1.6.3
com.taoensso/timbre 3.1.6

:lambda-clj 0.1.0-SNAPSHOT

lambda-common-module :lambda-clj}}

   :codox {:sources [lambda-common/src
 lambda-etl/src]})

 lambda-common module project.clj:
 (def lambda-version 0.1.0-SNAPSHOT)

 (defproject lambda-common-module lambda-version
   :description 
   :parent [lambda-clj _ :relative-path ../pom.xml]
   :dependencies [[org.apache.thrift/libthrift 0.9.0]]
   :thrift-source-path build-support/thrift
   :thrift-java-path src/java
   :thrift-opts beans,hashcode)

 lambda-etl module project.clj:
 (def lambda-version 0.1.0-SNAPSHOT)

 (defproject lambda-etl-module lambda-version
   :description 
   :parent [lambda-clj _ :relative-path ../pom.xml]
   :dependencies [[lambda-common-module _]])

 Thanks for taking a look.

 On Monday, March 17, 2014 10:11:15 PM UTC-5, Jim Crossley wrote:

 Hi Dave,

 Inter-module deps should be supported by lein-modules. I have plenty of 
 them in the immutant source tree. The test-resources dir in the 
 lein-modules source has some examples of parent/child/sibling deps, but 
 they're pretty contrived. If you can describe the structure of your 
 projects or point me to them if public, and tell me what you tried that 
 didn't work, I can try to get you going.

 Jim


 On Mon, Mar 17, 2014 at 10:55 PM, Dave Kincaid kincai...@gmail.comwrote:

 I'm trying to create a project with multiple modules where there are 
 some dependencies between modules. So far I've tried out lein-sub and 
 lein-modules but neither one seems to handle inter-module dependencies 
 (either that or I just can't figure out how to do it). What are people 
 using for projects like this? Any open source examples I could look at?

 Thanks,

 Dave

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




-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this 

Re: How did you learn Clojure?

2014-03-20 Thread Marcus Blankenship
Thanks, Alex!  Is it kosher to post questions about 4Clojure here?  I'm stumped 
on a few, and simply looking up the answer often isn't helpful...  Is there a 
clojure-noobs list?

Sent from my iPhone

 On Mar 20, 2014, at 8:11 PM, Alex Miller a...@puredanger.com wrote:
 
 Hi Marcus, 
 
 Some great problem sites that can provide opportunities for practice:
 - http://clojurescriptkoans.com/ (I think everything here is actually Clojure)
 - http://4clojure.com - make sure to turn on code golf mode and look at 
 others' solutions too
 - http://exercism.io - get feedback from others on your solutions
 - https://projecteuler.net/
 - http://codingforinterviews.com/ - great email series with practice problems
 
 Clojure for Web Development from Pragmatic Press is a new Clojure book that 
 is a little more focused on a problem domain and build a web app.
 
 Hope that helps...
 Alex Miller
 
 On Thursday, March 20, 2014 8:08:41 PM UTC-5, Marcus Blankenship wrote:
 Hi Folks, 
 
 I'm a post technical PM who's fascinated by Clojure, and want to learn it, 
 but am having a hard time without a real project to work on. It's actually 
 excited me so much I'm considering hanging up my PM hat and diving back in 
 the programmer pool again! 
 
 My problem appears to be 1) focus, and 2) fear. Focus because I can't (yet) 
 earn a living on a clojure project, so it must be done during off hours. 
 Fear because it's harder and more different than the old OO languages I've 
 used in the past. 
 
 So I'm curious: how did you learn Clojure well enough to be proficient with 
 it, or how are you working on learning it? 
 
 Anyone else facing the focus + fear dilemma? 
 
 Sent from my iPhone
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

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


Spawn external process and read from output

2014-03-20 Thread gvim
I'm not familiar with the Java standard library and didn't find anything 
matching my question on Google so here goes. From my Clojure app I need 
to call an executable written in C and parse the text output within my 
Clojure app. What's the standard way to call an external process and 
read its output? In Ruby I use:


ext = IO.popen '/path/to/file'
ext.readlines.each {|line| process line}
ext.close


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/d/optout.


Re: How did you learn Clojure?

2014-03-20 Thread Devin Walters
Shameless self-promotion: http://GetClojure.com is something I wrote to 
hopefully help people learn Clojure. One of the primary methods I used for 
learning Clojure was to do problems, like the ones Alex mentioned, read source, 
and ask questions in irc. The last one is important IMO and it's the reason why 
I wanted to make something like GetClojure. The expressions you search for are 
all taken from the irc channel and run through a sandbox so you can see what 
the value and output is. This lets you investigate interesting ways other 
people have chosen to use the language, and saves you some of the back and 
forth you might encounter on irc.

All of that being said, you still need to be able to reason about what you're 
doing, so in general I recommend it as a get unstuck sometimes tool. There 
are some hidden gems in there though, if you go to the last page of results for 
a search term and work backwards. (hint: search for map, go to the last page, 
and work backwards from there for a bit) You can also find interesting 
destructuring examples by searching for 'let AND :or', and so on.

Anyway, hope it's of use to you or anyone else dropping in on this thread.

Happy Clojuring,
'(Devin Walters)

 On Mar 20, 2014, at 22:23, Marcus Blankenship mar...@creoagency.com wrote:
 
 Thanks, Alex!  Is it kosher to post questions about 4Clojure here?  I'm 
 stumped on a few, and simply looking up the answer often isn't helpful...  Is 
 there a clojure-noobs list?
 
 Sent from my iPhone
 
 On Mar 20, 2014, at 8:11 PM, Alex Miller a...@puredanger.com wrote:
 
 Hi Marcus, 
 
 Some great problem sites that can provide opportunities for practice:
 - http://clojurescriptkoans.com/ (I think everything here is actually 
 Clojure)
 - http://4clojure.com - make sure to turn on code golf mode and look at 
 others' solutions too
 - http://exercism.io - get feedback from others on your solutions
 - https://projecteuler.net/
 - http://codingforinterviews.com/ - great email series with practice problems
 
 Clojure for Web Development from Pragmatic Press is a new Clojure book 
 that is a little more focused on a problem domain and build a web app.
 
 Hope that helps...
 Alex Miller
 
 On Thursday, March 20, 2014 8:08:41 PM UTC-5, Marcus Blankenship wrote:
 Hi Folks, 
 
 I'm a post technical PM who's fascinated by Clojure, and want to learn it, 
 but am having a hard time without a real project to work on. It's 
 actually excited me so much I'm considering hanging up my PM hat and diving 
 back in the programmer pool again! 
 
 My problem appears to be 1) focus, and 2) fear. Focus because I can't (yet) 
 earn a living on a clojure project, so it must be done during off hours. 
 Fear because it's harder and more different than the old OO languages I've 
 used in the past. 
 
 So I'm curious: how did you learn Clojure well enough to be proficient with 
 it, or how are you working on learning it? 
 
 Anyone else facing the focus + fear dilemma? 
 
 Sent from my iPhone
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

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