Re: ANN: Swiss Arrows

2012-04-02 Thread Ambrose Bonnaire-Sergeant
Ha! Love it.

Ambrose

On Mon, Apr 2, 2012 at 1:58 PM, Robert Levy r.p.l...@gmail.com wrote:

 Errata:  I mistakenly referred to The Trystero Furcula by its former
 work-in-progress name (the double furcula).

 Just to be clear, the arrows presently included in the swiss arrows
 collection are:

 - The Diamond Wand
 - The Back Arrow
 - , -:p The Furcula, Parallel Furcula
 - , -:p The Trystero Furcula, Parallel Trystero Furcula
 - , -:p The Diamond Fishing Rod, Parallel Diamond Fishing Rod

 On Mon, Apr 2, 2012 at 1:33 AM, Robert Levy r.p.l...@gmail.com wrote:

 Swiss arrows is a library I wrote today, providing a number of useful
 arrow macros.

- The Diamond Wand: a generalized arrow macro for threading into any
position.
- The Back Arrow: - with its arguments reversed, convenient in some
cases.
- The Furcula / Parallel Furcula: branch the result of an operation
in multiple directions, sequentially or in parallel.
- The Double Furcula / Parallel Furcula, Double-style: the above,
using - instead of -
- The Diamond Fishing Rod / Parallel Diamond Fishing Rod: the above,
using -

 Swiss Arrows is available to try out right now at
 https://github.com/rplevy/swiss-arrows

 Feedback, ideas, and pull requests are of course very welcome.

 Rob


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

Clojure Job in Bellingham/Seattle WA

2012-04-02 Thread David Jagoe
Hi all,

I hope nobody objects to me posting a position here. If so I'd be
happy to become a curator/maintainer of a list similar to
http://python.org/jobs for the clojure community.

I have recently started a business in the states (Bellingham, WA) to
support a long-term contract to build technology for the mineral
exploration industry. I am increasingly relying on Clojure and
currently considering javascript-ClojureScript, C#-ClojureCLR, and
maybe even Python Scripts-ClojurePy. Consequently I am looking to
hire a Clojure programmer. I am an experienced software engineer from
an electrical engineering background and have been using Clojure for 2
years or so. I am looking for an exceptional Clojure programmer or a
programmer who is on their way to becoming one and would like to use
Clojure in a commercial environment.

We are building Business Analytics [1] systems for the mineral
exploration industry. Our stack of technology includes: measurement
systems, electronics, embedded systems, handheld development,
communications (GSM + Satellite), database development (Postgres), web
application (Python Turbogears, moving to Clojure), Linux servers
(hosted on the Rackspace Cloud, managed using Puppet), Amazon web
services, hosted analysis API (Clojure, compojure, hiccup, Incanter,
JFreeChart).

One of my main aims at the moment is to rationalize the technology
stack, and Clojure is a key component of that. I strongly believe that
Clojure will be a key competitive advantage for us for the reasons
that you will already appreciate if you've read this far! There will
be an opportunity and indeed an expectation to contribute back to the
open source community.

I am currently based in the UK and will relocate to Bellingham, WA
later this year. I would prefer to find someone local (maybe in
Seattle) but it is not strictly necessary. Unfortunately I will
require you to be a US citizen because my US visa is contingent on
creating jobs in this US. Also, it is very likely that you will be
required to interface with US customers and that may involve some
travel to client sites.

Please email me off-list if you're interested in talking about the
position. The position will open in the next 1 to 3 months (there are
various things that I need to put in place before hiring someone), and
to begin with I would offer a short-term contract but I am looking for
someone permanent if things work out.


Cheers,
David


[1] footnote: I think Business Intelligence is a ridiculous term for
systems that are merely presenting information to aid human
operators/managers; the term should be reserved for systems that are
making fuzzy decisions in place of human operators.

-- 
David Jagoe

davidja...@gmail.com
+447535268218

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

2012-04-02 Thread David Jagoe
Thank you all for your feedback. I will certainly post in local user
groups and Functional Jobs + Linked In are my next stops.


Cheers,
David

On 30 March 2012 21:49, blcooley blcoo...@gmail.com wrote:


 On Mar 30, 7:35 am, David Jagoe davidja...@gmail.com wrote:
 G'day everyone

 I am increasingly relying on clojure and plan to use clojureclr and
 clojurescript in production too. I will soon need to hire a clojure
 developer and was hoping that someone could suggest a good place to post a
 job ad. I've never seen a job posted here but I would like to reach the
 community.

 Thanks
 David

 In addition to the resources mentioned so far, I'd add
 lispjobs.wordpress.com as a potential place to post. I've seen a few
 Clojure jobs listed there recently.

 Best regards,
 Brian Cooley

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



-- 
David Jagoe

davidja...@gmail.com
+447535268218

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

2012-04-02 Thread Gabriel Pickard
I'm trying to build something related [1]: A temporal- and control-flow
reasoner for software in general. My idea was to tie this into logging or
debugging interfaces.
I would be very, very interested in combining this with source-code
reasoning (which might also profit from some shared higher-level logic),
yet inexperienced.

I started prototyping two days ago, I haven't even gotten around to doing
the temporal- and control logic yet, but already I am bumping up against -
and feeling my way into - questions concerning the design. So if you, David
or someone else knowledgeable were available for brief questioning and
guidance I'd be very grateful.

All the best, Gabe

[1]: Prototyping: https://github.com/werg/herpderp

On Fri, Mar 30, 2012 at 9:58 PM, David Nolen dnolen.li...@gmail.com wrote:

 http://soft.vub.ac.be/SOUL/

 This project is worth looking at for directions that kibit might want to
 go. It's also a good resource for cool ideas on how to leverage core.logic
 - miniKanren was designed from the get go to manipulate Lisp source.

 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

ClojureScript One Debug info

2012-04-02 Thread Pierre-Henry Perret
Hi all, after launching the repl in clj-one I get this st:


Type (go) to launch the development server and setup a browser-connected 
REPL.
Type (dev-server) to launch only the development server.
Type (stop) to stop the running instance server
Type (restart) to restart server

UnsupportedOperationException nth not supported on this type: 
PersistentArrayMap
  clojure.lang.RT.nthFrom (RT.java:846)
clojure.core=
__

I have no idea where it comes from.

Is there a mean to debug that ?
Any idea?

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

2012-04-02 Thread Pierre-Henry Perret
Thanks Pandeiro.
I know how to enable HTML5 app cache.
This problem has disappeared when flushing the cache.
Perhaps It came from another app enabling it...

Le mercredi 28 mars 2012 15:52:45 UTC+2, Murph a écrit :

 I never saw an appcache file automatically generated in ClojureScript
 One, but if you want an example of how to implement serving the cache
 manifest for offline use of your webapp, this repo of mine (branched
 from one master) has one:


 https://github.com/pandeiro/multiedit/blob/multi-edit/src/app/clj/one/sample/dev_server.clj#L83


 On Sun, Mar 25, 2012 at 9:17 AM, Pierre-Henry Perret phper...@gmail.com 
 wrote:
  How to disable/enable the appcache in One ?
 
  This is related to a manifest cache which is present in the root folder 
 of
  the application.
  But in One, it seems to be automatically generated...
 
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with 
 your
  first post.
  To unsubscribe from 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

Update an item from a list of maps in STM transaction

