Re: Particle system with Quil

2012-08-26 Thread Mayank Jain
So beautiful! May I know what are the use-cases for this?
Thanks for sharing.

On Sun, Aug 26, 2012 at 8:47 AM, meteorfox ctorresk8guitar@gmail.comwrote:

 I've been working in a particle system using Quil for rendering, which I'm
 calling Newtonian for now ;) , just to practice some of the concepts of
 protocols and defrecords. The project is still WIP. Any feedback will be
 appreciate it.

 github.com:
 https://github.com/meteorfox/newtonian

 Vimeo: (Warning: Looks choppy in the video, because the frame rate I used
 when I recorded it)
 https://vimeo.com/48222827

 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: 'functional' performance VS 'imperative' complexity

2012-08-26 Thread Joshua Ballanco
On Sat, Aug 25, 2012 at 09:01:21PM +0100, Jim - FooBar(); wrote:
 Hello everyone,
 
 in this post I'm not asking for something specific, but rather I'd
 like to spark a  discussion regarding the issue of performance
 within the functional paradigm...most of the things i will mention
 will probably not be news for most of you...Hopefully, however the
 issues I plan to raise will eventualy help someone else faced with
 the same dilemmas as me...
 
 First of all, let me clarify upfront that I strongly believe that
 'functional' and 'immutable' should be the default (as Rich often
 says). This thread is certainly not about praising the 'imperative'
 style. It is about having all the facts  before you start coding
 (probably before even designing)...Most of you presumably already
 do...
 
 Ok so, it is evident from my other posts that I'm building a library
 for writing board games. In a nutshell, when it's finished, I'd like
 someone else to be able to write up his own board game, show it up
 on screen and genetically train a neural-net for an opponent, in
 literally less than 5-6 hours (~ 100 LOC).
 Now, for those of you that have done any board games you can
 immediately identify the hot-spots of such a program. These are 2:
 actually exploring the game-tree and training the neural-net. Notice
 how both these tasks can be run in parallel...(exploring the game
 tree is not immediately apparent how to do in parallel but we have
 reducers)...
 
 Generally there are 3 major ways going about writing a program -
 functionally all the way, imperatively all the way, a mixture. I
 sort of implemented all 3 categories for my chess game and I've got
 some interesting results:
 
 1. Firstly and more importantly (I mean that), the purely functional
and immutable road is simply  such a pleasure to travel...There are
no words to describe the beauty, clarity and elegance of the
functional version. Mutation is non-existent or only through
reference types and operations like 'update-position' and 'move'
return brand new piece and board respectively. Also, it is the only
one that is extremely stable and always brings back the correct
answer. It is *gorgeous*... On the flip-side, it performs horrible!
It is very very slow for realistic depths like 4 or 6 even
regardless of utilising reducers to the maximum and countless
optimisations. The best time I can report is 9 min for level 4.
 2. after watching Daniel Solano Gomez's presentation on infoq (11 tips
to boost performance), I realised that If I wanted raw speed (as he
puts it), I 'd have to resort to arrays. Well, I made my heart a
stone and went to implement an array-based version that favours
mutation. Having such modular code in the first place, that did not
take too long...I just wrote up different version of 'move' and
'collides?' (amove, acollides?) that know how to deal with arrays
and created a ChessPiece2 record which holds a java.awt.Point object
which is mutated by update-position (instead of returning a brand
new piece). Basically,  (I thought) i was done in 30 min... However
it turned out I was being sooo ignorant!!! Making such a u-turn in
programming paradigms while working on the same project is never
that simple. The functional style protected me from so many bad
things...of course, I already knew that but I was surprised to see
how many these are! For instance, making a move in the functional
version caused absolutely no damage...there is an 'execute!' fn that
does damage if we want it to (via atom only) but this is to be used
only when we decide what move we want. Now, trying out a move messes
up everything!!! Now, I need means of undoing and not only that...My
entire searching algorithm can no longer function properly...Off the
top of my head, I need some sort of serial loop/recur that tries
moves when recursion rolls in and takes them back (by undoing) when
recursion rolls out . In other words I need to keep track of the
changes carefully! On the filp-side, even though this version has
bugs and does not return the correct answer, it seems it can reach
level 4 in roughly 2 min. This is 4x faster! Again, I'm being
cautious cos there are bugs so I can't be sure of the time but there
seems to be a dramatic performance increase...The code however is a
lot buggier and uglier...
 3. Finally I tried doing a functional version that uses mutable arrays
but doesn't mutate them...Instead critical fns like 'move' build new
arrays (btw 'aclone' does not deep copy) to return and updating a
piece's position does return a new piece... This version, is not
very stable but does return the correct answer in just over 7 min
for level 4...again the importance of immutability shines! the
timing shows that i got 22%  better performance. I have not profiled
this but I expect most of the time being 

Re: 'functional' performance VS 'imperative' complexity

2012-08-26 Thread Jim - FooBar();

On 26/08/12 11:03, Joshua Ballanco wrote:

I would love to have some time to look into the details of your specific
problem more, but in the absence of time, might I suggest two quick
points:


