[ANN] lib-noir 0.1.1

2012-06-24 Thread Anthony Grimes
Chris Granger and I decided that a lot of the stuff in Noir is also useful outside of Noir, so I took a bunch of Noir's middleware and such and split it out into a new library called lib-noir. You can find it here: https://github.com/noir-clojure/lib-noir It has Noir's stateful session/flash

Re: Difference between defrecord and extend

2012-06-24 Thread Daniel Skarda
Chas, thank you for the explanation, it confirmed my vague thoughts I had after quick review of Clojure source code and inspection of values in prototype maps before and after the change. I understand the difference, however I think there are three points to consider from Clojure design point

How to convert a python list to clojure?

2012-06-24 Thread Antonio Recio
I have this list in python: cc = list() for i in range(256): cc.append(ctf.GetColor(float(i) / 255.0)) And I would know if this is correct conversion in clojure? (def cc [(for [i (range 256)] (.. ctf GetColor (/ i 255.0)))]) -- You received this message because you are subscribed to

Re: How to convert a python list to clojure?

2012-06-24 Thread Sun Ning
Take a look at my pyclj library, which could dump/loads clojure literal to python data structures. https://github.com/sunng87/pyclj You can dump you cc and use read-string to load it into clojure. import clj print clj.dumps(cc) On 06/24/2012 06:05 PM, Antonio Recio wrote: I have this list

Re: How to convert a python list to clojure?

2012-06-24 Thread Michael Klishin
Antonio Recio: And I would know if this is correct conversion in clojure? (def cc [(for [i (range 256)] (.. ctf GetColor (/ i 255.0)))]) It is correct in the sense that it will do the same thing. If you have a collection and need to calculate a value for every element in it and

Re: How to convert a python list to clojure?