2012-04-02 Thread Marcelo Macedo de Melo Silva
friends,

I have the following situation:

I have a list of maps (obtained from the database with contrib.sql)
which is generated through a FUTURE.

I'm running multiple threads using this same list and need to update
the value of an item inside a STM transaction.

I tried using one FUTURE for a REF but is not working.

Some of you have an idea how I can do this?

I appreciate the 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


function order

2012-04-02 Thread ClusterCat
In search for a Clojure bencode implentation, I found the following 
source code.


(defn- decode-list [stream]
  (loop [result []]
(let [c (char (.read stream))]
  (if (= c \e)
result
(recur (conj result (decode stream (int c

(defn decode [stream  i]
  (let [indicator (if (nil? i) (.read stream) (first i))]
(cond
 (and (= indicator 48)
  (= indicator 57)) (decode-string stream indicator)
  (= (char indicator) \i) (decode-number stream \e)
  (= (char indicator) \l) (decode-list stream)
  (= (char indicator) \d) (decode-map stream

(taken from 
http://nakkaya.com/2009/11/02/decoding-bencoded-streams-in-clojure/)




The example functions do not work for me, because decode tries to call 
decode-list which tries to call decode.

This leads me to the following questions:
1. What is the (technical) reason the compiler can't just look up all 
functions before using them?

2. What is the standard way or best practice to work around such constructs?


Greetings,
Marcel

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: kerodon - a library for interacting/testing html-based ring apps

2012-04-02 Thread Nelson Morris
kerodon is a library for interacting with and testing html-based ring
apps.  It is designed to work with -, and look like interactions a
user would have with a browser.  It is similar in style to capybara.
It does not do any javascript simulation.

https://github.com/xeqi/kerodon

Currently it has functions for following links, filling in form input
fields, attaching files, pressing buttons, and validating form input
fields contents.  I plan to have similar functions for other form
elements in the future.
-
Nelson Morris

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

2012-04-02 Thread Roman Perepelitsa
Looks very nice!

Is the following behavior expected with Clojure 1.3?

user= (- 0 '())
( 0)

user= (- 0 [])
CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
in this context, compiling:(NO_SOURCE_PATH:24)

;; I guess this one is expected, although it would be nice if it worked.
user= (- 0 '(1 (1 )))
(1 (1 ) 0)

Roman Perepelitsa.

2012/4/2 Robert Levy r.p.l...@gmail.com

 Swiss arrows is a library I wrote today, providing a number of useful
 arrow macros.

- The Diamond Wand: a generalized arrow macro for threading into any
position.
- The Back Arrow: - with its arguments reversed, convenient in some
cases.
- The Furcula / Parallel Furcula: branch the result of an operation in
multiple directions, sequentially or in parallel.
- The Double Furcula / Parallel Furcula, Double-style: the above,
using - instead of -
- The Diamond Fishing Rod / Parallel Diamond Fishing Rod: the above,
using -

 Swiss Arrows is available to try out right now at
 https://github.com/rplevy/swiss-arrows

 Feedback, ideas, and pull requests are of course very welcome.

 Rob

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

2012-04-02 Thread Roman Perepelitsa
And a couple more:

user= (- 0 [1  ])
[1 0]

user= (- 0 { 1})
CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
in this context, compiling:(NO_SOURCE_PATH:16)

user= (- 0 {1  2 })
IllegalArgumentException No value supplied for key: 2
 clojure.lang.PersistentHashMap.createWithCheck (PersistentHashMap.java:89)

Roman Perepelitsa.

2012/4/2 Roman Perepelitsa roman.perepeli...@gmail.com

 Looks very nice!

 Is the following behavior expected with Clojure 1.3?

 user= (- 0 '())
 ( 0)

 user= (- 0 [])
 CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
 in this context, compiling:(NO_SOURCE_PATH:24)

 ;; I guess this one is expected, although it would be nice if it worked.
 user= (- 0 '(1 (1 )))
 (1 (1 ) 0)

 Roman Perepelitsa.

 2012/4/2 Robert Levy r.p.l...@gmail.com

 Swiss arrows is a library I wrote today, providing a number of useful
 arrow macros.

- The Diamond Wand: a generalized arrow macro for threading into any
position.
- The Back Arrow: - with its arguments reversed, convenient in some
cases.
- The Furcula / Parallel Furcula: branch the result of an operation
in multiple directions, sequentially or in parallel.
- The Double Furcula / Parallel Furcula, Double-style: the above,
using - instead of -
- The Diamond Fishing Rod / Parallel Diamond Fishing Rod: the above,
using -

 Swiss Arrows is available to try out right now at
 https://github.com/rplevy/swiss-arrows

 Feedback, ideas, and pull requests are of course very welcome.

 Rob

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

[ANN] lein-deps-tree 0.1.0

2012-04-02 Thread Moritz Ulrich
I'm happy to announce the first release of lein-deps-tree[1].

It's a leiningen plugin which prints the all dependencies of a project
as a nicely formatted tree.


Please report any issues (especially with leiningen 1.x) as Github issues.


[1]: https://github.com/the-kenny/lein-deps-tree

Cheers,
Moritz

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

2012-04-02 Thread Sun Ning

lein2 has a built-in command: `lein deps :tree` for this task
it would be great to have the plugin in lein 1.x
But I got error below:

Exception in thread main java.io.FileNotFoundException: Could not 
locate leiningen/core/classpath__init.class or 
leiningen/core/classpath.clj on classpath:  (deps_tree.clj:1)


On Mon 02 Apr 2012 08:39:34 PM CST, Moritz Ulrich wrote:

I'm happy to announce the first release of lein-deps-tree[1].

It's a leiningen plugin which prints the all dependencies of a project
as a nicely formatted tree.


Please report any issues (especially with leiningen 1.x) as Github issues.


[1]: https://github.com/the-kenny/lein-deps-tree

Cheers,
Moritz



--
Sun Ning
Software developer
Nanjing, China (N32°3'42'' E118°46'40'')
http://about.me/sunng/bio

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

2012-04-02 Thread Alex Baranosky
The Parallel Furcula has interesting possibilities :)

On Mon, Apr 2, 2012 at 5:25 AM, Roman Perepelitsa 
roman.perepeli...@gmail.com wrote:

 And a couple more:

 user= (- 0 [1  ])
 [1 0]

 user= (- 0 { 1})
 CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
 in this context, compiling:(NO_SOURCE_PATH:16)

 user= (- 0 {1  2 })
 IllegalArgumentException No value supplied for key: 2
  clojure.lang.PersistentHashMap.createWithCheck (PersistentHashMap.java:89)

 Roman Perepelitsa.

 2012/4/2 Roman Perepelitsa roman.perepeli...@gmail.com

 Looks very nice!

 Is the following behavior expected with Clojure 1.3?

 user= (- 0 '())
 ( 0)

 user= (- 0 [])
 CompilerException java.lang.RuntimeException: Unable to resolve symbol:
  in this context, compiling:(NO_SOURCE_PATH:24)

 ;; I guess this one is expected, although it would be nice if it worked.
 user= (- 0 '(1 (1 )))
 (1 (1 ) 0)

 Roman Perepelitsa.

 2012/4/2 Robert Levy r.p.l...@gmail.com

 Swiss arrows is a library I wrote today, providing a number of useful
 arrow macros.

- The Diamond Wand: a generalized arrow macro for threading into any
position.
- The Back Arrow: - with its arguments reversed, convenient in
some cases.
- The Furcula / Parallel Furcula: branch the result of an operation
in multiple directions, sequentially or in parallel.
- The Double Furcula / Parallel Furcula, Double-style: the above,
using - instead of -
- The Diamond Fishing Rod / Parallel Diamond Fishing Rod: the above,
using -

 Swiss Arrows is available to try out right now at
 https://github.com/rplevy/swiss-arrows

 Feedback, ideas, and pull requests are of course very welcome.

 Rob

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

2012-04-02 Thread Robert Levy
Thank you for finding these anomolies!


 user= (- 0 [1  ])
 [1 0]


This case is undefined behavior because only one  point is allowed.



 user= (- 0 {1  2 })
 IllegalArgumentException No value supplied for key: 2
  clojure.lang.PersistentHashMap.createWithCheck (PersistentHashMap.java:89)


Again, only one  point is allowed.  So undefined behavior is expected
behavior in that case.



 user= (- 0 { 1})
 CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
 in this context, compiling:(NO_SOURCE_PATH:16)


This is an interesting use case I hadn't considered.  I will play around a
bit with that and try to find out why it doesn't just work.

user= (- 0 '())
 ( 0)


user= (- 0 [])
 CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
 in this context, compiling:(NO_SOURCE_PATH:24)


These two are an interesting case that *should* be valid (I know why this
one wouldn't work because of how I wrote it, easily fixable).  I just
hadn't thought of that.

;; I guess this one is expected, although it would be nice if it worked.

user= (- 0 '(1 (1 )))
 (1 (1 ) 0)


This is invalid.  I guess it would be nice but walking the form would
complicate matters. :)

Thanks again for finding the two issues mentioned above!

Rob

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

ClojureScript Debug

2012-04-02 Thread Pierre-Henry Perret
The following clojurescript  code :
code(def *peers* (agent {}))/code

compiles to this js code:
codeone.peer.peer._STAR_peers_STAR_ = one.peer.peer.agent.call(null,cljs.
core.ObjMap.fromObject([],{}));/code

which throws 
_

   1. Uncaught TypeError: Cannot call method 'call' of undefined
  1. (anonymous function)
  __
  
  The question is why ? Are agent supported by the compiler ?
  
  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

ClojureScript release 0.0-1011

2012-04-02 Thread Stuart Sierra
Just built, will hit Maven repos within 24 hours.

http://build.clojure.org/job/clojurescript-release/10/

The last release had some bugs that broke the browser-connected REPL. That 
has been fixed in this release.

-S

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

Re: ClojureScript Debug

2012-04-02 Thread Moritz Ulrich
See [1]: Agents are currently not implemented

They wouldn't be very useful, as javascript is single threaded in most
implementations.

[1]: https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure

On Mon, Apr 2, 2012 at 14:56, Pierre-Henry Perret phper...@gmail.com wrote:
 The following clojurescript  code :
 code(def *peers* (agent {}))/code

 compiles to this js code:
 codeone.peer.peer._STAR_peers_STAR_ =
 one.peer.peer.agent.call(null,cljs.core.ObjMap.fromObject([],{}));/code

 which throws
 _

 Uncaught TypeError: Cannot call method 'call' of undefined

 (anonymous function)
 __

 The question is why ? Are agent supported by the compiler ?

 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



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


Re: ClojureScript Debug

2012-04-02 Thread Jim - FooBar();

I don't think any of the concurrency primitives made it to clojureScript...


On 02/04/12 14:54, Moritz Ulrich wrote:

See [1]: Agents are currently not implemented

They wouldn't be very useful, as javascript is single threaded in most
implementations.

[1]: https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure

On Mon, Apr 2, 2012 at 14:56, Pierre-Henry Perretphper...@gmail.com  wrote:

The following clojurescript  code :
code(def *peers* (agent {}))/code

compiles to this js code:
codeone.peer.peer._STAR_peers_STAR_ =
one.peer.peer.agent.call(null,cljs.core.ObjMap.fromObject([],{}));/code

which throws
_

Uncaught TypeError: Cannot call method 'call' of undefined

(anonymous function)
__

The question is why ? Are agent supported by the compiler ?

Thanks

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





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


Re: ClojureScript Debug

2012-04-02 Thread Jim - FooBar();

except for atoms of course...

On 02/04/12 14:55, Jim - FooBar(); wrote:
I don't think any of the concurrency primitives made it to 
clojureScript...



On 02/04/12 14:54, Moritz Ulrich wrote:

See [1]: Agents are currently not implemented

They wouldn't be very useful, as javascript is single threaded in most
implementations.

[1]: 
https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure


On Mon, Apr 2, 2012 at 14:56, Pierre-Henry 
Perretphper...@gmail.com  wrote:

The following clojurescript  code :
code(def *peers* (agent {}))/code

compiles to this js code:
codeone.peer.peer._STAR_peers_STAR_ =
one.peer.peer.agent.call(null,cljs.core.ObjMap.fromObject([],{}));/code 



which throws
_

Uncaught TypeError: Cannot call method 'call' of undefined

(anonymous function)
__

The question is why ? Are agent supported by the compiler ?

Thanks

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

first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en







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


how to write a macro that calls defrecord?

2012-04-02 Thread Joachim De Beule
Hi All,

I need to define a number of similar records, so I wanted to write a macro
for that, but I do not know how. Basically, I tried the following:

(defprotocol MyProtocol (do-something [this]))

(defmacro my-defrecord [name [ fields]  body]
  `(defrecord ~name ~fields
 MyProtocol
 (do-something [this] this)
 ~@body))

But then when I call

(my-defrecord R [content]),

which expands into the following (valid) code:

(defrecord R (content) tmp-protocol (do-sth [this] this)),

Then I get the RunTimeException No such var: this? Any ideas?

Best, Joachim.

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

Re: ClojureScript One Debug info

2012-04-02 Thread David Nolen
Remove all generated JS as well as the invisible  .repl folders. Does the
problem still persist?

On Saturday, March 31, 2012, Pierre-Henry Perret wrote:

 Hi all, after launching the repl in clj-one I get this st:

 
 Type (go) to launch the development server and setup a browser-connected
 REPL.
 Type (dev-server) to launch only the development server.
 Type (stop) to stop the running instance server
 Type (restart) to restart server

 UnsupportedOperationException nth not supported on this type:
 PersistentArrayMap
   clojure.lang.RT.nthFrom (RT.java:846)
 clojure.core=
 __

 I have no idea where it comes from.

 Is there a mean to debug that ?
 Any idea?

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

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

Re: ClojureScript One Debug info

2012-04-02 Thread Pierre-Henry Perret
That solved it!
Thanks

Le lundi 2 avril 2012 16:26:08 UTC+2, David Nolen a écrit :

 Remove all generated JS as well as the invisible  .repl folders. Does the 
 problem still persist?

 On Saturday, March 31, 2012, Pierre-Henry Perret wrote:

 Hi all, after launching the repl in clj-one I get this st:

 
 Type (go) to launch the development server and setup a browser-connected 
 REPL.
 Type (dev-server) to launch only the development server.
 Type (stop) to stop the running instance server
 Type (restart) to restart server

 UnsupportedOperationException nth not supported on this type: 
 PersistentArrayMap
   clojure.lang.RT.nthFrom (RT.java:846)
 clojure.core=
 __

 I have no idea where it comes from.

 Is there a mean to debug that ?
 Any idea?

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

2012-04-02 Thread Paul deGrandis
Great work all around!  It's exciting to see Kibit get so much use.

Paul

On Apr 1, 2:29 pm, Jonas jonas.enl...@gmail.com wrote:
 I'm happy to announce the release of kibit[1] version 0.0.3. New in this
 release include:

 * much better reporting
 * a more advanced rule system
 * more rules
 * bug fixes

 Thanks to all who have contributed!

 Jonas

 [1]https://github.com/jonase/kibit

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: kerodon - a library for interacting/testing html-based ring apps

2012-04-02 Thread Shantanu Kumar
Thanks for the project – looks pretty cool. Will try it out.

Shantanu

On Apr 2, 9:19 am, Nelson Morris nmor...@nelsonmorris.net wrote:
 kerodon is a library for interacting with and testing html-based ring
 apps.  It is designed to work with -, and look like interactions a
 user would have with a browser.  It is similar in style to capybara.
 It does not do any javascript simulation.

 https://github.com/xeqi/kerodon

 Currently it has functions for following links, filling in form input
 fields, attaching files, pressing buttons, and validating form input
 fields contents.  I plan to have similar functions for other form
 elements in the future.
 -
 Nelson Morris

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

2012-04-02 Thread Herwig Hochleitner
You need to be careful when using syntax-quote (backtick `):
It tries to resolve every symbol it encloses, as the compiler would:
If it's use'd, the symbol is qualified with the origin ns, otherwise
with the current ns (current during read time of the syntax-quote
form, i.e. macro _definition_ time). That's basically the magic that
allows us to have a lisp-1 and still not need to declare functions as
available during compilation or other idiosyncrasies of some scheme
implementations.

Regardless, to introduce a lexical binding in macro expansion code, we
need to make sure that the introduced name never clashes with
macro-user code, a concept known as macro hygiene. The way to do that
in clojure are (auto-)gensyms.
e.g. (defmacro x [of] `(let [name# (expr ..)] (usage ~of name#))
when you try `(let [name (expr)] ...) the compiler complains Cannot
let qualified name current-ns/name. That's because name got
namespace-qualified, and subsequently can't be let.

In your case, the actual expansion is: (defrecord ... (do-sth
[some-ns/this] some-ns/this), you can check that with (macroexpand
'(my-defrecord R [content])), btw.
In case of a protocol function, the introduction of a ns-qualified
local only seems to be caught in the body (ticket?). I guess that's
because the parameter gets name-mangled.

Anyways, fix is to always use auto-gensyms when introducing lexical
bindings in a macro:

(defmacro my-defrecord [name [ fields]  body]
  `(defrecord ~name ~fields
 MyProtocol
 (do-something [this#] this#)
 ~@body))

If you ever _really_ need to introduce a verbatim name in macro code
(magic names, like 'this' in java, e.g.) you can use

(defmacro my-defrecord [name [ fields]  body]
  `(defrecord ~name ~fields
 MyProtocol
 (do-something [~'this] ~'this)
 ~@body))

Don't do this.

kind regards

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

2012-04-02 Thread Mark
Have you thought about a downloadable plugin system for rules?  I imagine 
various libraries embedding rule sets in jar files with magic manifest 
markers indicating their specific location.  Something like:
Kibit-RuleSet-URL: jar:///kibit/ruleset.clj
or, online:
Kibit-RuleSet-URL: https://github.com/addleman/
or, if we wanted to get really fancy:
Kibit-RuleSet-URL: mavenrepo://...  (is there a URL format for maven repo?)

On Monday, April 2, 2012 7:53:46 AM UTC-7, Paul deGrandis wrote:

 Great work all around!  It's exciting to see Kibit get so much use. 

 Paul 

 On Apr 1, 2:29 pm, Jonas jonas.enl...@gmail.com wrote: 
  I'm happy to announce the release of kibit[1] version 0.0.3. New in this 
  release include: 
  
  * much better reporting 
  * a more advanced rule system 
  * more rules 
  * bug fixes 
  
  Thanks to all who have contributed! 
  
  Jonas 
  
  [1]https://github.com/jonase/kibit

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

2012-04-02 Thread David Nolen
On Fri, Mar 30, 2012 at 8:20 PM, Gabriel Pickard wergo...@googlemail.comwrote:

 I'm trying to build something related [1]: A temporal- and control-flow
 reasoner for software in general. My idea was to tie this into logging or
 debugging interfaces.
 I would be very, very interested in combining this with source-code
 reasoning (which might also profit from some shared higher-level logic),
 yet inexperienced.


Inexperienced as well :) Hopefully enthusiasm counts for something. I see
that you're a Prolog programmer - have you done something like this before
in Prolog?

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: Need help to find a bug in a genetic algorithm

2012-04-02 Thread Jim - FooBar();
Is it possible to explain briefly what this genetic algorithm tries to 
accomplish? I mean what problem is it producing solution for? It never 
seems to end regardless of number-of-domiciles!
I think i got a glimpse of a ThursdayGNEXT string but i'm not sure 
what it means...


Jim

On 26/03/12 09:47, Marcus Lindner wrote:

Thanks for the answer.

Yes, the number of domicles was the problem.
When I use one or two domiciles the population remains relativ stable. 
If I use 3 or more, then the population is increasing.


Is it a good idea to add some helpers for the grimreaper if the 
population grows too fast?


Marcus


2012/3/26 Stefan Kamphausen ska2...@googlemail.com 
mailto:ska2...@googlemail.com


Hi,


 For my little project I wanted to reprogramm the gentic
algorithm from
 the book Clojure written by Stefan Kamphausen and Tim Oliver
Kaiser.

quickly glancing at the code, it looks like a valid translation
into English.

Did you try to tune number-of-domiciles?  Depending on your
machine it may be necessary to decrease the number of creators so
that the population doesn't grow.  In this simulation the
grimreaper has a hard time working against the birth-rate. ;-)

Feel free to get in contact with me via e-mail[1] if your problem
persists.

Kind regards,
Stefan

[1]  (apply str (reverse [de \. clojure-buch (str ska@)]))



-- 
You received this message because you are subscribed to the Google

Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
mailto:clojure@googlegroups.com
Note that posts from new members are moderated - please be patient
with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
mailto:clojure%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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

To unsubscribe from 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: Need help to find a bug in a genetic algorithm

2012-04-02 Thread Goldritter
First there is an error in my code :(

These are the allowed symbols from which the creator function can
choose to create or mutate a gen:
def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü
 ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ))

This is the targetd which should be fulfilled:
(def the_target Thursday Next)

The first error is, that in the allowed symbols the Space (' ') is
missing. So without this symbol/character the algorithm has no chance
to finish.

The correct definition for the symbols are (with the missing space):

def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü 
 ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ ))


So the algorithm tries to design the String Thursday Next by
exploring many possible variations and to get as near as possible to
the solution Thursday Next.

The main purpose of this algorithm, I think, is to show how you can
use agents and atoms to implement a genetic algorithm.

On Apr 2, 7:59 pm, Jim - FooBar(); jimpil1...@gmail.com wrote:
 Is it possible to explain briefly what this genetic algorithm tries to
 accomplish? I mean what problem is it producing solution for? It never
 seems to end regardless of number-of-domiciles!
 I think i got a glimpse of a ThursdayGNEXT string but i'm not sure
 what it means...

 Jim

 On 26/03/12 09:47, Marcus Lindner wrote:







  Thanks for the answer.

  Yes, the number of domicles was the problem.
  When I use one or two domiciles the population remains relativ stable.
  If I use 3 or more, then the population is increasing.

  Is it a good idea to add some helpers for the grimreaper if the
  population grows too fast?

  Marcus

  2012/3/26 Stefan Kamphausen ska2...@googlemail.com
  mailto:ska2...@googlemail.com

      Hi,

       For my little project I wanted to reprogramm the gentic
      algorithm from
       the book Clojure written by Stefan Kamphausen and Tim Oliver
      Kaiser.

      quickly glancing at the code, it looks like a valid translation
      into English.

      Did you try to tune number-of-domiciles?  Depending on your
      machine it may be necessary to decrease the number of creators so
      that the population doesn't grow.  In this simulation the
      grimreaper has a hard time working against the birth-rate. ;-)

      Feel free to get in contact with me via e-mail[1] if your problem
      persists.

      Kind regards,
      Stefan

      [1]  (apply str (reverse [de \. clojure-buch (str ska@)]))

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

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

2012-04-02 Thread Jim - FooBar();

aa ok i see, that makes perfect sense... thanks a lot!

Jim

On 02/04/12 19:06, Goldritter wrote:

First there is an error in my code :(

These are the allowed symbols from which the creator function can
choose to create or mutate a gen:
def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü
  ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ))

This is the targetd which should be fulfilled:
(def the_target Thursday Next)

The first error is, that in the allowed symbols the Space (' ') is
missing. So without this symbol/character the algorithm has no chance
to finish.

The correct definition for the symbols are (with the missing space):

def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü 
  ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ ))


So the algorithm tries to design the String Thursday Next by
exploring many possible variations and to get as near as possible to
the solution Thursday Next.

The main purpose of this algorithm, I think, is to show how you can
use agents and atoms to implement a genetic algorithm.

On Apr 2, 7:59 pm, Jim - FooBar();jimpil1...@gmail.com  wrote:

Is it possible to explain briefly what this genetic algorithm tries to
accomplish? I mean what problem is it producing solution for? It never
seems to end regardless of number-of-domiciles!
I think i got a glimpse of a ThursdayGNEXT string but i'm not sure
what it means...

Jim

On 26/03/12 09:47, Marcus Lindner wrote:








Thanks for the answer.
Yes, the number of domicles was the problem.
When I use one or two domiciles the population remains relativ stable.
If I use 3 or more, then the population is increasing.
Is it a good idea to add some helpers for the grimreaper if the
population grows too fast?
Marcus
2012/3/26 Stefan Kamphausenska2...@googlemail.com
mailto:ska2...@googlemail.com
 Hi,
   For my little project I wanted to reprogramm the gentic
 algorithm from
   the book Clojure written by Stefan Kamphausen and Tim Oliver
 Kaiser.
 quickly glancing at the code, it looks like a valid translation
 into English.
 Did you try to tune number-of-domiciles?  Depending on your
 machine it may be necessary to decrease the number of creators so
 that the population doesn't grow.  In this simulation the
 grimreaper has a hard time working against the birth-rate. ;-)
 Feel free to get in contact with me via e-mail[1] if your problem
 persists.
 Kind regards,
 Stefan
 [1]  (apply str (reverse [de \. clojure-buch (str ska@)]))
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 mailto:clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient
 with your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 mailto:clojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient
with your first post.
To unsubscribe from 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: Need help to find a bug in a genetic algorithm

2012-04-02 Thread Jim - FooBar();

Shouldn't the line (inside start-evolution) :

*(map #(send % a-day-in-the-life-agent-fn) domiciles)
*
be:

*(pmap #(send % a-day-in-the-life-agent-fn) domiciles)* ???

why does it need to happen serially?

Jim

On 02/04/12 19:06, Goldritter wrote:

First there is an error in my code :(

These are the allowed symbols from which the creator function can
choose to create or mutate a gen:
def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü
  ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ))

This is the targetd which should be fulfilled:
(def the_target Thursday Next)

The first error is, that in the allowed symbols the Space (' ') is
missing. So without this symbol/character the algorithm has no chance
to finish.

The correct definition for the symbols are (with the missing space):

def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü 
  ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ ))


So the algorithm tries to design the String Thursday Next by
exploring many possible variations and to get as near as possible to
the solution Thursday Next.

The main purpose of this algorithm, I think, is to show how you can
use agents and atoms to implement a genetic algorithm.

On Apr 2, 7:59 pm, Jim - FooBar();jimpil1...@gmail.com  wrote:

Is it possible to explain briefly what this genetic algorithm tries to
accomplish? I mean what problem is it producing solution for? It never
seems to end regardless of number-of-domiciles!
I think i got a glimpse of a ThursdayGNEXT string but i'm not sure
what it means...

Jim

On 26/03/12 09:47, Marcus Lindner wrote:








Thanks for the answer.
Yes, the number of domicles was the problem.
When I use one or two domiciles the population remains relativ stable.
If I use 3 or more, then the population is increasing.
Is it a good idea to add some helpers for the grimreaper if the
population grows too fast?
Marcus
2012/3/26 Stefan Kamphausenska2...@googlemail.com
mailto:ska2...@googlemail.com
 Hi,
   For my little project I wanted to reprogramm the gentic
 algorithm from
   the book Clojure written by Stefan Kamphausen and Tim Oliver
 Kaiser.
 quickly glancing at the code, it looks like a valid translation
 into English.
 Did you try to tune number-of-domiciles?  Depending on your
 machine it may be necessary to decrease the number of creators so
 that the population doesn't grow.  In this simulation the
 grimreaper has a hard time working against the birth-rate. ;-)
 Feel free to get in contact with me via e-mail[1] if your problem
 persists.
 Kind regards,
 Stefan
 [1]  (apply str (reverse [de \. clojure-buch (str ska@)]))
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 mailto:clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient
 with your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 mailto:clojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient
with your first post.
To unsubscribe from 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

(constantly)

2012-04-02 Thread Jay Fields
I often tend to define the following in my apps

(def no-op (fn [ _]))

The other day I noticed constantly
(http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/constantly),
which is basically the same thing - except I would have to say
(constantly nil). What do you all think about allowing constantly to
take no args and constantly return nil?

Or, is there another function that does that and I've just overlooked it?

Cheers, Jay

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

2012-04-02 Thread Jim - FooBar();
The onle setup that works for my machine (the one that finds the 
solution in reasonable time) is with number-of-domiciles = 3, the 
missing space and using pmap instead of map when evolution starts...the 
population size moves from around 1180  to 1230 but i can see all 4 
cores of mine firing up and i get the solution in time (roughly 40sec)!!!


Jim


On 02/04/12 19:06, Goldritter wrote:

First there is an error in my code :(

These are the allowed symbols from which the creator function can
choose to create or mutate a gen:
def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü
  ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ))

This is the targetd which should be fulfilled:
(def the_target Thursday Next)

The first error is, that in the allowed symbols the Space (' ') is
missing. So without this symbol/character the algorithm has no chance
to finish.

The correct definition for the symbols are (with the missing space):

def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü 
  ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ ))


So the algorithm tries to design the String Thursday Next by
exploring many possible variations and to get as near as possible to
the solution Thursday Next.

The main purpose of this algorithm, I think, is to show how you can
use agents and atoms to implement a genetic algorithm.

On Apr 2, 7:59 pm, Jim - FooBar();jimpil1...@gmail.com  wrote:

Is it possible to explain briefly what this genetic algorithm tries to
accomplish? I mean what problem is it producing solution for? It never
seems to end regardless of number-of-domiciles!
I think i got a glimpse of a ThursdayGNEXT string but i'm not sure
what it means...

Jim

On 26/03/12 09:47, Marcus Lindner wrote:








Thanks for the answer.
Yes, the number of domicles was the problem.
When I use one or two domiciles the population remains relativ stable.
If I use 3 or more, then the population is increasing.
Is it a good idea to add some helpers for the grimreaper if the
population grows too fast?
Marcus
2012/3/26 Stefan Kamphausenska2...@googlemail.com
mailto:ska2...@googlemail.com
 Hi,
   For my little project I wanted to reprogramm the gentic
 algorithm from
   the book Clojure written by Stefan Kamphausen and Tim Oliver
 Kaiser.
 quickly glancing at the code, it looks like a valid translation
 into English.
 Did you try to tune number-of-domiciles?  Depending on your
 machine it may be necessary to decrease the number of creators so
 that the population doesn't grow.  In this simulation the
 grimreaper has a hard time working against the birth-rate. ;-)
 Feel free to get in contact with me via e-mail[1] if your problem
 persists.
 Kind regards,
 Stefan
 [1]  (apply str (reverse [de \. clojure-buch (str ska@)]))
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 mailto:clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient
 with your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 mailto:clojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient
with your first post.
To unsubscribe from 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] lein-deps-tree 0.1.0

2012-04-02 Thread Nelson Morris
The `lein deps :tree` command will work in preview3.  This plugin is
good for anyone who needs it now on preview2.

Thanks for putting it together.

On Mon, Apr 2, 2012 at 7:48 AM, Sun Ning classicn...@gmail.com wrote:
 lein2 has a built-in command: `lein deps :tree` for this task
 it would be great to have the plugin in lein 1.x
 But I got error below:

 Exception in thread main java.io.FileNotFoundException: Could not locate
 leiningen/core/classpath__init.class or leiningen/core/classpath.clj on
 classpath:  (deps_tree.clj:1)


 On Mon 02 Apr 2012 08:39:34 PM CST, Moritz Ulrich wrote:

 I'm happy to announce the first release of lein-deps-tree[1].

 It's a leiningen plugin which prints the all dependencies of a project
 as a nicely formatted tree.


 Please report any issues (especially with leiningen 1.x) as Github issues.


 [1]: https://github.com/the-kenny/lein-deps-tree

 Cheers,
 Moritz


 --
 Sun Ning
 Software developer
 Nanjing, China (N32°3'42'' E118°46'40'')
 http://about.me/sunng/bio


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

2012-04-02 Thread Jeff Weiss
I wish there was a built-in for this as well.  I don't know that 
(constantly) is a good name for it though.  I couldn't think of a good 
name, apparently a null function means the same as identity function so 
that doesn't work.  

On Monday, April 2, 2012 2:39:31 PM UTC-4, Jay Fields wrote:

 I often tend to define the following in my apps

 (def no-op (fn [ _]))

 The other day I noticed constantly
 (
 http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/constantly
 ),
 which is basically the same thing - except I would have to say
 (constantly nil). What do you all think about allowing constantly to
 take no args and constantly return nil?

 Or, is there another function that does that and I've just overlooked it?

 Cheers, Jay



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

2012-04-02 Thread Moritz Ulrich
Just pushed 0.1.1 to Clojars.

It is *supposed* to work with 1.x, but it most likely won't.

The problem lies in some version mismatch between 1.x and a dependency
of pomegranate. See [1] for details.
If anyone knows a fix for this, please let me know.

[1]: https://github.com/cemerick/pomegranate/issues/2

On Mon, Apr 2, 2012 at 21:11, Nelson Morris nmor...@nelsonmorris.net wrote:
 The `lein deps :tree` command will work in preview3.  This plugin is
 good for anyone who needs it now on preview2.

 Thanks for putting it together.

 On Mon, Apr 2, 2012 at 7:48 AM, Sun Ning classicn...@gmail.com wrote:
 lein2 has a built-in command: `lein deps :tree` for this task
 it would be great to have the plugin in lein 1.x
 But I got error below:

 Exception in thread main java.io.FileNotFoundException: Could not locate
 leiningen/core/classpath__init.class or leiningen/core/classpath.clj on
 classpath:  (deps_tree.clj:1)


 On Mon 02 Apr 2012 08:39:34 PM CST, Moritz Ulrich wrote:

 I'm happy to announce the first release of lein-deps-tree[1].

 It's a leiningen plugin which prints the all dependencies of a project
 as a nicely formatted tree.


 Please report any issues (especially with leiningen 1.x) as Github issues.


 [1]: https://github.com/the-kenny/lein-deps-tree

 Cheers,
 Moritz


 --
 Sun Ning
 Software developer
 Nanjing, China (N32°3'42'' E118°46'40'')
 http://about.me/sunng/bio


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



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


Re: Need help to find a bug in a genetic algorithm

2012-04-02 Thread Marcus Lindner
I think the reason here is, that the used agents perform the day-of-life 
function.
Another reason is also, that the individual, which is created by the 
agent, is put again into teh ref population. Could be that this might 
prefent the use of pmap, or increase the time for the scheduling.


When you look at the day-in-life function, you see that the individual 
and its firtness score is put into the population ref by a swap!.


And because you send the function to the agents, these functions are 
resovled in a asynchron way and every agents performs the function 
parallel.

(Hope this makes sense, english is not my mother tongue :( .)

So the parallel processing is performed by using the x agents.

By the way, on my slow machine it works best with onyl 2 domiciles 
(agents). On an other with 12 cores the domiclies can go up much more, 
but I have not find out how much.


Am 02.04.2012 20:34, schrieb Jim - FooBar();:

Shouldn't the line (inside start-evolution) :

*(map #(send % a-day-in-the-life-agent-fn) domiciles)
*
be:

*(pmap #(send % a-day-in-the-life-agent-fn) domiciles)* ???

why does it need to happen serially?

Jim

On 02/04/12 19:06, Goldritter wrote:

First there is an error in my code :(

These are the allowed symbols from which the creator function can
choose to create or mutate a gen:
def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü
  ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ))

This is the targetd which should be fulfilled:
(def the_target Thursday Next)

The first error is, that in the allowed symbols the Space (' ') is
missing. So without this symbol/character the algorithm has no chance
to finish.

The correct definition for the symbols are (with the missing space):

def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü 
  ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ ))


So the algorithm tries to design the String Thursday Next by
exploring many possible variations and to get as near as possible to
the solution Thursday Next.

The main purpose of this algorithm, I think, is to show how you can
use agents and atoms to implement a genetic algorithm.

On Apr 2, 7:59 pm, Jim - FooBar();jimpil1...@gmail.com  wrote:

Is it possible to explain briefly what this genetic algorithm tries to
accomplish? I mean what problem is it producing solution for? It never
seems to end regardless of number-of-domiciles!
I think i got a glimpse of a ThursdayGNEXT string but i'm not sure
what it means...

Jim

On 26/03/12 09:47, Marcus Lindner wrote:








Thanks for the answer.
Yes, the number of domicles was the problem.
When I use one or two domiciles the population remains relativ stable.
If I use 3 or more, then the population is increasing.
Is it a good idea to add some helpers for the grimreaper if the
population grows too fast?
Marcus
2012/3/26 Stefan Kamphausenska2...@googlemail.com
mailto:ska2...@googlemail.com
 Hi,
   For my little project I wanted to reprogramm the gentic
 algorithm from
   the book Clojure written by Stefan Kamphausen and Tim Oliver
 Kaiser.
 quickly glancing at the code, it looks like a valid translation
 into English.
 Did you try to tune number-of-domiciles?  Depending on your
 machine it may be necessary to decrease the number of creators so
 that the population doesn't grow.  In this simulation the
 grimreaper has a hard time working against the birth-rate. ;-)
 Feel free to get in contact with me via e-mail[1] if your problem
 persists.
 Kind regards,
 Stefan
 [1]  (apply str (reverse [de \. clojure-buch (str ska@)]))
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email tocloj...@googlegroups.com
 mailto:clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient
 with your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 mailto:clojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email tocloj...@googlegroups.com
Note that posts from new members are moderated - please be patient
with your first post.
To unsubscribe from 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 

Re: Need help to find a bug in a genetic algorithm

2012-04-02 Thread Marcus Lindner
Without the pmap and only 2 domiciles I got the solution in 2 minutes on 
my 4 core machine.


Might be interesting which effect the pmap might have in combination 
with agents.


Am 02.04.2012 20:41, schrieb Jim - FooBar();:
The onle setup that works for my machine (the one that finds the 
solution in reasonable time) is with number-of-domiciles = 3, the 
missing space and using pmap instead of map when evolution 
starts...the population size moves from around 1180  to 1230 but i can 
see all 4 cores of mine firing up and i get the solution in time 
(roughly 40sec)!!!


Jim


On 02/04/12 19:06, Goldritter wrote:

First there is an error in my code :(

These are the allowed symbols from which the creator function can
choose to create or mutate a gen:
def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü
  ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ))

This is the targetd which should be fulfilled:
(def the_target Thursday Next)

The first error is, that in the allowed symbols the Space (' ') is
missing. So without this symbol/character the algorithm has no chance
to finish.

The correct definition for the symbols are (with the missing space):

def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü 
  ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ ))


So the algorithm tries to design the String Thursday Next by
exploring many possible variations and to get as near as possible to
the solution Thursday Next.

The main purpose of this algorithm, I think, is to show how you can
use agents and atoms to implement a genetic algorithm.

On Apr 2, 7:59 pm, Jim - FooBar();jimpil1...@gmail.com  wrote:

Is it possible to explain briefly what this genetic algorithm tries to
accomplish? I mean what problem is it producing solution for? It never
seems to end regardless of number-of-domiciles!
I think i got a glimpse of a ThursdayGNEXT string but i'm not sure
what it means...

Jim

On 26/03/12 09:47, Marcus Lindner wrote:








Thanks for the answer.
Yes, the number of domicles was the problem.
When I use one or two domiciles the population remains relativ stable.
If I use 3 or more, then the population is increasing.
Is it a good idea to add some helpers for the grimreaper if the
population grows too fast?
Marcus
2012/3/26 Stefan Kamphausenska2...@googlemail.com
mailto:ska2...@googlemail.com
 Hi,
  For my little project I wanted to reprogramm the gentic
 algorithm from
  the book Clojure written by Stefan Kamphausen and Tim Oliver
 Kaiser.
 quickly glancing at the code, it looks like a valid translation
 into English.
 Did you try to tune number-of-domiciles?  Depending on your
 machine it may be necessary to decrease the number of creators so
 that the population doesn't grow.  In this simulation the
 grimreaper has a hard time working against the birth-rate. ;-)
 Feel free to get in contact with me via e-mail[1] if your problem
 persists.
 Kind regards,
 Stefan
 [1]  (apply str (reverse [de \. clojure-buch (str ska@)]))
 --
 You received this message because you are subscribed to the 
Google

 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
mailto:clojure@googlegroups.com
 Note that posts from new members are moderated - please be 
patient

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

2012-04-02 Thread Gijs S.
See this blog post for more background on BrowserChannel and why it is
useful for ClojureScript web applications:

http://thegeez.net/2012/04/03/why_browserchannel.html

-Gijs

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

2012-04-02 Thread Jim - FooBar();
Ok i understand what you mean...i had a closer look at the code and it 
seems that the hard work is done by agents...However, I did some further 
testing out of curiosity and got back some weird behaviour...On my 
machine it doesn't really matter whether i have 2 or 3 domiciles - i 
will still get the answer in less than a minute. However it does matter 
whether i use pmap or map. For some reason i don't understand, when i 
use 'map', CPU load never exceeds 60% but my RAM goes to 71% (from 37% ) 
and as a result the terminal starts to lag which is obviously not good! 
On the other hand when i use 'pmap' my RAM only goes up by 1% and my CPU 
load skyrockets to 99%!!! That is really amazing isn't it...I also get 
the answer a lot  quicker (roughly 20 sec with 2 domiciles)Can 
somebody explain? I totally agree with Marcus point that agents are 
asynchronous and so pmap should only add overhead...It seems however 
that pmap does the ccorrect job here...


Jim

p.s: Marcus run it for ourself using pmap and 2 domiciles and compare it 
with previous runs...

I 've not changed the code at all apart from adding the missing  space...

On 02/04/12 21:33, Marcus Lindner wrote:
I think the reason here is, that the used agents perform the 
day-of-life function.
Another reason is also, that the individual, which is created by the 
agent, is put again into teh ref population. Could be that this might 
prefent the use of pmap, or increase the time for the scheduling.


When you look at the day-in-life function, you see that the individual 
and its firtness score is put into the population ref by a swap!.


And because you send the function to the agents, these functions are 
resovled in a asynchron way and every agents performs the function 
parallel.

(Hope this makes sense, english is not my mother tongue :( .)

So the parallel processing is performed by using the x agents.

By the way, on my slow machine it works best with onyl 2 domiciles 
(agents). On an other with 12 cores the domiclies can go up much more, 
but I have not find out how much.


Am 02.04.2012 20:34, schrieb Jim - FooBar();:

Shouldn't the line (inside start-evolution) :

*(map #(send % a-day-in-the-life-agent-fn) domiciles)
*
be:

*(pmap #(send % a-day-in-the-life-agent-fn) domiciles)* ???

why does it need to happen serially?

Jim

On 02/04/12 19:06, Goldritter wrote:

First there is an error in my code :(

These are the allowed symbols from which the creator function can
choose to create or mutate a gen:
def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü
  ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ))

This is the targetd which should be fulfilled:
(def the_target Thursday Next)

The first error is, that in the allowed symbols the Space (' ') is
missing. So without this symbol/character the algorithm has no chance
to finish.

The correct definition for the symbols are (with the missing space):

def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü 
  ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ ))


So the algorithm tries to design the String Thursday Next by
exploring many possible variations and to get as near as possible to
the solution Thursday Next.

The main purpose of this algorithm, I think, is to show how you can
use agents and atoms to implement a genetic algorithm.

On Apr 2, 7:59 pm, Jim - FooBar();jimpil1...@gmail.com  wrote:

Is it possible to explain briefly what this genetic algorithm tries to
accomplish? I mean what problem is it producing solution for? It never
seems to end regardless of number-of-domiciles!
I think i got a glimpse of a ThursdayGNEXT string but i'm not sure
what it means...

Jim

On 26/03/12 09:47, Marcus Lindner wrote:








Thanks for the answer.
Yes, the number of domicles was the problem.
When I use one or two domiciles the population remains relativ stable.
If I use 3 or more, then the population is increasing.
Is it a good idea to add some helpers for the grimreaper if the
population grows too fast?
Marcus
2012/3/26 Stefan Kamphausenska2...@googlemail.com
mailto:ska2...@googlemail.com
 Hi,
   For my little project I wanted to reprogramm the gentic
 algorithm from
   the book Clojure written by Stefan Kamphausen and Tim Oliver
 Kaiser.
 quickly glancing at the code, it looks like a valid translation
 into English.
 Did you try to tune number-of-domiciles?  Depending on your
 machine it may be necessary to decrease the number of creators so
 that the population doesn't grow.  In this simulation the
 grimreaper has a hard time working against the birth-rate. ;-)
 Feel free to get in contact with me via e-mail[1] if your problem
 persists.
 Kind regards,
 Stefan
 [1]  (apply str (reverse [de \. clojure-buch (str ska@)]))
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email tocloj...@googlegroups.com
 

Re: how to write a macro that calls defrecord?

2012-04-02 Thread Moritz Heidkamp
Hi Joachim.

On Mon, Apr 2, 2012 at 3:51 PM, Joachim De Beule
joachim.de.be...@gmail.com wrote:
 which expands into the following (valid) code:

 (defrecord R (content) tmp-protocol (do-sth [this] this)),

how did you get that expansion? Try this:

  user= (macroexpand-1 '(my-defrecord R [content]))
  (clojure.core/defrecord R (content) user/MyProtocol
(user/do-something [user/this] user/this))

Now it's obvious why it fails: Clojure's syntax-quote expands this
to a symbol in the current namespace which, of course, doesn't exist.
The idiomatic way to hygienically introduce local variables (function
arguments in this case) is to suffix them with #, i.e.:

  (defmacro my-defrecord [name [ fields]  body]
`(defrecord ~name ~fields
   MyProtocol
   (do-something [this#] this#)
   ~@body))

HTH,
Moritz

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


[no subject]

2012-04-02 Thread Softaddicts



--
Softaddictslprefonta...@softaddicts.ca sent by ibisMail!

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Update an item from a list of maps in STM transaction

2012-04-02 Thread Stephen Compall
On Sat, 2012-03-31 at 11:00 -0700, Marcelo Macedo de Melo Silva wrote:
 I'm running multiple threads using this same list and need to update
 the value of an item inside a STM transaction.

If you mean by value of an item the value in the database: I suggest
you create an updater agent instead, shared by all the threads.  While
each thread is in a transaction, it can `send' an action to update the
database to this agent.  Agent sends are queued by the STM, so you can
be sure only one update happens, and only if a transaction succeeds.

If you mean to mutate the list of maps, you can't do that.

 I tried using one FUTURE for a REF but is not working.

Not sure what this means.  Futures are IDerefs...

-- 
Stephen Compall
^aCollection allSatisfy: [:each|aCondition]: less is better

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

2012-04-02 Thread Softaddicts
Hi,

A new version of tools.trace is out, 0.7.3

A) dynamic tracing is now available (contribution from  Michal Marczyk and Don 
Jackson)
B) dynamic tracing can be applied to all fns in a namespace in a single call
C) with the latest version of autodoc deployed by Tom, the API documentation
 is greatly simplified, most of the API is based on macros, underlying 