Well, feel free to have a look at the project on github when you find 
some time ( https://github.com/jimpil/Clondie24)...I should clarify that 
the big problem is with chess and not any other games...I'm expecting 
games like checkers or tic-tac-toe to perform just fine with the 
functional solution.



1. Gary Bernhardt has been playing with a new approach he calls
Functional Core, Imperative Shell. Essentially, it's another take on
the question of how to limit the scope of mutation in order to get the
most out of the correctness of mutation-free algorithms and the
performance of mutating data instead of replicating it.


hmmm...I will definitely check this out...It is certainly an important 
issue!



2. Along the same lines, have you made the most out of transients in
your code? From your description, it seems like you have less work
happening within methods than between methods, but perhaps if you
manually inline some of the work, transients could provide improved
performance


well, transients do play an important role in my core 'move' fn which 
used to create 2 extra vectors as a result of 2 'assoc's...I got a 15% 
performance increase by using them despite of only mutating 2 indices! I 
cannot really use them anywhere else though...as far as inlining goes, 
most of my core fns that are involved in moving (which happens a lot) 
are 'definline'd and the fn that translates the position from 1d to2d 
and vice-versa (also called very frequently) is memoizedpersonally I 
cannot think of any other optimisations...the best suggestion so far was 
by Nicolas who basically proposed to precalculate all the pieces moves 
(apart from pawn) in a big table (a nested map) instead of calculating 
them on the fly...this made a bid difference! before that, the profiler 
was showing 86% core.logic.Subsitutions


Jim


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

2012-08-26 Thread Joshua Ballanco
On Sun, Aug 26, 2012 at 11:16:29AM +0100, Jim - FooBar(); wrote:
 On 26/08/12 11:03, Joshua Ballanco wrote:
 I would love to have some time to look into the details of your specific
 problem more, but in the absence of time, might I suggest two quick
 points:
 
 Well, feel free to have a look at the project on github when you
 find some time ( https://github.com/jimpil/Clondie24)...I should
 clarify that the big problem is with chess and not any other
 games...I'm expecting games like checkers or tic-tac-toe to perform
 just fine with the functional solution.

Stared! We've been having a weekly Clojure study group at work. I don't
think we're at the point, as a group, where we would be able to tackle
this, but I'll keep it in mind for the future.

 1. Gary Bernhardt has been playing with a new approach he calls
 Functional Core, Imperative Shell. Essentially, it's another take on
 the question of how to limit the scope of mutation in order to get the
 most out of the correctness of mutation-free algorithms and the
 performance of mutating data instead of replicating it.
 
 hmmm...I will definitely check this out...It is certainly an
 important issue!

Ah, just realized I forgot the link:

https://www.destroyallsoftware.com/screencasts/catalog/functional-core-imperative-shell

It's a for-pay screencast series that he does, but well worth the money
in my opinion!

-- 
Joshua Ballanco

ELC Technologies™
1771 NW Pettygrove Street, Suite 140
Portland, OR, 97209
jballa...@elctech.com

P +1 866.863.7365
F +1 877.658.6313
M +1 646.463.2673
T +90 533.085.5773

http://www.elctech.com

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


using lein repl as the Emacs Inferior Lisp REPL as opposed to a custom script that does java -jar clojure-1.4.0.jar

2012-08-26 Thread mperdikeas
I am now using *Emacs 24.1.1* in *Ubuntu precise* and have managed to 
install *Clojure-mode*. The next thing I want to do is to use *lein repl*as my 
Emacs REPL (currently I've set 
*inferior-lisp-program* to a custom bash script that simply does a *java 
-jar clojure-1.4.0.jar*). The reason I've resorted to this approach is that 
it is not clear to me how to control the Clojure version that *lein repl* is 
using. As a result, although I have downloaded *clojure-1.4.0.jar* and am 
using that in my custom bash script, *lein* reports a totally different 
Clojure, one that's different even from what */usr/bin/clojure* is:

mperdikeas@ubuntu:~#
$ which clojure
/usr/bin/clojure
mperdikeas@ubuntu:~#
$ /usr/bin/clojure
Clojure 1.1.0
user= 
mperdikeas@ubuntu:~#
$ lein repl
REPL started; server listening on localhost port 4840
user= (clojure-version)
1.2.1
user= 
mperdikeas@ubuntu:~#
$ cat ./.emacs.d/clojure/repl.sh 
java -jar ~/.emacs.d/clojure/clojure-1.4.0.jar
mperdikeas@ubuntu:~#
$ ./.emacs.d/clojure/repl.sh
Clojure 1.4.0
user= 

So it seems that I have three different Clojures currently available but I 
can't configure *lein repl *to use the latest one. I've read this SO 
discussionhttp://stackoverflow.com/questions/10135440/lein-clojure-1-3-vs-clojure-1-2-1
 but 
it seems to cover the case where *lein *is invoked in a directory 
containing a *project.clj* file where the Clojure dependency can be set. 
However:

*[1]* I' ve experimented a bit with *lein repl* and found that I can invoke 
it in any arbitrary directory. So where does it get the *project.clj* file 
in those cases?
*[2]* In the *.emacs* file (according to this helpful 
articlehttp://ubercode.de/blog/make-emacs-evaluate-clojure-in-5-minutes) one 
is supposed to do a:

(progn ;; Inferior Lisp 

  
(add-hook 'clojure-mode-hook ;; copied from:   
   
  (lambda ()
(setq inferior-lisp-program lein repl))) 

Again, where would *lein* look for the *project.clj* file in the above 
case? And what if I just want to start writing Clojure in an Emacs buffer 
without having setup a lein project structure? From where would then *lein 
repl* get the Clojure version dependency in that case?



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

2012-08-26 Thread Patryk Bukowinski
Hi Jim,
Reading your story I've got an impression that you make 'functional' and
'immutable' a synonym, not default.
Implementation should be more transparent.

In APL funcvect programming languages fammily there are tools which amends
values in place.
It feels so natural, part of a language used in ordinary functional way
even at higher abstraction level.
People use those languages for ML because solutions are much faster than
Matlab, being very neat functional solutions.

Killing performance for religious paradigm of immutability may kill the
language.

cheers
patryk
On Aug 25, 2012 9:01 PM, Jim - FooBar(); jimpil1...@gmail.com wrote:

  Hello everyone,

 in this post I'm not asking for something specific, but rather I'd like to
 spark a  discussion regarding the issue of performance within the
 functional paradigm...most of the things i will mention will probably not
 be news for most of you...Hopefully, however the issues I plan to raise
 will eventualy help someone else faced with the same dilemmas as me...

 First of all, let me clarify upfront that I strongly believe that
 'functional' and 'immutable' should be the default (as Rich often says).
 This thread is certainly not about praising the 'imperative' style. It is
 about having all the facts  before you start coding (probably before even
 designing)...Most of you presumably already do...

 Ok so, it is evident from my other posts that I'm building a library for
 writing board games. In a nutshell, when it's finished, I'd like someone
 else to be able to write up his own board game, show it up on screen and
 genetically train a neural-net for an opponent, in literally less than 5-6
 hours (~ 100 LOC).
 Now, for those of you that have done any board games you can immediately
 identify the hot-spots of such a program. These are 2: actually exploring
 the game-tree and training the neural-net. Notice how both these tasks can
 be run in parallel...(exploring the game tree is not immediately apparent
 how to do in parallel but we have reducers)...

 Generally there are 3 major ways going about writing a program -
 functionally all the way, imperatively all the way, a mixture. I sort of
 implemented all 3 categories for my chess game and I've got some
 interesting results:


1. Firstly and more importantly (I mean that), the purely functional
and immutable road is simply  such a pleasure to travel...There are no
words to describe the beauty, clarity and elegance of the functional
version. Mutation is non-existent or only through reference types and
operations like 'update-position' and 'move' return brand new piece and
board respectively. Also, it is the only one that is extremely stable and
always brings back the correct answer. It is *gorgeous*... On the
flip-side, it performs horrible! It is very very slow for realistic depths
like 4 or 6 even regardless of utilising reducers to the maximum and
countless optimisations. The best time I can report is 9 min for level 4.
 2. after watching Daniel Solano Gomez's presentation on infoq (11
tips to boost performance), I realised that If I wanted raw speed (as he
puts it), I 'd have to resort to arrays. Well, I made my heart a stone and
went to implement an array-based version that favours mutation. Having such
modular code in the first place, that did not take too long...I just wrote
up different version of 'move' and 'collides?' (amove, acollides?) that
know how to deal with arrays and created a ChessPiece2 record which holds a
java.awt.Point object which is mutated by update-position (instead of
returning a brand new piece). Basically,  (I thought) i was done in 30
min... However it turned out I was being sooo ignorant!!! Making such a
u-turn in programming paradigms while working on the same project is never
that simple. The functional style protected me from so many bad things...of
course, I already knew that but I was surprised to see how many these are!
For instance, making a move in the functional version caused absolutely no
damage...there is an 'execute!' fn that does damage if we want it to (via
atom only) but this is to be used only when we decide what move we want.
Now, trying out a move messes up everything!!! Now, I need means of undoing
and not only that...My entire searching algorithm can no longer function
properly...Off the top of my head, I need some sort of serial loop/recur
that tries moves when recursion rolls in and takes them back (by undoing)
when recursion rolls out . In other words I need to keep track of the
changes carefully! On the filp-side, even though this version has bugs and
does not return the correct answer, it seems it can reach level 4 in
roughly 2 min. This is 4x faster! Again, I'm being cautious cos there are
bugs so I can't be sure of the time but there seems to be a dramatic
performance increase...The code however is a lot 

Re: Particle system with Quil

2012-08-26 Thread Sam Aaron
Truly outstanding work!

Things like this really make me feel warm and fuzzy inside and more than 
justify all the hard work that goes into libraries like Quil.

Please keep making beautiful things.

Sam

---
http://sam.aaron.name

On 26 Aug 2012, at 04:17, meteorfox ctorresk8guitar@gmail.com wrote:

 I've been working in a particle system using Quil for rendering, which I'm 
 calling Newtonian for now ;) , just to practice some of the concepts of 
 protocols and defrecords. The project is still WIP. Any feedback will be 
 appreciate it.
 
 github.com:
 https://github.com/meteorfox/newtonian
 
 Vimeo: (Warning: Looks choppy in the video, because the frame rate I used 
 when I recorded it) 
 https://vimeo.com/48222827 
 
 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: 'functional' performance VS 'imperative' complexity

2012-08-26 Thread Jim - FooBar();

On 26/08/12 09:51, Patryk Bukowinski wrote:


Hi Jim,
Reading your story I've got an impression that you make 'functional' 
and 'immutable' a synonym, not default.

Implementation should be more transparent.

In APL funcvect programming languages fammily there are tools which 
amends values in place.
It feels so natural, part of a language used in ordinary functional 
way even at higher abstraction level.
People use those languages for ML because solutions are much faster 
than Matlab, being very neat functional solutions.


Killing performance for religious paradigm of immutability may kill 
the language.


cheers
patryk



So, you're implying that 'functional' and 'immutable' do not share the 
same roots? It is my understanding that unless you go fully immutable 
you're sort of getting half the functional story...As for scientific 
computing and ML have you checked julia? ( http://julialang.org/)


Implementation should be more transparent? how can you do that since the 
2 approaches are fundamentally different? That was sort of my 
point...You need to think about these things early...It is not easy to 
switch!


cheers
Jim

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: using lein repl as the Emacs Inferior Lisp REPL as opposed to a custom script that does java -jar clojure-1.4.0.jar

2012-08-26 Thread Nelson Morris
On Sun, Aug 26, 2012 at 5:36 AM, mperdikeas mperdik...@gmail.com wrote:
 I am now using Emacs 24.1.1 in Ubuntu precise and have managed to install
 Clojure-mode. The next thing I want to do is to use lein repl as my Emacs
 REPL (currently I've set inferior-lisp-program to a custom bash script that
 simply does a java -jar clojure-1.4.0.jar). The reason I've resorted to this
 approach is that it is not clear to me how to control the Clojure version
 that lein repl is using. As a result, although I have downloaded
 clojure-1.4.0.jar and am using that in my custom bash script, lein reports a
 totally different Clojure, one that's different even from what
 /usr/bin/clojure is:

lein is distributed as a standalone jar, which means a version of
clojure and all other dependencies, is packaged with it.  In addition,
lein 1.7.1 is compiled against clojure 1.2.1, and would not be able to
bootstrap using a future version.

 So it seems that I have three different Clojures currently available but I
 can't configure lein repl to use the latest one. I've read this SO
 discussion but it seems to cover the case where lein is invoked in a
 directory containing a project.clj file where the Clojure dependency can be
 set. However:

 [1] I' ve experimented a bit with lein repl and found that I can invoke it
 in any arbitrary directory. So where does it get the project.clj file in
 those cases?
 [2] In the .emacs file (according to this helpful article) one is supposed
 to do a:

 (progn ;; Inferior Lisp
 (add-hook 'clojure-mode-hook ;; copied from:
   (lambda ()
 (setq inferior-lisp-program lein repl)))

 Again, where would lein look for the project.clj file in the above case? And
 
 From where would then lein repl get
 the Clojure version dependency in that case?

There are a set of tasks that do not read any information from the
project.clj, version, help, and such.  The repl task is allowed to run
outside a project, but comes with the limitation that the classpath
the repl uses will be the same as the classpath lein uses.  This means
for lein 1.7.1 it will use clojure 1.2.1, and for a recent lein
2.0.0-preview it will use clojure 1.4.0.

When running the repl from a project lein is able to get the
:dependencies desired, and use only those on the classpath.  This is
the way to use clojure 1.4.0 w/ lein 1.7.1.

 what if I just want to start writing Clojure in an Emacs buffer without
 having setup a lein project structure?

Then the limitations above apply.  I know some people when using lein
1.7.1 keep a project around with :dependencies [[org.clojure/clojure
1.4.0]] and use it when doing quick repl interaction.

I'd also like to note that
nrepl.el[https://github.com/kingtim/nrepl.el] and
swank-clojure[https://github.com/technomancy/swank-clojure] are the
common ways to get emacs integration.

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

2012-08-26 Thread Tim King
On Sat, Aug 25, 2012 at 11:12 AM, Shanmu shanm...@gmail.com wrote:

 Hi All,
 Is there a way to disconnect/quit the repl in nrepl.el cleanly?


Hi Shanmu,
This is a open issue that has not been implemented yet.

https://github.com/kingtim/nrepl.el/issues/33

Cheers,
Tim

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

2012-08-26 Thread Denis Labaye
On Fri, Aug 24, 2012 at 6:04 PM, Phil Hagelberg p...@hagelb.org wrote:

 On Fri, Aug 24, 2012 at 6:16 AM, Denis Labaye denis.lab...@gmail.com
 wrote:
  I've just seen the presentation by Phil Hagelberg on swarm coding
  (http://www.infoq.com/presentations/Swarm-Coding).
  Great presentation, very inspiring, we will definitively do swarm coding
  here in the Clojure Paris (France) User Group.
 
  In the talk Phil explains why emacs-slime over ssh do not behave the
 same
  as using emacs directly.
 
  And I was wondering if the Mosh shell (http://mosh.mit.edu/) could
 improve
  the situation?

 Glad you liked the talk. I don't know the details of mosh, but there's
 something to be said for using ubiquitous tools. The more
 prerequisites you introduce the more likely it is that one guy in your
 group is going to have trouble getting it installed and sidetrack the
 whole group.


Good point, ssh is great as it will works on all platforms.

For mosh, I tried to test it, but I don't know what the Emacs over ssh
limitations are.
So I can't reproduce the problem.
I use Emacs over ssh a lot for remote pair programming, or even locally
because it solves the QWERTY vs otherlayout problem when pair-programming.

But I've always been the host of the ssh session, so I've never experienced
any problems.
I used to make fun of my friends when they told me The keybinding doesn't
work, me: Perhaps you should type it correctly ;-). Until I've seen your
talk.
(in particular paredit-wrap-round not working M-(, was the complaint I
heard the most.)

Any pointers on those limitations? I can't find anything online.

Denis


 -Phil

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

2012-08-26 Thread David Nolen
I haven't found this to be the case. Java fares pretty well on Alioth.

On Saturday, August 25, 2012, Stuart Sierra wrote:

 The Alioth benchmarks are somewhat unfair to JVM languages because they
 include startup time for the JVM itself and often don't run enough
 iterations to engage the optimizer.
 -S

 On Sat, Aug 25, 2012 at 1:51 PM, Raymond de Lacaze del...@hotmail.com
 wrote:
  Here’s a performance benchmark comparison of SBCL and Clojure.
  http://shootout.alioth.debian.**org/u32/benchmark.php?test=**
 alllang=clojurelang2=sbclhttp://shootout.alioth.debian.org/u32/benchmark.php?test=alllang=clojurelang2=sbcl

  --
 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: Can CLJS functions have metadata?

2012-08-26 Thread David Nolen
On Saturday, August 25, 2012, Timothy Baldridge wrote:


 It's not currently supported. Ticket welcome. If you have ideas about
 a good approach that's even better. Part of the problem is that
 Clojure fns are just JS fns.



 Can't we just set the attribute on the function? This works under Chrome,
 not sure about other browsers:

 z = function(x) { return x;}
  function (x) { return x;}
 z(1)
  1
 z.foo = 1
  1
 z
  function (x) { return x;}
 z.foo
  1
 z(1)
  1


 This is the approach I took for clojure-py. You can either provide a
 .meta() method that will be called to get the metadata, or you can put
 ._meta on your object and that attribute will be set/retrieved instead. Of
 course, this isn't immutable, but it would support meta and alter-meta.



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


Yes something like that could work. Though picking a more obscure property
name is probably best.

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

having trouble setting the cursor with seesaw

2012-08-26 Thread Jim - FooBar();

another question...why won't this do anything?

(seesaw/config! canvas :cursor :wait) ;;canvas is a result of 
(seesaw/canvas ... ... ...)


I also tried

(seesaw/config! (seesaw/to-root canvas) :cursor :wait)

but the proxied JFrame does not support the :cursor option!

what am I missing?

thanks
Jim


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

2012-08-26 Thread nicolas.o...@gmail.com
On Sun, Aug 26, 2012 at 3:07 PM, David Nolen dnolen.li...@gmail.com wrote:
 I haven't found this to be the case. Java fares pretty well on Alioth.

http://shootout.alioth.debian.org/help.php#java

Shows that it does not change much on programs that run for mor than a
few seconds.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Emacs 23 error: Package `clojure-mode' is not available for installation

2012-08-26 Thread Phil Hagelberg
mperdikeas mperdik...@gmail.com writes:

 I am using Emacs GNU Emacs 23.3.1 on Ubuntu and I am following the
 instructions found here:


 https://github.com/technomancy/clojure-mode/blob/master/README.md

 on how to setup clojure-mode for Emacs. But launching my Emacs reports
 the following error:

 error: Package `clojure-mode' is not available for installation 

I think the old version of package.el that is compatible with 23 doesn't
automatically load the archive listing upon installation. Try manually
invoking `M-x package-refresh` first or upgrading to 24.

-Phil

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

2012-08-26 Thread nicolas.o...@gmail.com

 1. Gary Bernhardt has been playing with a new approach he calls
 Functional Core, Imperative Shell. Essentially, it's another take on
 the question of how to limit the scope of mutation in order to get the
 most out of the correctness of mutation-free algorithms and the
 performance of mutating data instead of replicating it.


It seems to be this treats of another question: how to have IO in a
functional world.
And it gives the classic answer: write the functional core and wrap s
small IO shell around.

Jim is asking another question: what if you can't get good enough
performance in a given algorithm
with persistent functional data structures.

My views is that state is difficult. Every state makes your program
harder to maintain and less modular.
However, a localised state to a function or a group of functions is
perfectly fine.

In the case of your checkers problem, you can encapsulate in a
protocol the notion of being an undoable move:

(defprotocol UndoableMove
   (move [this b]  return the board or nil if it can't be applied)
   (undo [this b]  returns the board. Fails if it cannot be undone))

Then create a protocol for boards:

(defprotocol BoardLike
(apply-move [b m] Apply move m. Keep it in undo stack. Returns a board.)
(undo-last-move [b] Undo last move if any, else fails. Return a board))

(Note: I like better threading the board, even if it is updated in place.
It offers more flexibility: you can use persistent/transient or
mutable data-structures.
You can also decide to change representation of the board, if you want.)

What is essential though, is that if I use that to explore the game
tree, I would NOT use it
to represent the state of the game in rest of the program. Too many
way to stumble later.
I would convert the board into the mutable representation, and the
explore the game tree.
And copy back into an immutable board once done.

Transients are a good way to do this.

But the key is mutable state works for me for mono-thread, small localised code.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: using lein repl as the Emacs Inferior Lisp REPL as opposed to a custom script that does java -jar clojure-1.4.0.jar

2012-08-26 Thread Phil Hagelberg

It's impossible to do what you're asking, but you can still do what you want.

 This means for lein 1.7.1 it will use clojure 1.2.1, and for a recent
 lein 2.0.0-preview it will use clojure 1.4.0.

Upgrading to Leiningen 2.x is strongly encouraged and will get you
access to Clojure 1.4 anywhere. Using it via nrepl.el rather than
inferior-lisp will give you a much nicer experience.

-Phil

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

2012-08-26 Thread octopusgrabbus
Thanks for your answer. I will adapt the small number of programs I have to 
the newer version of the library. Rather than criticize your efforts in a 
language in which I am still very much a student, I will just say I miss 
the required optional syntax. Other than that, your library is extremely 
helpful, whether I have to back-adapt or not.

Thanks again. 

On Friday, August 24, 2012 7:41:56 PM UTC-4, Gaz wrote:

 The library was originally based on Clargon (a library I wrote) which 
 had the interface you are describing (optional and required 
 functions). Various changes were made after getting feedback on the 
 clojure-dev mailing list, which you can read about here if you're 
 interested: 

 https://groups.google.com/d/topic/clojure-dev/KGvzndhX5vk/discussion 

 Hopefully the project documentation is clear about its use: 

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

 Hope that helps, 

 Gaz 

 On Fri, Aug 24, 2012 at 2:52 PM, octopusgrabbus 
 octopus...@gmail.com javascript: wrote: 
  Given the following code 
  
  (defn parse-opts 
Using the newer cli library, parses command line args. 
[args] 
(cli args 
 (optional [--in-file-name .csv input file :default 
  resultset.csv] identity) 
 (optional [--out-file-name .csv pipe delimited output file 
  :default accumail_out.unl] ))) 
  
  What is the origin of optional, and why do tools.cli examples that I can 
  find now leave out (optional ... ? 
  
  Would current examples still use identity? 
  
  Here is why I'm asking: 
  
  
 http://stackoverflow.com/questions/12112403/how-do-i-mix-non-optional-cli-arguments-with-optional-ones
  
  
  Thanks for any pointers or help. 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.comjavascript: 
  Note that posts from new members are moderated - please be patient with 
 your 
  first post. 
  To unsubscribe from this group, send email to 
  clojure+u...@googlegroups.com javascript: 
  For more options, visit this group at 
  http://groups.google.com/group/clojure?hl=en 


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

Re: 'functional' performance VS 'imperative' complexity

2012-08-26 Thread Jim - FooBar();
Thanks for the snippet Nicolas but that is not the problem! I do know 
how to implement the 'undo' functionality...In OOP this is called the 
Command design pattern...The command interface has execute(from, to) 
and undo(from,to) (which calls execute with reversed arguments)...That 
part is not hard at all...the problem arises when trying to manage all 
this state (as you indicated)also since I 'm using reducers quite 
heavily, it is not easy to isolate mutation on 1 thread (it also seems 
impossible to do any pruning)... I would have to revert to single 
threaded execution in order to implement all this...


Jim

btw, my functional approach of undoing was simply to log every new board 
change in a vector via watches and atom. This way not only I can undo 
without calling 'move' but I can also serialize the entire history and 
have it available when you load the game back in! pretty cool and simple 
I think...


On 26/08/12 15:56, nicolas.o...@gmail.com wrote:

1. Gary Bernhardt has been playing with a new approach he calls
Functional Core, Imperative Shell. Essentially, it's another take on
the question of how to limit the scope of mutation in order to get the
most out of the correctness of mutation-free algorithms and the
performance of mutating data instead of replicating it.


It seems to be this treats of another question: how to have IO in a
functional world.
And it gives the classic answer: write the functional core and wrap s
small IO shell around.

Jim is asking another question: what if you can't get good enough
performance in a given algorithm
with persistent functional data structures.

My views is that state is difficult. Every state makes your program
harder to maintain and less modular.
However, a localised state to a function or a group of functions is
perfectly fine.

In the case of your checkers problem, you can encapsulate in a
protocol the notion of being an undoable move:

(defprotocol UndoableMove
(move [this b]  return the board or nil if it can't be applied)
(undo [this b]  returns the board. Fails if it cannot be undone))

Then create a protocol for boards:

(defprotocol BoardLike
 (apply-move [b m] Apply move m. Keep it in undo stack. Returns a board.)
 (undo-last-move [b] Undo last move if any, else fails. Return a board))

(Note: I like better threading the board, even if it is updated in place.
 It offers more flexibility: you can use persistent/transient or
mutable data-structures.
 You can also decide to change representation of the board, if you want.)

What is essential though, is that if I use that to explore the game
tree, I would NOT use it
to represent the state of the game in rest of the program. Too many
way to stumble later.
I would convert the board into the mutable representation, and the
explore the game tree.
And copy back into an immutable board once done.

Transients are a good way to do this.

But the key is mutable state works for me for mono-thread, small localised code.



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

2012-08-26 Thread Tyler Perkins
It might help to simplify. Whenever you're accumulating over a
sequence of things, think of reduce:

(let [__ (fn [ fs]
 ;;  Here's the function:
 (reduce #(fn [x] (%1 (%2 x))) fs))
 ]
 ;;  Testing:
 [ (= 5 ((__ (partial + 3) second) [1 2 3 4]))
   (= [3 2 1] ((__ rest reverse) [1 2 3 4]))
 ])

Each step in the accumulation creates a new function that just applies
the current function to an argument that is the result of applying the
already-composed ones.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: using lein repl as the Emacs Inferior Lisp REPL as opposed to a custom script that does java -jar clojure-1.4.0.jar

2012-08-26 Thread blais
Hi mperdikas.
I also like to have full control over my dependencies and versions, so I 
wrote a script that
- you give it a bunch of directories, and it automatically finds all the 
jars in them an resolves conflicts by selecting latest versions 
automatically
- prints the list of jars (explicitly saying what it does, which jars are 
included, that is a prerequisite IMO)
- starts a REPL with either swank or nrep or just a plain one
Another fun thing is that it's just a single Python script and so it starts 
fast,
and it does not fetch anything from the internet, so you won't run into 
problems working offline.
I sometimes run lein deps to fetch dependencies recursively, and from 
thereon I use streamlined.
For production you can save your jars in an svn repo or something, makes it 
easy to have a controlled deployment.
Anyway, I realize that's not the most common approach to running Clojure in 
this community, 
but I like to drive manual, so that's what I do, and it sound like you do 
too.
Find the script here:
http://furius.ca/pubcode/pub/conf/bin/streamlined.html



On Sunday, August 26, 2012 6:36:03 AM UTC-4, mperdikeas wrote:

 I am now using *Emacs 24.1.1* in *Ubuntu precise* and have managed to 
 install *Clojure-mode*. The next thing I want to do is to use *lein repl*as 
 my Emacs REPL (currently I've set 
 *inferior-lisp-program* to a custom bash script that simply does a *java 
 -jar clojure-1.4.0.jar*). The reason I've resorted to this approach is 
 that it is not clear to me how to control the Clojure version that *lein 
 repl* is using. As a result, although I have downloaded *clojure-1.4.0.jar
 * and am using that in my custom bash script, *lein* reports a totally 
 different Clojure, one that's different even from what */usr/bin/clojure*is:

 mperdikeas@ubuntu:~#
 $ which clojure
 /usr/bin/clojure
 mperdikeas@ubuntu:~#
 $ /usr/bin/clojure
 Clojure 1.1.0
 user= 
 mperdikeas@ubuntu:~#
 $ lein repl
 REPL started; server listening on localhost port 4840
 user= (clojure-version)
 1.2.1
 user= 
 mperdikeas@ubuntu:~#
 $ cat ./.emacs.d/clojure/repl.sh 
 java -jar ~/.emacs.d/clojure/clojure-1.4.0.jar
 mperdikeas@ubuntu:~#
 $ ./.emacs.d/clojure/repl.sh
 Clojure 1.4.0
 user= 

 So it seems that I have three different Clojures currently available but I 
 can't configure *lein repl *to use the latest one. I've read this SO 
 discussionhttp://stackoverflow.com/questions/10135440/lein-clojure-1-3-vs-clojure-1-2-1
  but 
 it seems to cover the case where *lein *is invoked in a directory 
 containing a *project.clj* file where the Clojure dependency can be set. 
 However:

 *[1]* I' ve experimented a bit with *lein repl* and found that I can 
 invoke it in any arbitrary directory. So where does it get the *
 project.clj* file in those cases?
 *[2]* In the *.emacs* file (according to this helpful 
 articlehttp://ubercode.de/blog/make-emacs-evaluate-clojure-in-5-minutes) 
 one 
 is supposed to do a:

 (progn ;; Inferior Lisp   
 
 
 (add-hook 'clojure-mode-hook ;; copied from:   

   (lambda ()
 (setq inferior-lisp-program lein repl))) 

 Again, where would *lein* look for the *project.clj* file in the above 
 case? And what if I just want to start writing Clojure in an Emacs buffer 
 without having setup a lein project structure? From where would then *lein 
 repl* get the Clojure version dependency in that case?





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

2012-08-26 Thread Sam Ritchie
Here's a solution using reduce that handles passing multiple arguments into
the rightmost function:

(fn [ fns]
(fn [ args]
  (let [[f  fns] (reverse fns)]
(reduce #(%2 %1) (apply f args) fns

On Sun, Aug 26, 2012 at 9:12 AM, Tyler Perkins thinks.outs...@gmail.comwrote:

 It might help to simplify. Whenever you're accumulating over a
 sequence of things, think of reduce:

 (let [__ (fn [ fs]
  ;;  Here's the function:
  (reduce #(fn [x] (%1 (%2 x))) fs))
  ]
  ;;  Testing:
  [ (= 5 ((__ (partial + 3) second) [1 2 3 4]))
(= [3 2 1] ((__ rest reverse) [1 2 3 4]))
  ])

 Each step in the accumulation creates a new function that just applies
 the current function to an argument that is the result of applying the
 already-composed ones.

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




-- 
Sam Ritchie, Twitter Inc
703.662.1337
@sritchie

(Too brief? Here's why! http://emailcharter.org)

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

Re: using lein repl as the Emacs Inferior Lisp REPL as opposed to a custom script that does java -jar clojure-1.4.0.jar

2012-08-26 Thread greg r
Hello, I am also using Leiningen in Ubuntu, and I feel your pain.
One thing I would suggest is to remove anything related to your tool chain 
which was installed by Ubuntu.
(except maybe emacs 24.x).
You clearly have Clojure installed via the usual Ubuntu Software Center or 
related mechanism.
Uninstall it!

I would skip directly to version 2 of Leiningen.
You will find that dependency jars get dropped into the hidden file 
~/.m2/repository,
for example, when you use the lein install command that is where they go.

Get clojure mode via the emacs package manager.  Get the latest!
I got stuck on an old version which caused much confusion.  I still see 
version 1.7.1
in the list of packages, whereas I have installed version 1.11.5.  I 
believe this is
due to my .emacs file setting package archives for ELPA, gnu, and 
marmalade, and
some obsolete stuff still exists and hazardous to the newbie.

I don't have anything related to slime or swank or swank-clojure installed 
via the
emacs package manager.  However, I do have lein-swank listed in my 
~/.lein/profile.clj
file.

Another thing to uninstall are any version of slime and swank which were 
installed
via the Ubuntu Software Center.  These caused lots of confusion.  This 
stuff may
also be hanging out in your ~/.emacs.d directory.

I installed version 24.x emacs manually.  I'm not familiar with Ubuntu 
Precise, but perhaps
that distribution is installing a usable version of emacs.  I had to 
install a few libraries
to get it all going, I think some X window related stuff using the Synaptic 
Package Manager.

M-x clojure-jack-in is the way to fire up a repl running in an emacs buffer.

I've got a working installation, it's easy to use and powerful, but if I 
said I could start from
scratch again and make it work in 5 minutes I would be a liar.  I think the 
best thing to do is a thorough
housecleaning, start from scratch with version 2 leiningen, emacs 24 and 
latest clojure-mode.

Good luck!  I'm test driving nrepl next.
Greg




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

2012-08-26 Thread meteorfox
Use-cases typically involve computer graphics applications, like simulating 
fire, or a galaxy, or just for art (
http://en.wikipedia.org/wiki/Particle_system). Personally, I just wanted to 
try out the concepts of protocols and defrecords in Clojure, and I 
thought vector math operations was a good problem to try these concept on 
(if you're interested they're in the utils.clj and corporum.clj files). 
There's still a lot of stuff that I need to add, and improve. 

To be honest, I didn't expect that it was going to be this smooth, I'm 
really surprised with the performance, I did some profiling of some 
small scenarios and I didn't find an obvious bottleneck in my code, but 
again I was not thorough and the scenarios
were trivial.

On Sunday, August 26, 2012 4:36:06 AM UTC-4, Mayank Jain wrote:

 So beautiful! May I know what are the use-cases for this?
 Thanks for sharing.

 On Sun, Aug 26, 2012 at 8:47 AM, meteorfox 
 ctorresk8...@gmail.comjavascript:
  wrote:

 I've been working in a particle system using Quil for rendering, which 
 I'm calling Newtonian for now ;) , just to practice some of the concepts of 
 protocols and defrecords. The project is still WIP. Any feedback will be 
 appreciate it.

 github.com:
 https://github.com/meteorfox/newtonian

 Vimeo: (Warning: Looks choppy in the video, because the frame rate I used 
 when I recorded it) 
 https://vimeo.com/48222827 

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




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

Re: Particle system with Quil

2012-08-26 Thread meteorfox
On Sunday, August 26, 2012 8:36:37 AM UTC-4, Sam Aaron wrote:

 Truly outstanding work! 

 Things like this really make me feel warm and fuzzy inside and more than 
 justify all the hard work that goes into libraries like Quil. 

 Please keep making beautiful things. 

 Sam 

 --- 
 http://sam.aaron.name 



You have done a wonderful job with Quil, Emacs Live, and Overtone. It was 
pretty straight forward to do the rendering with Quil, if I would've been 
using something else, like a plain old BufferedImage with JPanels and 
JFrames, 
or something similar, probably I would've never started it. 

:) Thanks
 


 On 26 Aug 2012, at 04:17, meteorfox ctorresk8...@gmail.com javascript: 
 wrote: 

  I've been working in a particle system using Quil for rendering, which 
 I'm calling Newtonian for now ;) , just to practice some of the concepts of 
 protocols and defrecords. The project is still WIP. Any feedback will be 
 appreciate it. 
  
  github.com: 
  https://github.com/meteorfox/newtonian 
  
  Vimeo: (Warning: Looks choppy in the video, because the frame rate I 
 used when I recorded it) 
  https://vimeo.com/48222827 
  
  Thanks! 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.comjavascript: 
  Note that posts from new members are moderated - please be patient with 
 your first post. 
  To unsubscribe from this group, send email to 
  clojure+u...@googlegroups.com javascript: 
  For more options, visit this group at 
  http://groups.google.com/group/clojure?hl=en 



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

Re: how to disconnect/quit the repl in nrepl.el?

2012-08-26 Thread Shanmu
Thanks, Tim! for a wonderful slime replacement :)

On Sunday, August 26, 2012 1:59:44 PM UTC+1, Tim King wrote:

 On Sat, Aug 25, 2012 at 11:12 AM, Shanmu shan...@gmail.com javascript:
  wrote:

 Hi All,
 Is there a way to disconnect/quit the repl in nrepl.el cleanly?


 Hi Shanmu,
 This is a open issue that has not been implemented yet.

 https://github.com/kingtim/nrepl.el/issues/33

 Cheers,
 Tim


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

Howto not reindent in (emacs) clojure-mode

2012-08-26 Thread Timothy Washington
Hey all,


There'll probably be a quick solution to this. But I have emacs with
clojure-mode installed. And it has this very annoying behaviour of
re-indenting a bracket if I hit return on a line just abouve it. I took a
look around and thought this line (
in ~/.emacs.d/elpa/install-dir/clojure-mode.el  ) might be the culprit.
But commenting it out didn't remove that behaviour. Is there another place
I can look to change this behaviour?

...
(defvar clojure-mode-map
  (let ((map (make-sparse-keymap)))
(set-keymap-parent map lisp-mode-shared-map)
(define-key map \e\C-x 'lisp-eval-defun)
(define-key map \C-x\C-e 'lisp-eval-last-sexp)
(define-key map \C-c\C-e 'lisp-eval-last-sexp)
(define-key map \C-c\C-l 'clojure-load-file)
(define-key map \C-c\C-r 'lisp-eval-region)
(define-key map \C-c\C-z 'run-lisp)
*;;(define-key map (kbd RET) 'reindent-then-newline-and-indent)
  *




(define-key map (kbd C-c t) 'clojure-jump-to-test)
map)
  Keymap for Clojure mode. Inherits from `lisp-mode-shared-map'.)
...



Thanks

Tim Washington
Interruptsoftware.ca
416.843.9060

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

2012-08-26 Thread Erlis Vidal
Hi guys,

I'm starting to use clojure.test but when I got a failing test I don't get
any information why the error failed.

for example if I evaluate this in the repl I just get *false* back

(is (= a b))

running the tests with (run-tests) give me this result back:

{:type :summary, :pass 2, :test 1, :error 0, :fail 1}

I would like to know if I'm missing something or maybe this is because I'm
using the lightable playground.

Thanks,
Erlis

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

2012-08-26 Thread Alan Malloy
I just use C-j instead of RET in the rare cases that I want to leave the 
previous line alone.

On Sunday, August 26, 2012 4:15:54 PM UTC-7, frye wrote:

 Hey all, 


 There'll probably be a quick solution to this. But I have emacs with 
 clojure-mode installed. And it has this very annoying behaviour of 
 re-indenting a bracket if I hit return on a line just abouve it. I took a 
 look around and thought this line ( 
 in ~/.emacs.d/elpa/install-dir/clojure-mode.el  ) might be the culprit. 
 But commenting it out didn't remove that behaviour. Is there another place 
 I can look to change this behaviour? 

 ... 
 (defvar clojure-mode-map
   (let ((map (make-sparse-keymap)))
 (set-keymap-parent map lisp-mode-shared-map)
 (define-key map \e\C-x 'lisp-eval-defun)
 (define-key map \C-x\C-e 'lisp-eval-last-sexp)
 (define-key map \C-c\C-e 'lisp-eval-last-sexp)
 (define-key map \C-c\C-l 'clojure-load-file)
 (define-key map \C-c\C-r 'lisp-eval-region)
 (define-key map \C-c\C-z 'run-lisp)
 *;;(define-key map (kbd RET) 'reindent-then-newline-and-indent) 
 *
 
 
 
   
 (define-key map (kbd C-c t) 'clojure-jump-to-test)
 map)
   Keymap for Clojure mode. Inherits from `lisp-mode-shared-map'.)
 ... 



 Thanks 

 Tim Washington 
 Interruptsoftware.ca 
 416.843.9060 

  

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

Newtonian Dance: A live performance with Newtonian and Quil.

2012-08-26 Thread meteorfox
Hi,

http://youtu.be/xiqWclsXdcc

I just wanted to share a live performance with Newtonian and Quil. The 
video has better frame rate than the first one, which shows better 
the fluidity of the particles , I changed the colors of the particles and 
also increased their size.
Instead of recording the whole desktop, now it's just the frame, with music.

Thanks

- Carlos Torres

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

2012-08-26 Thread Dave Ray
Hi,

It's probably better to ask on the seesaw mailing list [1] rather than
this more general list.

With the info you've given it's hard to tell, but I'd guess you're
setting the cursor and then doing a long-running operation in the UI
thread. When you do that, the cursor (and ui) is never updated. You'll
have to move the operation to another thread. Here's a rough sketch:

(do
  ; Set the cursor on the ui thread
  (seesaw/config! canvas :cursor :wait)
  (future
  (... something that takes a while on another thread ...)
  (invoke-later
 ; now restore the cursor on the ui thread.
(seesaw/config! canvas :cursor :default

regards,
dave

[1] https://groups.google.com/forum/?fromgroups#!forum/seesaw-clj

On Sun, Aug 26, 2012 at 7:17 AM, Jim - FooBar(); jimpil1...@gmail.com wrote:
 another question...why won't this do anything?

 (seesaw/config! canvas :cursor :wait) ;;canvas is a result of (seesaw/canvas
 ... ... ...)

 I also tried

 (seesaw/config! (seesaw/to-root canvas) :cursor :wait)

 but the proxied JFrame does not support the :cursor option!

 what am I missing?

 thanks
 Jim


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

2012-08-26 Thread Matthew Boston
Here's my output using the repl from leiningen 2 (nREPL)

user= (use 'clojure.test)
nil
user= (is (= a b))

FAIL in clojure.lang.PersistentList$EmptyList@1 (NO_SOURCE_FILE:1)
expected: (= a b)
  actual: (not (= a b))
false
user=

It tells me both the expected and actual. What else are you expecting?

On Sunday, August 26, 2012 7:40:48 PM UTC-4, Erlis Vidal wrote:

 Hi guys, 

 I'm starting to use clojure.test but when I got a failing test I don't get 
 any information why the error failed.

 for example if I evaluate this in the repl I just get *false* back

 (is (= a b))

 running the tests with (run-tests) give me this result back: 

 {:type :summary, :pass 2, :test 1, :error 0, :fail 1}

 I would like to know if I'm missing something or maybe this is because I'm 
 using the lightable playground.

 Thanks, 
 Erlis 


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

2012-08-26 Thread Tom Maynard

On 08/26/2012 07:12 PM, meteorfox wrote:

I just wanted to share a live performance with Newtonian and Quil.


I'm pretty sure that Sir Isaac would be proud to have his name 
associated with something as remarkable as that.  Well done!


Thank you for sharing that.
Tom.

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