2012-06-24 Thread Vinzent
I think versions with `for` is a hell more readable. I vote for this: (def cc (for [i (range 256)] (.GetColor ctf (/ i 255.0 воскресенье, 24 июня 2012 г., 16:15:14 UTC+6 пользователь Michael Klishin написал: Antonio Recio: And I would know if this is correct conversion in

Re: Difference between defrecord and extend

2012-06-24 Thread Chas Emerick
Dan, Re: (2), yes, using higher-order functions effectively is a big part of functional programming. But, no, passing a var to HOFs in every case instead of dereferencing its value is not a good blanket policy. You need to have a clear notion of what you want to happen and what the contract

Re: [ANN] milieu - the environmentally friendly configuration tool (version 0.5.0)

2012-06-24 Thread Softaddicts
Funny, We implemented something similar using zookeeper (thanks to David for zookeeper-clj). We store data as Clojure expressions. This was a move to have a cluster unified view of configuration data and go away from alien representations (we used Yaml in several places). I can't see the added

Trying to scrape multiple files in parallel using proxies and agents

2012-06-24 Thread Folcon
Hey Everyone, I've been using lamina channels to create queues to download files/web pages in parallel. I'm using clj-http as my client as it supports proxies. So basically I create a channel, then use map* to fetch process and queue up pages in the channel. My fetch-url-with-proxy function,

Re: ClojureScript instead of CoffeeScript for complete web app development?

2012-06-24 Thread Jacobo Polavieja
On Saturday, June 23, 2012 12:43:38 AM UTC+2, wingie wrote: Since you love FP I wanted to mention another option: LiveScript http://gkz.github.com/LiveScript/blog/functional-programming-in-javascript-using-livescript-and-prelude-ls.html http://gkz.github.com/LiveScript

Anyone using Sublime Text 2 + SumblimeREPL with Windows?

2012-06-24 Thread Jacobo Polavieja
Hi there, My current development environment is that: Sublime Text 2 editor with the fabulous SublimeREPL plugin to be able to copy code into the Clojure REPL. As absurd as it may seem... I can't find the combination of keys to send functions or selected code to the REPL. It's supposed to be

struggling with two simple list of lists operations

2012-06-24 Thread Andy Coolware
Hi, I am looking for two seemingly simple operations which require adding to the list: (( 1 2 ) ( 20 30) (40)) 50 = (( 1 2 ) ( 20 30) (40 50)) and (( 1 2 ) ( 20 30) (40 50)) 60 = (( 1 2 ) ( 20 30) (40 50) (60)) Basically it is appending an element as a list to the list

Re: struggling with two simple list of lists operations

2012-06-24 Thread Vinzent
I guess you should use vectors, since you can't effectively add an element to the end of list. понедельник, 25 июня 2012 г., 0:46:24 UTC+6 пользователь Andy C написал: Hi, I am looking for two seemingly simple operations which require adding to the list: (( 1 2 ) ( 20 30) (40)) 50

Re: struggling with two simple list of lists operations

2012-06-24 Thread Alex Baranosky
Yeah, this becomes much more straightforward using vectors. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your

How I can convert this python line to clojure?

2012-06-24 Thread Antonio Recio
I have this python line that gives the number 1 as result print vtkDataObject.FIELD_ASSOCIATION_CELLS ;= 1 And I would like to convert it to clojure.I have tried this 3 way, but I think they are incorrect. Which is the correct way? (println (vtkDataSetAttributes.SCALARS)) ;=

Re: How I can convert this python line to clojure?

2012-06-24 Thread Antonio Recio
The python line that I have rote before is not the one that I want to convert. The correct python line is this, and the result is 0. How I can convert it to clojure? print vtkDataSetAttributes.SCALARS ;= 0 -- You received this message because you are subscribed to the Google Groups Clojure

Re: struggling with two simple list of lists operations

2012-06-24 Thread Andy Coolware
I know, but this is list :-) -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from

Re: Difference between defrecord and extend

2012-06-24 Thread Daniel Skarda
Chas, once again thank you for very detailed explanation :) I have not seen all the implications of language implementation on top of JVM. I spent some time thinking about the issue and now I see all design choices and trade-offs, especially when type/prototype system must be fast and thread

Re: struggling with two simple list of lists operations

2012-06-24 Thread Tyler Perkins
I discovered partition-all and came up with this function: (fn [l x] (concat (butlast l) (partition-all 2 (concat (last l) [x] user ((fn [l x] (concat (butlast l) (partition-all 2 (concat (last l) [x] '() 10) ((10)) user ((fn [l x] (concat (butlast l) (partition-all 2

Re:struggling with two simple list of lists operations

2012-06-24 Thread Moritz Ulrich
Andy Coolware andy.coolw...@gmail.com writes: Hi, I am looking for two seemingly simple operations which require adding to the list: (( 1 2 ) ( 20 30) (40)) 50 = (( 1 2 ) ( 20 30) (40 50)) and (( 1 2 ) ( 20 30) (40 50)) 60 = (( 1 2 ) ( 20 30) (40 50) (60))

Re: struggling with two simple list of lists operations

2012-06-24 Thread Tyler Perkins
Or even shorter, but maybe not as fast because it flattens the given list, then pairs it up again. Thus it also assumes the resulting list should consist ENTIRELY of pairs and singletons, not just the last or penultimate element: (fn [l x] (partition-all 2 (concat (flatten l) [x]))) On Jun 24,

Re: Anyone using Sublime Text 2 + SumblimeREPL with Windows?

2012-06-24 Thread Charlie Griefer
On Sun, Jun 24, 2012 at 11:20 AM, Jacobo Polavieja jacobopolavi...@gmail.com wrote: Hi there, My current development environment is that: Sublime Text 2 editor with the fabulous SublimeREPL plugin to be able to copy code into the Clojure REPL. As absurd as it may seem... I can't find the

Could not locate clojure/contrib/string__init.class or clojure/contrib/string.clj on classpath:

2012-06-24 Thread omer
hi i need help!!! i have a project to finish but i keep on hitting this error: Could not locate clojure/contrib/string__init.class or clojure/contrib/string.clj on classpath: i tried everything i know (which is not much) and i read tons of metiral in the net, but i still cant figure out how to

Re:Could not locate clojure/contrib/string__init.class or clojure/contrib/string.clj on classpath:

2012-06-24 Thread Moritz Ulrich
omer omeryco...@gmail.com writes: hi i need help!!! i have a project to finish but i keep on hitting this error: Could not locate clojure/contrib/string__init.class or clojure/contrib/string.clj on classpath: i tried everything i know (which is not much) and i read tons of metiral in the

Re: Anyone using Sublime Text 2 + SumblimeREPL with Windows?

2012-06-24 Thread Jacobo Polavieja
On Sunday, June 24, 2012 11:27:44 PM UTC+2, Charlie Griefer wrote: On Sun, Jun 24, 2012 at 11:20 AM, Jacobo Polavieja wrote: Hi there, My current development environment is that: Sublime Text 2 editor with the fabulous SublimeREPL plugin to be able to copy code into the Clojure

Re: Anyone using Sublime Text 2 + SumblimeREPL with Windows?

2012-06-24 Thread Charlie Griefer
On Sun, Jun 24, 2012 at 2:54 PM, Jacobo Polavieja jacobopolavi...@gmail.com wrote: In fact, those are some of the many ones I've tried, without success. When I press that combination it just writes the lowercase L, as if I wasn't pressing the F2 button. I've tried it with both my notebook and

Re:Could not locate clojure/contrib/string__init.class or clojure/contrib/string.clj on classpath:

2012-06-24 Thread עומר כהן
I'm trying to use contrib.string and i'm currently using clojure 1.3... Basiclly i need the fuctionalty of . String as split, and such... On 25 בJun 2012 00:53, Moritz Ulrich mor...@tarn-vedra.de wrote: omer omeryco...@gmail.com writes: hi i need help!!! i have a project to finish but i

Re: Could not locate clojure/contrib/string__init.class or clojure/contrib/string.clj on classpath:

2012-06-24 Thread Moritz Ulrich
Try clojure.string: http://clojuredocs.org/clojure_core/clojure.string It's available in 1.3 and replaces clojure.contrib.string. You can also access all methods of java.lang.String via java interop. On Mon, Jun 25, 2012 at 12:12 AM, עומר כהן omeryco...@gmail.com wrote: I'm trying to use

Re: Anyone using Sublime Text 2 + SumblimeREPL with Windows?

2012-06-24 Thread Jacobo Polavieja
On Monday, June 25, 2012 12:05:17 AM UTC+2, Charlie Griefer wrote: On Sun, Jun 24, 2012 at 2:54 PM, Jacobo Polavieja jacobopolavi...@gmail.com wrote: In fact, those are some of the many ones I've tried, without success. When I press that combination it just writes the lowercase L, as

Re: Anyone using Sublime Text 2 + SumblimeREPL with Windows?

2012-06-24 Thread Charlie Griefer
On Sun, Jun 24, 2012 at 3:59 PM, Jacobo Polavieja jacobopolavi...@gmail.com wrote: On Monday, June 25, 2012 12:05:17 AM UTC+2, Charlie Griefer wrote: Just to confirm... you're hitting F2, releasing F2, and _then_ hitting the l key, correct? Not both keys simultaneously? I've tried both

Re: Anyone using Sublime Text 2 + SumblimeREPL with Windows?

2012-06-24 Thread Jacobo Polavieja
On Monday, June 25, 2012 1:05:42 AM UTC+2, Charlie Griefer wrote: On Sun, Jun 24, 2012 at 3:59 PM, Jacobo Polavieja wrote: On Monday, June 25, 2012 12:05:17 AM UTC+2, Charlie Griefer wrote: Just to confirm... you're hitting F2, releasing F2, and _then_ hitting the l key, correct?

Re: Anyone using Sublime Text 2 + SumblimeREPL with Windows?

2012-06-24 Thread Charlie Griefer
On Sun, Jun 24, 2012 at 4:15 PM, Jacobo Polavieja jacobopolavi...@gmail.com wrote: On Monday, June 25, 2012 1:05:42 AM UTC+2, Charlie Griefer wrote: On Sun, Jun 24, 2012 at 3:59 PM, Jacobo Polavieja  wrote: On Monday, June 25, 2012 12:05:17 AM UTC+2, Charlie Griefer wrote: Just to

{ANN} Project Docs and Examples ... at the Alcove

2012-06-24 Thread John Gabriele
Hi all, I was looking for a way to: * encourage folks to write docs for their Clojure projects * make usage examples available (like clojuredocs.org has, but for general Clojure-related projects) * help semi-standardize how Clojure projects are documented So I made this:

Re: {ANN} Project Docs and Examples ... at the Alcove

2012-06-24 Thread Michael Klishin
John Gabriele: Opinions? Concerns? Wild praise? Searing complaints? General disinterest? This is a great initiative but so far it seems to focus only on the API reference part of documentation. I personally think that documentation guides are just as important [1]. For clojurewerkz.org

Re: {ANN} Project Docs and Examples ... at the Alcove

2012-06-24 Thread Vinzent
It's a great initiative indeed, but I found the project pretty useless in its current state. Forking the repo and sending a pull request just to add an example is painful. Also, I can read rendered readme on github (and have the source code at hand), so why go to another site? I think what

Re: {ANN} Project Docs and Examples ... at the Alcove

2012-06-24 Thread John Gabriele
On Jun 25, 12:14 am, Michael Klishin michael.s.klis...@gmail.com wrote: John Gabriele: Opinions? Concerns? Wild praise? Searing complaints? General disinterest? This is a great initiative but so far it seems to focus only on the API reference part of documentation. I'd think that

Re: {ANN} Project Docs and Examples ... at the Alcove

2012-06-24 Thread John Gabriele
On Jun 25, 12:52 am, Vinzent ru.vinz...@gmail.com wrote: It's a great initiative indeed, but I found the project pretty useless in its current state. Forking the repo and sending a pull request just to add an example is painful. Hm. Thanks for the feedback. Also, I can read rendered readme