public stuff is 
 now hidden in the documentation.

https://github.com/clojure/tools.trace

API:  http://clojure.github.com/tools.trace/

Luc

--
Softaddictslprefonta...@softaddicts.ca sent by ibisMail!

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


Clojure Software Dev wanted, remote work

2012-04-02 Thread Craig Brozefsky

My employer, ThreatGRID, is looking for a clojure developer.

We're a malware analysis and threat intelligence company.  To
translate, we take tens of thousands of pieces of bad software daily,
analyze them, and put the results in a big database.  We've built our
web front-end and analysis engine in Clojure, using Noir, ClojureQL,
core.logic, and lots of love.

The primary responsibilities we are looking to fill are:

  * Data Analysis
  * Visualization 
  * Web Dev

We've got a great team of polyglot hackers with strong lisp biases,
reverse-engineering backgrounds, and a pragmatism born of decades of
collective experience.  We work from home, with offices in NYC, and
have team meetings from time to time (I'm writing this from our team
retreat in Colorado).

We are interested in talking to devs at all experience levels.

If you are interested or have question, contact me at
cr...@threatgrid.com

The job is also posted here:
http://www.threatgrid.com/jobs/


-- 
Craig Brozefsky cr...@red-bean.com
Premature reification is the root of all evil

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

2012-04-02 Thread Robert Levy
Just to follow up, I fixed the issues Roman found.  Thanks again for your
help.  I also took the advice from the issue Stephen Compall created, and
removed the special handling of quoted forms.

