Re: best practices for small RAM usage

2012-10-04 Thread nicolas.o...@gmail.com
You have 2 distinct problems:
 - allocating many short-lived objects. It can affect performance but
does not matter for long-term memory occupation
 - keeping too many things in memory. Then you have to resolve an
algorithmic question, quite independent of
  the technology you use.

On Wed, Oct 3, 2012 at 8:17 PM, Thomas th.vanderv...@gmail.com wrote:
 try and use a 32bit JVM. I found that a 64bit JVM uses almost twice as much
 memory. YMMV

There is a flag for that:
 -XX:+UseCompressedOops

It is enabled by default in Java 6u23 and more recent (including Java
7), when your max heap is less than 32Go.
http://docs.oracle.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html

It uses a 32 bits representation for pointer in a 64 bits VM.

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


Re: performance in versions = 1.4.0

2012-10-04 Thread Karsten Schmidt
Okay, after several hours of more testing  profiling it seems the culprit
is the implementation of (nth) - and IMHO this is quite a biggie:

(use 'macrochrono.core) ; only used for bench macro below

(def t [[0 0] [100 0] [100 100] [[0 0] 1 100]])

(defn foo [[a b c [[dx dy] r x2]] [px py]]
  (let [xx (- dx px) yy (- dy py)]
( (+ (* xx xx) (* yy yy)) r)))

1.3.0

user= (bench 100 (dotimes [i 10] (foo t [i i])))
{:median 12.647, :max 31.255, :min 11.365, :avg 12.731339}

1.4.0:

(bench 100 (dotimes [i 10] (foo t [i i])))
{:median 21.574, :max 32.243, :min 18.031, :avg 22.326779}

1.5.0-master-SNAPSHOT:

(bench 100 (dotimes [i 10] (foo t [i i])))
{:median 21.429, :max 106.704, :min 17.7769997, :avg 22.94385}

VisualVM shows most of the time is spent in calls to nth, which makes sense
since the function makes heavy use of destructuring.

However, could someone please explain why its implementation is now almost
half the speed as compared to 1.3.0? nth is such a fundamental function
that it should not show such degradation in performance. I'm about to dig
through
the commit logs to find out more, but that's gonna take a while and I hope
someone from Clojure/Core can shed some light instead.

Proposals for workarounds are appreciated too (apart from avoiding
destructuring)... Moving  reducing destructuring in the inner (let)
improves it somewhat, but not much and makes the code less legible:

(defn foo2 [t p]
  (let [[d r x2] (t 3)
xx (- (d 0) (p 0)) yy (- (d 0) (p 0))]
( (+ (* xx xx) (* yy yy)) r)))

1.4.0

user= (bench 100 (dotimes [i 10] (foo2 t [i i])))
{:median 17.122, :max 108.78, :min 14.293, :avg 19.7231707}

1.5.0-master-SNAPSHOT

user= (bench 100 (dotimes [i 10] (foo2 t [i i])))
{:median 17.146, :max 93.476999, :min 13.777, :avg
18.9884803}

Many thanks!

K.

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

Re: best practices for small RAM usage

2012-10-04 Thread Niels van Klaveren
You might want to use the -XX:+UseCompressedOops JVM option to compress the 
JVM object pointer size in 64 bits.

On Wednesday, October 3, 2012 9:17:21 PM UTC+2, Thomas wrote:

 try and use a 32bit JVM. I found that a 64bit JVM uses almost twice as 
 much memory. YMMV

 Thomas


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

Re: interleave

2012-10-04 Thread Stathis Sideris
Maybe performance is the reason:

 (time (dotimes [_ 100] (apply mapcat list [[1 2 3] [7 7 7]])))
Elapsed time: 1853.904337 msecs
 (time (dotimes [_ 100] (interleave [1 2 3] [7 7 7])))
Elapsed time: 81.000798 msecs


On Wednesday, 3 October 2012 19:21:37 UTC+1, Marc Dzaebel wrote:

 Thanks for the link! I proposed the change there.

 Am Mittwoch, 3. Oktober 2012 20:06:42 UTC+2 schrieb Andy Fingerhut:

 I don't know the reason for the current implementation rather than your 
 suggested one, but at least on the comment about 0 or 1 arguments has a 
 ticket for it:

 http://dev.clojure.org/jira/browse/CLJ-863



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

Re: performance in versions = 1.4.0

2012-10-04 Thread Ben Smith-Mannschott
nth only promises O(n) performance for all things sequential. However,
the implementation on master in RT.java appears to special case
indexed and random-access collections for faster access, so I'm not
sure why you're seeing such a difference. You could try using get in
place of nth, though from reading the source I'm not sure why it would
produce results that are any different from what you're already
seeing.

The code that looks like it runs when you call nth on a vector has
been in Clojure since:

# commit ff27522840fb3c1681c331ad1fb44a313bd44e0a
# Author: Rich Hickey richhic...@gmail.com
# Date:   2009-05-28 13:42:16 +
#
# first cut of chunked seqs
# Chunked seqs, initial Java-side support

So, I'm not finding any easy explanation for the performance
difference you're seeing.

Color me confused.

// Ben


On Thu, Oct 4, 2012 at 12:33 PM, Karsten Schmidt i...@toxi.co.uk wrote:
 Okay, after several hours of more testing  profiling it seems the culprit
 is the implementation of (nth) - and IMHO this is quite a biggie:

 (use 'macrochrono.core) ; only used for bench macro below

 (def t [[0 0] [100 0] [100 100] [[0 0] 1 100]])

 (defn foo [[a b c [[dx dy] r x2]] [px py]]
   (let [xx (- dx px) yy (- dy py)]
 ( (+ (* xx xx) (* yy yy)) r)))

 1.3.0

 user= (bench 100 (dotimes [i 10] (foo t [i i])))
 {:median 12.647, :max 31.255, :min 11.365, :avg 12.731339}

 1.4.0:

 (bench 100 (dotimes [i 10] (foo t [i i])))
 {:median 21.574, :max 32.243, :min 18.031, :avg 22.326779}

 1.5.0-master-SNAPSHOT:

 (bench 100 (dotimes [i 10] (foo t [i i])))
 {:median 21.429, :max 106.704, :min 17.7769997, :avg 22.94385}

 VisualVM shows most of the time is spent in calls to nth, which makes sense
 since the function makes heavy use of destructuring.

 However, could someone please explain why its implementation is now almost
 half the speed as compared to 1.3.0? nth is such a fundamental function that
 it should not show such degradation in performance. I'm about to dig through
 the commit logs to find out more, but that's gonna take a while and I hope
 someone from Clojure/Core can shed some light instead.

 Proposals for workarounds are appreciated too (apart from avoiding
 destructuring)... Moving  reducing destructuring in the inner (let)
 improves it somewhat, but not much and makes the code less legible:

 (defn foo2 [t p]
   (let [[d r x2] (t 3)
 xx (- (d 0) (p 0)) yy (- (d 0) (p 0))]
 ( (+ (* xx xx) (* yy yy)) r)))

 1.4.0

 user= (bench 100 (dotimes [i 10] (foo2 t [i i])))
 {:median 17.122, :max 108.78, :min 14.293, :avg 19.7231707}

 1.5.0-master-SNAPSHOT

 user= (bench 100 (dotimes [i 10] (foo2 t [i i])))
 {:median 17.146, :max 93.476999, :min 13.777, :avg
 18.9884803}

 Many thanks!

 K.

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

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


Re: Starting a new ClojureScript project, where to start?

2012-10-04 Thread Robert Stuttaford
You might find this quick-start I put together handy:

https://github.com/robert-stuttaford/demo-enfocus-pubsub-remote/

On Friday, September 28, 2012 8:30:12 PM UTC+2, Daniel Glauser wrote:

 Hi folks,

 Where would you point someone if they wanted guidance starting a new 
 ClojureScript project?  I friend who's big into 
 CoffeeScript/Backbone/Require and is looking to kick off a side project 
 with ClojureScript.  He's sold on Clojure but looking for some guidance. 
  We checked out Pinot which is now broken up:
 https://groups.google.com/d/msg/clj-noir/wsCVajG0-YE/CaFa3FTU7B0J

 Are there any sample apps with the new libraries?

 I cruised by ClojureScriptOne which is the most expansive ClojureScript 
 sample I've seen.  The last commit was eight months ago and some of the 
 libs look a bit stale in project.clj. Is ClojureScriptOne still a good 
 sample to point folks at or have things changed significantly?

 On a separate note I finally have Clojure in production!  It's working 
 great and development is moving forward.  It's currently a Noir app. 
  Looking to roll in Friend and Datomic shortly.  From there I hope to 
 publish a sample app, with all these well written disconnected libraries it 
 seems like we could use more examples of how to put them together.  Ping me 
 if you'd like to help.

 If any Clojure folks are coming through Denver and would be willing to 
 lead a topic at the Den of Clojure we would love to have you.  We do accept 
 presenters but encourage folks to focus on leading a topic and keeping the 
 meetings more hands on.
 http://www.meetup.com/Denver-Clojure-Meetup/

 Cheers,
 Daniel


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

Re: interleave

2012-10-04 Thread Mayank Jain
On Thu, Oct 4, 2012 at 4:28 PM, Stathis Sideris side...@gmail.com wrote:

 Maybe performance is the reason:

  (time (dotimes [_ 100] (apply mapcat list [[1 2 3] [7 7 7]])))
 Elapsed time: 1853.904337 msecs
  (time (dotimes [_ 100] (interleave [1 2 3] [7 7 7])))
 Elapsed time: 81.000798 msecs


Wow! That is a huge difference.




 On Wednesday, 3 October 2012 19:21:37 UTC+1, Marc Dzaebel wrote:

 Thanks for the link! I proposed the change there.

 Am Mittwoch, 3. Oktober 2012 20:06:42 UTC+2 schrieb Andy Fingerhut:

 I don't know the reason for the current implementation rather than your
 suggested one, but at least on the comment about 0 or 1 arguments has a
 ticket for it:

 http://dev.clojure.org/jira/**browse/CLJ-863http://dev.clojure.org/jira/browse/CLJ-863

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




-- 
Regards,
Mayank.

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

Re: interleave

2012-10-04 Thread Meikel Brandmeyer (kotarak)
Hi,

you should probably add some dorun somewhere.

Kind regards
Meikel

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

Re: interleave

2012-10-04 Thread Stathis Sideris
You are right, but still:

 (time (dotimes [_ 100] (dorun (apply mapcat list [[1 2 3] [7 7 7]]
Elapsed time: 4177.113292 msecs
 (time (dotimes [_ 100] (dorun (interleave [1 2 3] [7 7 7]
Elapsed time: 1156.658738 msecs

:-)

Stathis

On Thursday, 4 October 2012 14:46:09 UTC+1, Meikel Brandmeyer (kotarak) 
wrote:

 Hi,

 you should probably add some dorun somewhere.

 Kind regards
 Meikel



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

ANN Langohr documentation site

2012-10-04 Thread Michael Klishin
Langohr is a Clojure RabbitMQ client that embraces the AMQP 0.9.1 model.

Langohr is not a new project and not quite ready for 1.0 yet but it is past
most of breaking API changes and the bulk of the docs is
now available at http://clojurerabbitmq.info.

A slightly longer announcement:
http://blog.clojurewerkz.org/blog/2012/10/04/announcing-langohr-documentation-guides/
-- 
MK

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

optimized clojurescript-js file throws exception but debug version does not?

2012-10-04 Thread Andrew
Please see https://github.com/achengs/subpar/issues/1 which links to two 
demo pages. One page uses the debug (non-optimized non-munged) js version 
and seems to work fine. The other uses the optimized version and throws an 
exception. Details are in the github issues page and on the demo pages 
themselves. I'm wondering why they behave differently. Thanks in advance 
for any help!

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

Re: optimized clojurescript-js file throws exception but debug version does not?

2012-10-04 Thread David Nolen
On Thu, Oct 4, 2012 at 12:40 PM, Andrew ache...@gmail.com wrote:

 Please see https://github.com/achengs/subpar/issues/1 which links to two
 demo pages. One page uses the debug (non-optimized non-munged) js version
 and seems to work fine. The other uses the optimized version and throws an
 exception. Details are in the github issues page and on the demo pages
 themselves. I'm wondering why they behave differently. Thanks in advance
 for any help!


There is too much context here. Can you isolate the problem and create a
minimal case? If you can it would be extremely helpful if you could create
an issue in JIRA w/ this information.

Thanks!

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

Noir.response and custom java object

2012-10-04 Thread arekanderu
Hello,

I am not sure if i am supposed to ask a noir-related question in the group 
but the noir issues at github https://github.com/bitwalker/noir is closed 
so i thought someone here might know. I am trying to use a custom 
encoderhttps://github.com/bitwalker/noir/commit/6408d7028cae00937588b599b7c3305bb48e32fdwith
 noir.response but i am failing to understand how.  

This is what I am trying to do which at the moment fails of course:

(ns my-app.views.my-page

   (:require [noir.response :as resp]))


 (defpage /my-page []

   (let [java-object (do-something)]

   (resp/json java-object)))


The error message

Cannot JSON encode object of class: class-name-here - (class 
 org.codehaus.jackson.JsonGenerationException) 

 
It does work however if i use gson http://code.google.com/p/google-gson/ on 
my java-object before i pass it to *resp/json *but i prefer to do it 
without gson. I am pretty sure its possible :)
*
*
Thank you for any replies
 

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

Re: Noir.response and custom java object

2012-10-04 Thread gaz jones
It seems to be using cheshire under the covers, did you add an encoder
for your class? e.g:

(add-encoder java.awt.Color
(fn [c jsonGenerator]
(.writeString jsonGenerator (str c

On Thu, Oct 4, 2012 at 12:04 PM, arekanderu arekand...@gmail.com wrote:
 Hello,

 I am not sure if i am supposed to ask a noir-related question in the group
 but the noir issues at github is closed so i thought someone here might
 know. I am trying to use a custom encoder with noir.response but i am
 failing to understand how.

 This is what I am trying to do which at the moment fails of course:

 (ns my-app.views.my-page

   (:require [noir.response :as resp]))


 (defpage /my-page []

   (let [java-object (do-something)]

   (resp/json java-object)))


 The error message

 Cannot JSON encode object of class: class-name-here - (class
 org.codehaus.jackson.JsonGenerationException)


 It does work however if i use gson on my java-object before i pass it to
 resp/json but i prefer to do it without gson. I am pretty sure its possible
 :)

 Thank you for any replies


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

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


Re: Noir.response and custom java object

2012-10-04 Thread arekanderu
Hi Gaz

That's exactly the part that I can't figure out. Where exactly am I 
supposed to do that? Inside the clj where I am going to use noir.response? 
My apologies if my question seems silly but I am a bit brain-blocked with 
this.

On Thursday, October 4, 2012 8:26:29 PM UTC+3, Gaz wrote:

 It seems to be using cheshire under the covers, did you add an encoder 
 for your class? e.g: 

 (add-encoder java.awt.Color 
 (fn [c jsonGenerator] 
 (.writeString jsonGenerator (str c 

 On Thu, Oct 4, 2012 at 12:04 PM, arekanderu areka...@gmail.comjavascript: 
 wrote: 
  Hello, 
  
  I am not sure if i am supposed to ask a noir-related question in the 
 group 
  but the noir issues at github is closed so i thought someone here might 
  know. I am trying to use a custom encoder with noir.response but i am 
  failing to understand how. 
  
  This is what I am trying to do which at the moment fails of course: 
  
  (ns my-app.views.my-page 
  
(:require [noir.response :as resp])) 
  
  
  (defpage /my-page [] 
  
(let [java-object (do-something)] 
  
(resp/json java-object))) 
  
  
  The error message 
  
  Cannot JSON encode object of class: class-name-here - (class 
  org.codehaus.jackson.JsonGenerationException) 
  
  
  It does work however if i use gson on my java-object before i pass it to 
  resp/json but i prefer to do it without gson. I am pretty sure its 
 possible 
  :) 
  
  Thank you for any replies 
  
  
  -- 
  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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Noir.response and custom java object

2012-10-04 Thread arekanderu
In fact, on the latest commit, 
response.cljhttps://github.com/bitwalker/noir/blob/master/src/noir/response.cljdoes
 not seem to use chesire.custom anymore even though this 
commithttps://github.com/bitwalker/noir/commit/6408d7028cae00937588b599b7c3305bb48e32fdindicates
 otherwise.

On Thursday, October 4, 2012 8:32:25 PM UTC+3, arekanderu wrote:

 Hi Gaz

 That's exactly the part that I can't figure out. Where exactly am I 
 supposed to do that? Inside the clj where I am going to use noir.response? 
 My apologies if my question seems silly but I am a bit brain-blocked with 
 this.

 On Thursday, October 4, 2012 8:26:29 PM UTC+3, Gaz wrote:

 It seems to be using cheshire under the covers, did you add an encoder 
 for your class? e.g: 

 (add-encoder java.awt.Color 
 (fn [c jsonGenerator] 
 (.writeString jsonGenerator (str c 

 On Thu, Oct 4, 2012 at 12:04 PM, arekanderu areka...@gmail.com wrote: 
  Hello, 
  
  I am not sure if i am supposed to ask a noir-related question in the 
 group 
  but the noir issues at github is closed so i thought someone here might 
  know. I am trying to use a custom encoder with noir.response but i am 
  failing to understand how. 
  
  This is what I am trying to do which at the moment fails of course: 
  
  (ns my-app.views.my-page 
  
(:require [noir.response :as resp])) 
  
  
  (defpage /my-page [] 
  
(let [java-object (do-something)] 
  
(resp/json java-object))) 
  
  
  The error message 
  
  Cannot JSON encode object of class: class-name-here - (class 
  org.codehaus.jackson.JsonGenerationException) 
  
  
  It does work however if i use gson on my java-object before i pass it 
 to 
  resp/json but i prefer to do it without gson. I am pretty sure its 
 possible 
  :) 
  
  Thank you for any replies 
  
  
  -- 
  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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Noir.response and custom java object

2012-10-04 Thread arekanderu
OK, the problem is that the custom encoders isn't merged with the master 
tree yet so, you need to download this 
branchhttps://github.com/bitwalker/noir/tree/custom-json-encoding, 
run *lein jar *at the root directory of the project and then use that jar 
file in your project dependencies. I did that by having a local maven 
repohttp://www.pgrs.net/2011/10/30/using-local-jars-with-leiningen/in my 
project

...unfortunately though a bunch of deps are required though or else lein 
run blows up. I am still working on it to see what can i do. What a mess

On Thursday, October 4, 2012 8:54:17 PM UTC+3, arekanderu wrote:

 In fact, on the latest commit, 
 response.cljhttps://github.com/bitwalker/noir/blob/master/src/noir/response.cljdoes
  not seem to use chesire.custom anymore even though this 
 commithttps://github.com/bitwalker/noir/commit/6408d7028cae00937588b599b7c3305bb48e32fdindicates
  otherwise.

 On Thursday, October 4, 2012 8:32:25 PM UTC+3, arekanderu wrote:

 Hi Gaz

 That's exactly the part that I can't figure out. Where exactly am I 
 supposed to do that? Inside the clj where I am going to use noir.response? 
 My apologies if my question seems silly but I am a bit brain-blocked with 
 this.

 On Thursday, October 4, 2012 8:26:29 PM UTC+3, Gaz wrote:

 It seems to be using cheshire under the covers, did you add an encoder 
 for your class? e.g: 

 (add-encoder java.awt.Color 
 (fn [c jsonGenerator] 
 (.writeString jsonGenerator (str c 

 On Thu, Oct 4, 2012 at 12:04 PM, arekanderu areka...@gmail.com wrote: 
  Hello, 
  
  I am not sure if i am supposed to ask a noir-related question in the 
 group 
  but the noir issues at github is closed so i thought someone here 
 might 
  know. I am trying to use a custom encoder with noir.response but i am 
  failing to understand how. 
  
  This is what I am trying to do which at the moment fails of course: 
  
  (ns my-app.views.my-page 
  
(:require [noir.response :as resp])) 
  
  
  (defpage /my-page [] 
  
(let [java-object (do-something)] 
  
(resp/json java-object))) 
  
  
  The error message 
  
  Cannot JSON encode object of class: class-name-here - (class 
  org.codehaus.jackson.JsonGenerationException) 
  
  
  It does work however if i use gson on my java-object before i pass it 
 to 
  resp/json but i prefer to do it without gson. I am pretty sure its 
 possible 
  :) 
  
  Thank you for any replies 
  
  
  -- 
  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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Parallella - The new era of computing?

2012-10-04 Thread Brent Millare
If/when it comes out, it sounds like it will be most easily accessible via 
OpenCL. The architecture sounds similar to cell, have a standard processor 
the OS runs on, then run super computing jobs on all the worker processors.

I'd say the best bet we have to getting clojure in those environments is 
working with the analyzer and compiler developments that were made with 
clojurescript. Then you can emit native code or something a little bit more 
portable. Otherwise, its just basically going to be wrappers over openCL. I 
don't see a future in running jvms on each processor unless the jvm gets 
some builtin support for running threads on the worker processors.

One easy to envision future would be using the reducers library 
abstractions, you could offload this work onto those worker processors.

On Monday, October 1, 2012 8:23:08 AM UTC-4, René Groß wrote:

 Hi,

 Anyone heard of the project 
 Parallellahttp://www.kickstarter.com/projects/adapteva/parallella-a-supercomputer-for-everyone
  
 yet?

 What do you think about it?
 Will it be of any interest for the clojure plattform?


 Kind regards,

 René


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

Re: Noir.response and custom java object

2012-10-04 Thread arekanderu
After adding the dependencies of noir to my own project.clj, everything 
worked fine :)

I hope that noir developers will make it a bit easier soon...

On Thursday, October 4, 2012 9:26:56 PM UTC+3, arekanderu wrote:

 OK, the problem is that the custom encoders isn't merged with the master 
 tree yet so, you need to download this 
 branchhttps://github.com/bitwalker/noir/tree/custom-json-encoding, 
 run *lein jar *at the root directory of the project and then use that jar 
 file in your project dependencies. I did that by having a local maven 
 repohttp://www.pgrs.net/2011/10/30/using-local-jars-with-leiningen/in my 
 project

 ...unfortunately though a bunch of deps are required though or else lein 
 run blows up. I am still working on it to see what can i do. What a mess

 On Thursday, October 4, 2012 8:54:17 PM UTC+3, arekanderu wrote:

 In fact, on the latest commit, 
 response.cljhttps://github.com/bitwalker/noir/blob/master/src/noir/response.cljdoes
  not seem to use chesire.custom anymore even though this 
 commithttps://github.com/bitwalker/noir/commit/6408d7028cae00937588b599b7c3305bb48e32fdindicates
  otherwise.

 On Thursday, October 4, 2012 8:32:25 PM UTC+3, arekanderu wrote:

 Hi Gaz

 That's exactly the part that I can't figure out. Where exactly am I 
 supposed to do that? Inside the clj where I am going to use noir.response? 
 My apologies if my question seems silly but I am a bit brain-blocked 
 with this.

 On Thursday, October 4, 2012 8:26:29 PM UTC+3, Gaz wrote:

 It seems to be using cheshire under the covers, did you add an encoder 
 for your class? e.g: 

 (add-encoder java.awt.Color 
 (fn [c jsonGenerator] 
 (.writeString jsonGenerator (str c 

 On Thu, Oct 4, 2012 at 12:04 PM, arekanderu areka...@gmail.com 
 wrote: 
  Hello, 
  
  I am not sure if i am supposed to ask a noir-related question in the 
 group 
  but the noir issues at github is closed so i thought someone here 
 might 
  know. I am trying to use a custom encoder with noir.response but i am 
  failing to understand how. 
  
  This is what I am trying to do which at the moment fails of course: 
  
  (ns my-app.views.my-page 
  
(:require [noir.response :as resp])) 
  
  
  (defpage /my-page [] 
  
(let [java-object (do-something)] 
  
(resp/json java-object))) 
  
  
  The error message 
  
  Cannot JSON encode object of class: class-name-here - (class 
  org.codehaus.jackson.JsonGenerationException) 
  
  
  It does work however if i use gson on my java-object before i pass it 
 to 
  resp/json but i prefer to do it without gson. I am pretty sure its 
 possible 
  :) 
  
  Thank you for any replies 
  
  
  -- 
  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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Parallella - The new era of computing?

2012-10-04 Thread Timothy Baldridge
The worst part of these sort of designs is the memory limitations. For
instance, modern GPUs can read from GPU memory at about 80GB/sec. However
that's only in some very specific cases. That is, if you have 1024 stream
processors they all must be reading memory in the same pattern. They all
can't be reading from memory at a random location. Doing so drastically
reduces memory performance.

The problem I see with
Parallellahttp://www.kickstarter.com/projects/adapteva/parallella-a-supercomputer-for-everyone
is
that you only have 1GB of memory for 64 processors. So either each
processor will have a small amount of local memory ( 16MB) and access will
be fast.  Or the read speed from shared memory is going to be very slow.
Interesting, yes. Fun to play with? Yes. Capable of actually performing
much actual work, not likely.

Let's remember, a modern i7 chip will probably beat the pants off this
thing GFLOPs wise. And if you need OpenCL and cheap massive
parallelism...why aren't you buying a GeForce 620/630?

Not to mention that their way of selling it as a 13Ghz cpu speaks
something to their lack of knowledge of the problem domain.


Timothy Baldridge

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

Re: Regarding Starting Clojure

2012-10-04 Thread Michael Fogus
 Here's one approach: Make a github of the code and content that runs the 
 site. People fork and make pull requests.

You talked me into it.

https://github.com/fogus/www-readevalprintlove-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


Re: Parallella - The new era of computing?

2012-10-04 Thread Brent Millare
I wouldn't completely discount them yet. First, while absolute performance 
is probably less than i7 in most benchmarks, their main performance metric 
is GFLOPS/watt, not just pure GFLOPS. When you start to include the 
overhead of managing a large system, which includes UPS, heat, and power 
draw, the concept seems more cost competitive. Also, this has applications 
for consumer applications with more compute intensive algorithms, you 
couldn't put an i7 on a phone. Second, not all parallelism tasks run most 
efficiently on GPUs. GPUs get incredible performance but assume very 
predictable memory access patterns. One big limitation of GPUs (at least 
with nvidia) is you can't easily share data between streaming 
multiprocessors (SM) in a coordinated manner (you can within each SM 
though) without going to device memory. Also, the coordination primitives 
for device memory reduce performance dramatically. If you start adding more 
hardware support for more general memory access patterns, the performance 
should improve.

There's a little bit more details of the hardware architecture here:
http://www.adapteva.com/products/silicon-devices/e64g401/

Seems pretty reasonable. Nothing out of the ordinary, they just made 
different decisions on what to prioritize. Just skimming, it looks like you 
should be able to get lower latency between shared data across compute 
nodes when compared to CUDA's architecture.

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

Re: Regarding Starting Clojure

2012-10-04 Thread Brent Millare
lol, That is really awesome!

I'm going to have to really read through the sources now.

On Thursday, October 4, 2012 3:28:41 PM UTC-4, Fogus wrote:

  Here's one approach: Make a github of the code and content that runs the 
 site. People fork and make pull requests. 

 You talked me into it. 

 https://github.com/fogus/www-readevalprintlove-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

Re: Regarding Starting Clojure

2012-10-04 Thread Grant Rettke
I loved Mathematica's documentation that had lovingly maintained
by... in the sidebar or something to that effect. It was really
apparent that the maintainer did lovingly maintain it. Can't seem to
find it at the moment though.

On Thu, Oct 4, 2012 at 2:49 PM, Brent Millare brent.mill...@gmail.com wrote:
 lol, That is really awesome!

 I'm going to have to really read through the sources now.


 On Thursday, October 4, 2012 3:28:41 PM UTC-4, Fogus wrote:

  Here's one approach: Make a github of the code and content that runs the
  site. People fork and make pull requests.

 You talked me into it.

 https://github.com/fogus/www-readevalprintlove-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



-- 
((λ (x) (x x)) (λ (x) (x x)))
http://www.wisdomandwonder.com/
ACM, AMA, COG, IEEE

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


ANN: a Clojure docs site, and github organization

2012-10-04 Thread John Gabriele
Hi all,

I seem to have found myself writing some Clojure docs again. They are
currently hosted at https://github.com/clojuredocs/cds , and are
*currently* on display at
http://www.unexpected-vortices.com/clojure/cds/index.html . Though,
there are plans in the works to render the docs using the same tools
as the Clojurewerks.org docs, rather than my own little
[rippledoc](https://github.com/uvtc/rippledoc) tool that's currently
being used.

The docs are just regular markdown files.

Please see the [Readme](https://github.com/clojuredocs/cds#readme) for
more info, but the main idea is to have a community repository of
Clojure docs. If you can write well, and want to add a doc you've
written, send a pull-request. :)

Note that the repository lives under the new clojuredocs
organization, and not my own username (uvtc). It's certainly intended
to be a community-driven project.

I've already written a few docs (see the ToC), and there are others
who are collaborators but who have not added their docs yet.

---John

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


Re: ANN: a Clojure docs site, and github organization

2012-10-04 Thread Paul deGrandis
This is great to see.  Along side efforts like Fogus' REPL love - 
http://readevalprintlove.fogus.me/ - we're well on our way fixing the 
documentation problems in our community.
I could definitely see something like this migrating into docs.clojure.org 
once it reached maturity.

Huge thanks to everyone involved in these efforts and responding the call 
to action.

Also, thanks to Andy Fingerhut - who patched up the docs on contributing 
and helped to improve the ticket triage process.
And thanks to Stu Halloway for taking some time off list to sort out some 
issues and help push some things forward.

Paul // ohpauleez

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

Re: ANN: a Clojure docs site, and github organization

2012-10-04 Thread Laurent PETIT
2012/10/4 Paul deGrandis paul.degran...@gmail.com

 This is great to see.  Along side efforts like Fogus' REPL love -
 http://readevalprintlove.fogus.me/ - we're well on our way fixing the
 documentation problems in our community.
 I could definitely see something like this migrating into 
 docs.clojure.orgonce it reached maturity.

 Huge thanks to everyone involved in these efforts and responding the call
 to action.


Sorry, I couldn't resist the temptation to remind you of this:
http://www.ted.com/talks/derek_sivers_keep_your_goals_to_yourself.html

Cheers,

-- 
Laurent



 Also, thanks to Andy Fingerhut - who patched up the docs on contributing
 and helped to improve the ticket triage process.
 And thanks to Stu Halloway for taking some time off list to sort out some
 issues and help push some things forward.

 Paul // ohpauleez


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


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

Re: ANN: a Clojure docs site, and github organization

2012-10-04 Thread Bronsa
Starting two different projects at the same time with almost the same
purpose seems a waste of efforts...
Wouldn't it be better for readevalprintlove and clojuredocs to join forces
from the beginning?

2012/10/4 Laurent PETIT laurent.pe...@gmail.com

 2012/10/4 Paul deGrandis paul.degran...@gmail.com

 This is great to see.  Along side efforts like Fogus' REPL love -
 http://readevalprintlove.fogus.me/ - we're well on our way fixing the
 documentation problems in our community.
 I could definitely see something like this migrating into
 docs.clojure.org once it reached maturity.

 Huge thanks to everyone involved in these efforts and responding the call
 to action.


 Sorry, I couldn't resist the temptation to remind you of this:
 http://www.ted.com/talks/derek_sivers_keep_your_goals_to_yourself.html

 Cheers,

 --
 Laurent



 Also, thanks to Andy Fingerhut - who patched up the docs on contributing
 and helped to improve the ticket triage process.
 And thanks to Stu Halloway for taking some time off list to sort out some
 issues and help push some things forward.

 Paul // ohpauleez


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


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


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

Re: Question about sets

2012-10-04 Thread Andy Fingerhut
I just wanted to mention to those interested in the issues raised by this 
thread that a patch for CLJ-1065 was committed to Clojure master today, and is 
part of release clojure-1.5.0-alpha5:

http://dev.clojure.org/jira/browse/CLJ-1065

All of the set and map constructor functions now explicitly allow duplicate set 
elements/map keys.  They handle the duplicates as if by repeated assoc calls, 
and this is mentioned in the doc strings for those functions.

Set and map literals still throw errors if there are duplicate set elements/map 
keys, as was the case before the CLJ-1065 patch was committed.

Andy

On Sep 12, 2012, at 3:22 AM, Rich Hickey wrote:

 
 On Sep 8, 2012, at 7:38 PM, Andy Fingerhut wrote:
 
 Rich:
 
 I'm not sure what you mean by the not-fastest-path possible that exists in 
 today's Clojure code, so if you get a chance, see if the below is what you 
 mean.
 
 As far as I can tell (i.e. putting debug println's in the Java code of 
 RT.map), when someone enters a map literal in, say, a function definition, 
 and all keys *and* values are compile time constants, it calls RT.map() 
 while the function is being compiled, but never again when the function is 
 called.
 
 If I make a similar function with run-time variable keys or values, RT.map() 
 is called every time the function is invoked.  Each of these calls repeats 
 the check that the keys are unique.
 
 Do you mean that you want a new code path where if the keys are compile time 
 constants, but the values are variables at compile-time, then at run time 
 this map should be created with a method that avoids the unnecessary check 
 for unique keys?
 
 
 Exactly.
 
 And by the word restore do you mean to imply that it was this way at one 
 time before?
 
 
 Nope. It was that fast, but did no compile-time checks.
 
 Thanks
 
 Rich
 
 
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

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


Re: ANN: a Clojure docs site, and github organization

2012-10-04 Thread Michael Klishin
2012/10/5 Bronsa brobro...@gmail.com

 Wouldn't it be better for readevalprintlove and clojuredocs to join forces
 from the beginning?


It's not clear what readevalprintlove wants to be. clojuredocs has been
discussed for a while by some people who care
about Clojure documentation. There are pretty specific plans about the
guides and moving clojuredocs.org forward
to 1.4 and (hopefully, at some point) multi-version support. In part the
guides portion of clojuredocs (the organization)
will follow the clojurewerkz.org projects model which is known to work well
and even produced some tools
we can easily reuse and adapt.

readevalprintlove looks like a fancy playground so far.

There are multiple aspects to good documentation, see
http://jacobian.org/writing/great-documentation/
-- 
MK

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

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

Re: Regarding Starting Clojure

2012-10-04 Thread Mayank Jain
On Fri, Oct 5, 2012 at 12:58 AM, Michael Fogus mefo...@gmail.com wrote:

  Here's one approach: Make a github of the code and content that runs the
 site. People fork and make pull requests.

 You talked me into it.

 https://github.com/fogus/www-readevalprintlove-org


Awesome! So beautiful! I can just keep staring at it :)

Can you share what all exactly do we need to add to this site for now?
And how do you think we can go about it?
Thanks :)



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




-- 
Regards,
Mayank.

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

Re: ANN: a Clojure docs site, and github organization

2012-10-04 Thread Paul deGrandis


Sorry, I couldn't resist the temptation to remind you of this: 
 http://www.ted.com/talks/derek_sivers_keep_your_goals_to_yourself.html


 DOh! (and this is one of my favorite TED talks!) 
Indeed, I didn't mean to state what was going to done before it was done - 
just that I was happy to see people pick up the torch.

Regarding REPL Love -
I think the two projects are indeed sufficiently different and I think they 
complement each other quite well.  It actually excites me to see both 
projects happening right now.  It speaks to the character of the 
individuals that make up this community.

Paul

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

Re: Regarding Starting Clojure

2012-10-04 Thread nchurch
Thanks guys!  (And also to the other announcement.)

On Oct 4, 2:07 pm, Mayank Jain firesof...@gmail.com wrote:
 On Fri, Oct 5, 2012 at 12:58 AM, Michael Fogus mefo...@gmail.com wrote:
   Here's one approach: Make a github of the code and content that runs the
  site. People fork and make pull requests.

  You talked me into it.

 https://github.com/fogus/www-readevalprintlove-org

 Awesome! So beautiful! I can just keep staring at it :)

 Can you share what all exactly do we need to add to this site for now?
 And how do you think we can go about it?
 Thanks :)



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

 --
 Regards,
 Mayank.

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


Re: interleave

2012-10-04 Thread Marc Dzaebel
At the end, the problem is apply
(apply + '(1 2 3 4 5 6 7 8 9 10)) is ~60 times slower than  (+ 1 2 3 4 5 6 
7 8 9 10)

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

Re: ANN: a Clojure docs site, and github organization

2012-10-04 Thread Michael Fogus
 readevalprintlove looks like a fancy playground so far.

You say that as if it's a bad thing.  I'm of the opinion that these
kinds of efforts should have a low barrier to contribution and be fun.
It's difficult to motivate people to perform a thankless task, so it
should seem like play as much as possible along the way.

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


Re: ANN: a Clojure docs site, and github organization

2012-10-04 Thread Michael Fogus
 Starting two different projects at the same time with almost the same
 purpose seems a waste of efforts...
 Wouldn't it be better for readevalprintlove and clojuredocs to join forces
 from the beginning?

All information should be freely available, so the sharing aspect is
present from the start.  As for wasted effort I would say that any
effort in this direction is a plus, but your point is valid. We're all
friends right?  It'll work out for the best for Clojure I'm sure.

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


Re: ANN: a Clojure docs site, and github organization

2012-10-04 Thread David Nolen
On Thu, Oct 4, 2012 at 7:48 PM, Michael Fogus mefo...@gmail.com wrote:

  readevalprintlove looks like a fancy playground so far.

 You say that as if it's a bad thing.  I'm of the opinion that these
 kinds of efforts should have a low barrier to contribution and be fun.
 It's difficult to motivate people to perform a thankless task, so it
 should seem like play as much as possible along the way.


+1

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

== is not transitive?

2012-10-04 Thread Ben Wolfson
user [(== 0 0.0) (== 0.0 0.0M) (== 0.0M 0)]
[true true false]
user [(== 0 0.0 0.0M) (== 0 0.0M 0.0) (== 0.0 0 0.0M) (== 0.0 0.0M 0)
(== 0.0M 0.0 0) (== 0.0M 0 0.0)]
[true false false false true false]

-- 
Ben Wolfson
Human kind has used its intelligence to vary the flavour of drinks,
which may be sweet, aromatic, fermented or spirit-based. ... Family
and social life also offer numerous other occasions to consume drinks
for pleasure. [Larousse, Drink entry]

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


Re: Core.logic performance of looping over a list with tabling

2012-10-04 Thread David Nolen
On Mon, Oct 1, 2012 at 9:13 AM, Reinout Stevens reste...@vub.ac.be wrote:

 Hi,


 I quickly changed the code so that the graph structure no longer contains
 the list of nodes, and the same behaviour still persists. For the actual
 implementation I have changed it to a function that returns a list of
 nodes, which can be compared in O(1) instead of looping over the data
 structure, and also here we get the same behaviour.

 Personally, I don't see the difference between calling solve-goal or
 solve-goals, as both should have an equally large table. The recursive step
 of solve-goals shouldn't do anything, as we are only passing a list
 containing a single item. In attachment the updated code (aka: just removed
 the :node key from the graph).


 Thanks for taking your time and looking into this,


 Reinout


Still digging into this. Thanks for running that quick test. You're right,
it is still taking a long time - and nothing even gets added to the goal's
table! So the slowdown is coming from elsewhere ...

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

Re: Core.logic performance of looping over a list with tabling

2012-10-04 Thread David Nolen
On Thu, Oct 4, 2012 at 8:46 PM, David Nolen dnolen.li...@gmail.com wrote:

 On Mon, Oct 1, 2012 at 9:13 AM, Reinout Stevens reste...@vub.ac.bewrote:

 Hi,


 I quickly changed the code so that the graph structure no longer contains
 the list of nodes, and the same behaviour still persists. For the actual
 implementation I have changed it to a function that returns a list of
 nodes, which can be compared in O(1) instead of looping over the data
 structure, and also here we get the same behaviour.

 Personally, I don't see the difference between calling solve-goal or
 solve-goals, as both should have an equally large table. The recursive step
 of solve-goals shouldn't do anything, as we are only passing a list
 containing a single item. In attachment the updated code (aka: just removed
 the :node key from the graph).


 Thanks for taking your time and looking into this,


 Reinout


 Still digging into this. Thanks for running that quick test. You're right,
 it is still taking a long time - and nothing even gets added to the goal's
 table! So the slowdown is coming from elsewhere ...

 David


Oops spoke a bit too soon. The goal table is in fact growing in a very
strange way ...

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

Re: ANN: a Clojure docs site, and github organization

2012-10-04 Thread Grant Rettke
On Thu, Oct 4, 2012 at 6:48 PM, Michael Fogus mefo...@gmail.com wrote:
 readevalprintlove looks like a fancy playground so far.

 You say that as if it's a bad thing.  I'm of the opinion that these
 kinds of efforts should have a low barrier to contribution and be fun.
 It's difficult to motivate people to perform a thankless task, so it
 should seem like play as much as possible along the way.

My co-workers and I were debating this at work the other day. My
worldview is that it takes hard work to learn good things, but at the
same time it can be fun and even brief.  Kent Dybvig's _The Scheme
Programming Language_ is a superb example. The other four developers
said that I'm the 20% and that approach is too pedagogical, that you
need to make everything constant entertainment. _Practical Common
Lisp_ was cited as an example.

I'm just glad there are options.

I'm still looking for Clojure materials that go to this level of detail:

http://docs.racket-lang.org/reference/eval-model.html#(part._module-phase)

Since Clojure is all compiled immediately I assume it doesn't have
phases other than macros compile first.

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


Does anybody hate xml property lists?

2012-10-04 Thread JvJ
I recently began work on a cross-platform game in cocos2d-x with a friend. 
 I am working on windows in visual studio and he is working on mac in 
xcode.  As you can imagine, it's a problem.

One of the problems is that xcode uses the xml property list (plist) format 
to store a lot of data, and there's no good editor on Windows.  The xml 
plist format is SO abysmal that I decided to write a program to convert 
plists to and from clojure data structure literals.  Since plists consist 
mostly of dictionaries (associative maps) and arrays (vectors), it was a 
natural fit for clojure.

Anyways, the program is a whopping 68 lines, and is right here, in case 
anyone wants to check it out: https://github.com/JvJ/Plister

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

Re: == is not transitive?

2012-10-04 Thread JvJ
The only reason for this that I can think of is incomplete rules for 
casting numbers.

On Thursday, 4 October 2012 20:39:05 UTC-4, Ben wrote:

 user [(== 0 0.0) (== 0.0 0.0M) (== 0.0M 0)] 
 [true true false] 
 user [(== 0 0.0 0.0M) (== 0 0.0M 0.0) (== 0.0 0 0.0M) (== 0.0 0.0M 0) 
 (== 0.0M 0.0 0) (== 0.0M 0 0.0)] 
 [true false false false true false] 

 -- 
 Ben Wolfson 
 Human kind has used its intelligence to vary the flavour of drinks, 
 which may be sweet, aromatic, fermented or spirit-based. ... Family 
 and social life also offer numerous other occasions to consume drinks 
 for pleasure. [Larousse, Drink entry] 


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

ANN: core.logic Go solver

2012-10-04 Thread nchurch
Here's a Go solver

code:
https://github.com/nchurch/go/blob/master/src/go/core.clj

README:
https://github.com/nchurch/go

It's a really fun use of core.logic: you can test for pieces being
alive or dead; you can also generate all the boards that make a given
piece alive or dead.  See the README.

There are some issues that I'd like to get input on.  For one thing,
I've used mutual recursion (as the Wiki article on mutual recursion
says, Prolog depends on mutual recursion); I don't see any
straightforward and clean way to eliminate it (you can't just
trampoline).  Probably because of this, you can't generate boards
bigger than 15X15.

Also, there's an interesting discrepancy between generating alive-for
boards and dead-for boards which I don't quite understand; in the case
of dead boards, the unification ends up outputting nil for any piece
that helps kill the piece in question.

OK, I have to stop now: Core.logic is terribly addictive.

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


mapv-in or map-in?

2012-10-04 Thread nchurch
I ended up needing the following utility, modified from the Clojure
source:

(defn mapv-in
  maps f over a nested vector structure
  ([f coll]
(let [f #(if (coll? %)(mapv-in f %)(f %))]
 (- (reduce (fn [v o] (conj! v (f o))) (transient []) coll)
 persistent!

I wrote just as much as I needed.  Has anyone else needed to map some
function over nested structures?  Is there some standard
implementation out there?

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