On Mon, Apr 2, 2012 at 5:25 AM, Roman Perepelitsa 
roman.perepeli...@gmail.com wrote:

 And a couple more:

 user= (- 0 [1  ])
 [1 0]

 user= (- 0 { 1})
 CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
 in this context, compiling:(NO_SOURCE_PATH:16)

 user= (- 0 {1  2 })
 IllegalArgumentException No value supplied for key: 2
  clojure.lang.PersistentHashMap.createWithCheck (PersistentHashMap.java:89)

 Roman Perepelitsa.

 2012/4/2 Roman Perepelitsa roman.perepeli...@gmail.com

 Looks very nice!

 Is the following behavior expected with Clojure 1.3?

 user= (- 0 '())
 ( 0)

 user= (- 0 [])
 CompilerException java.lang.RuntimeException: Unable to resolve symbol:
  in this context, compiling:(NO_SOURCE_PATH:24)

 ;; I guess this one is expected, although it would be nice if it worked.
 user= (- 0 '(1 (1 )))
 (1 (1 ) 0)

 Roman Perepelitsa.

 2012/4/2 Robert Levy r.p.l...@gmail.com

 Swiss arrows is a library I wrote today, providing a number of useful
 arrow macros.

- The Diamond Wand: a generalized arrow macro for threading into any
position.
- The Back Arrow: - with its arguments reversed, convenient in
some cases.
- The Furcula / Parallel Furcula: branch the result of an operation
in multiple directions, sequentially or in parallel.
- The Double Furcula / Parallel Furcula, Double-style: the above,
using - instead of -
- The Diamond Fishing Rod / Parallel Diamond Fishing Rod: the above,
using -

 Swiss Arrows is available to try out right now at
 https://github.com/rplevy/swiss-arrows

 Feedback, ideas, and pull requests are of course very welcome.

 Rob

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