Re: how to get good at clojure?

2012-05-09 Thread Alex Baranosky
In addition to what has already been said. There are a few approaches I take: 1) re-implement in Clojure some smallish project that you already have in another language practice seeing how to solve the same kinds of problems but using idiomatic Clojure approaches. Since the project is

Re: how to get good at clojure?

2012-05-09 Thread Ambrose Bonnaire-Sergeant
On Wed, May 9, 2012 at 2:08 PM, Alex Baranosky alexander.barano...@gmail.com wrote: 3) read through core.clj, like a fine classic novel. You'll get all sorts of good stuff through this process. I can't express deeply enough how important this is. Just DO IT. It's a fascinating read, but

Re: how to get good at clojure?

2012-05-09 Thread Meikel Brandmeyer (kotarak)
Hi, Am Mittwoch, 9. Mai 2012 08:08:10 UTC+2 schrieb Alex Baranosky: 3) read through core.clj, like a fine classic novel. You'll get all sorts of good stuff through this process. I can't express deeply enough how important this is. Just DO IT. I throw in a warning here. core.clj

Re: how to get good at clojure?

2012-05-09 Thread Alex Baranosky
Ambrose and Meikel, Those are excellent points, but IMO to really be a great clojure developer you really can't get away with not having read the classic goodness that is core.clj. :) And after that having read through the Java code at the core of Clojure: the interfaces and the reader etc. On

Re: how to get good at clojure?

2012-05-09 Thread Ambrose Bonnaire-Sergeant
+1 On Wed, May 9, 2012 at 2:38 PM, Alex Baranosky alexander.barano...@gmail.com wrote: Ambrose and Meikel, Those are excellent points, but IMO to really be a great clojure developer you really can't get away with not having read the classic goodness that is core.clj. :) And after that

Reducers

2012-05-09 Thread Christian Romney
All I can say is, wow! I do have some questions, though. Am I mistaken or is fork/join Java 7? Anyone have this running on OS X yet? If so with the Oracle preview or Open JDK? Also, core map and friends are lazy, reducer map and friends inherently parallel. We also have pmap/preduce. Can

Re: Reducers

2012-05-09 Thread Baishampayan Ghose
On Wed, May 9, 2012 at 4:26 PM, Christian Romney xmlb...@gmail.com wrote: Am I mistaken or is fork/join Java 7? Anyone have this running on OS X yet? If so with the Oracle preview or Open JDK? Yes, it's a part of Java 7, but there is also a reference implementation of the spec (jsr166y)

Re: Reducers

2012-05-09 Thread nicolas.o...@gmail.com
It looks very good. Just a few side-notes: - this representation is quite well known, as it is the Church encoding of list, often used in System F, for example. It corresponds to stating the definition of sequences as the initial algebra of F A = 1 + Any x A. - you can play a dual trick for

Re: Odd termination behaviour of a program that uses pmap

2012-05-09 Thread Muharem Hrnjadovic
Thank you very much indeed! On 05/08/2012 11:14 PM, Andy Fingerhut wrote: I've added some discussion about this behavior in an example for clojure.core/future on ClojureDocs.org here: http://clojuredocs.org/clojure_core/clojure.core/future Since people often come across this behavior

Re: Odd termination behaviour of a program that uses pmap

2012-05-09 Thread Jim - FooBar();
Does this mean we need to call (shutdown-agents) whenever we use futures (internally or explicitly)? I've never had any problems with clojure.java.shell/sh or pmap, albeit i've not used them extensively... Jim On 09/05/12 12:16, Muharem Hrnjadovic wrote: Thank you very much indeed! On

git dependencies in leiningen

2012-05-09 Thread Murtaza Husain
Hi, Does lein2 have a way to pull in dependencies from git ? Just checking any alternatives to https://github.com/tobyhede/lein-git-depsin leiningen itself. Thanks, Murtaza -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: A few questions about clojurescript lein-cljsbuild

2012-05-09 Thread Dave Barker
Thanks guys, I opened an issuehttps://github.com/emezeske/lein-cljsbuild/issues/87and I found a pretty good explanation about putting scripts inside the bodyhttp://stackoverflow.com/questions/1220956/move-jquery-to-the-end-of-body-tag . Good work with Clojurescript as well, it's really cool.

Re: clojure-hadoop

2012-05-09 Thread Sunil S Nandihalli
Hi, A little digging led me to clojure-hadoop.filesystem which had most of the context info I was interested in. Sunil. On Wed, May 9, 2012 at 2:02 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Everybody, I have been using clojure-hadoop with out knowing all the nitty-gritties

Re: Reducers

2012-05-09 Thread Rich Hickey
This analogy is not quite right. (fn [n] (vector n (+ n 1)) is not a reducing fn. Tt is a cons cell builder, and the Church encoding builds lists. The point of this library is to define map/filter etc *without* using lists/streams - not as input, not as output, not producing links/thunks

code as data vs. code injection vulnerability

2012-05-09 Thread Rostislav Svoboda
I think the topic 'code injection vulnerability' is never out of date especially if you treat data as a code. Unfortunately googling for - clojure code injection vulnerability - returns 'nil'. Any ideas? Comments? Opinions? Bost -- You received this message because you are subscribed to the

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Baishampayan Ghose
On Wed, May 9, 2012 at 6:01 PM, Rostislav Svoboda rostislav.svob...@gmail.com wrote: I think the topic 'code injection vulnerability' is never out of date especially if you treat data as a code. Unfortunately googling for - clojure code injection vulnerability - returns 'nil'. Any ideas?

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Tassilo Horn
Rostislav Svoboda rostislav.svob...@gmail.com writes: I think the topic 'code injection vulnerability' is never out of date especially if you treat data as a code. Unfortunately googling for - clojure code injection vulnerability - returns 'nil'. Any ideas? Comments? Opinions? I don't

Re: how to get good at clojure?

2012-05-09 Thread Bill Allen
This is the ticket. You can read all the books you want (and they do help), but working through 4clojure (and observing the solutions by others) will teach you more and better than anything else you can do. On Tue, May 8, 2012 at 4:08 PM, Bill Caputo logos...@gmail.com wrote: On May 7, 2012, at

Clojure smugmug.com api 1.2.2

2012-05-09 Thread Luke Carmichael
Hola, Like clojure, smugmug, and uploading your photos using clojure? Try a new wrapper for smugmug.com: https://github.com/halfaleague/trickyhappyface Thanks, Luke -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Clojurescript One getting started problem

2012-05-09 Thread J Elaych
I'm trying to work through the Clojurescript One Getting Started wiki page example found here: https://github.com/brentonashworth/one/wiki/Getting-started, but after running lein repl and entering (go), I get the Clojurescript One pages fine, including the development page, but then I lose the

Re: Reducers

2012-05-09 Thread nicolas.o...@gmail.com
On Wed, May 9, 2012 at 1:00 PM, Rich Hickey richhic...@gmail.com wrote: This analogy is not quite right. (fn [n] (vector n (+ n 1)) is not a reducing fn. Tt is a cons cell builder, and the Church encoding builds lists. It is because I did not write it in the right way. Sorry about that. It

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Walter Tetzner
On Wednesday, May 9, 2012 9:35:57 AM UTC-4, Tassilo Horn wrote: I don't think code-as-data contributes to code injection vulnerability, neither positively nor negatively. Simply don't `eval` code/data from sources you don't trust. I think it does contribute through the reader. If you are

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Walter Tetzner
On Wednesday, May 9, 2012 9:35:57 AM UTC-4, Tassilo Horn wrote: I don't think code-as-data contributes to code injection vulnerability, neither positively nor negatively. Simply don't `eval` code/data from sources you don't trust. I think it does contribute through the reader. If

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Tassilo Horn
Walter Tetzner robot.ninja.saus...@gmail.com writes: On Wednesday, May 9, 2012 9:35:57 AM UTC-4, Tassilo Horn wrote: I don't think code-as-data contributes to code injection vulnerability, neither positively nor negatively. Simply don't `eval` code/data from sources you don't trust. I

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Stephen Compall
On May 9, 2012 10:02 AM, Walter Tetzner robot.ninja.saus...@gmail.com wrote: I feel like `*read-eval*' should default to false, and you should have to explicitly bind it to true. Yes, but with 'load' binding it to true. You are evalling anyway, and else it would be quite difficult to use just

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Rostislav Svoboda
On 9 May 2012 15:35, Tassilo Horn tass...@member.fsf.org wrote: Simply don't `eval` code/data from sources you don't trust. In a client-server architecture the thing I (i.e. the server) don't trust is the client... and I'm not sure if I can ignore him just like that :) Bost -- You received

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Rostislav Svoboda
On 9 May 2012 15:57, Walter Tetzner robot.ninja.saus...@gmail.com wrote: I feel like *read-eval* should default to false, and you should have to explicitly bind it to true. Either that, or there should be 'safe' versions of Many people just copy-paste code snippets to their source files/repl

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Tassilo Horn
Rostislav Svoboda rostislav.svob...@gmail.com writes: Simply don't `eval` code/data from sources you don't trust. In a client-server architecture the thing I (i.e. the server) don't trust is the client... and I'm not sure if I can ignore him just like that :) Not evaluating everything a

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Craig Brozefsky
Rostislav Svoboda rostislav.svob...@gmail.com writes: Many people just copy-paste code snippets to their source files/repl withouth really knowing if they are safe or not safe. IMO it might help to rename the *read-eval* to something like *read-eval-ACHTUNG-danger*. For me - as a newbie -

Re: Accessing collections from Datomic datalog queries

2012-05-09 Thread Stuart Halloway
I've seen hinted (and I'm pretty sure I've seen examples, but I can't remember where) that Datomic can incorporate data from regular Clojure collections. Is there some doc for this or an example? Thanks in advance Hi Mark, I have moved this to the Datomic group and answered it there:

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Rostislav Svoboda
On 9 May 2012 17:31, Tassilo Horn tass...@member.fsf.org wrote: you should bind *read-eval* to false when reading data from unknown sources. This is the point! On one hand I need to evaluate data from a client on the other hand I'd like to filter out things like rm -rf /, drop table users etc.

Re: code as data vs. code injection vulnerability

2012-05-09 Thread nicolas.o...@gmail.com
On Wed, May 9, 2012 at 5:01 PM, Rostislav Svoboda rostislav.svob...@gmail.com wrote: On 9 May 2012 17:31, Tassilo Horn tass...@member.fsf.org wrote: you should bind *read-eval* to false when reading data from unknown sources. This is the point! On one hand I need to evaluate data from a client

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Michael Gardner
On May 9, 2012, at 11:01 AM, Rostislav Svoboda wrote: This is the point! On one hand I need to evaluate data from a client on the other hand I'd like to filter out things like rm -rf /, drop table users etc. To me it looks like a contradiction impossible to circumvent. So I ask if there's

Re: git dependencies in leiningen

2012-05-09 Thread Phil Hagelberg
On Wed, May 9, 2012 at 4:27 AM, Murtaza Husain murtaza.hus...@sevenolives.com wrote: Does lein2 have a way to pull in dependencies from git ? Just checking any alternatives to https://github.com/tobyhede/lein-git-deps in leiningen itself. I highly recommend using Leiningen's built-in

...regarding Clojure's STM performance and scalability

2012-05-09 Thread Jim - FooBar();
Hello all, I'm going to keep this as short as possible...basically this guy came today in Machester uni to talk to all postgrads about work he's done on STM implementations for Microsoft research. In a nutshell, and very general he highlighted the following: 1. general purpose STM systems

Re: ...regarding Clojure's STM performance and scalability

2012-05-09 Thread Stefan Kamphausen
Hi, if he was talking about the things, Joe Duffy describes on [1], those were way more general purpose. Clojure carefully combines several features, (i.e. immutable data, persistent datastructures, reference types) to allow the current implementation of STM. For example Clojure does not

Re: ...regarding Clojure's STM performance and scalability

2012-05-09 Thread Jim - FooBar();
The exact paper is this (called STM In the small): http://www.google.co.uk/url?sa=trct=jq=stm%20spectmsource=webcd=3sqi=2ved=0CGEQFjACurl=http%3A%2F%2Finfoscience.epfl.ch%2Frecord%2F174888%2Ffiles%2Feuro170-dragojevic.pdfei=BcGqT8vSJsHf8AOfwYjjBAusg=AFQjCNEITMgowGA_QZHUrJTAqSnphild0w from a

Re: ...regarding Clojure's STM performance and scalability

2012-05-09 Thread Timothy Baldridge
So clojure's STM does not fall under the general purpose category with terrible preformance he was referring to? This is correct. Clojure has very few ways of modifying global state. 99% of your clojure code should be immutable. Immutable data does not need to be protected by a STM. In that

Re: ...regarding Clojure's STM performance and scalability

2012-05-09 Thread Herwig Hochleitner
One thing to consider here is, that when trying to implement general purpose STM for an imperative language, basically every assignment is a candidate for a write conflict, akin to a ref-set in clojure's STM. OTOH in idiomatic clojure there are no assignments, only lexical bindings, new versions

Re: ...regarding Clojure's STM performance and scalability

2012-05-09 Thread Mark Engelberg
The important thing to remember is that most researchers/programmers are looking for a silver bullet for concurrency that will allow programmers to get semantically correct programs *without having to change the way they think or do things*. The idea is to take a typical imperative program and

Re: The Kiln, an Evaulation Strategy for Insanely Complex Functions

2012-05-09 Thread Jeffrey Straszheim
On Tuesday, May 8, 2012 11:18:42 AM UTC-4, Andrew wrote: Cool... Do you use kilns at Akamai, and to what extent? Another question: you set up coals and clays and eventually kilns are fired. When you're setting up the coals and clays in code, you're telling the system about dependencies.

Re: The Kiln, an Evaulation Strategy for Insanely Complex Functions

2012-05-09 Thread Jeffrey Straszheim
Well, I’m not sure what you mean. It does nothing specific with the “data types” as such, so I would say, no, that isn’t it. On Monday, May 7, 2012 10:59:22 AM UTC-4, cperkins wrote: I like it. Kiln looks like it is automatically composing the request handler based mostly on a description

Re: ...regarding Clojure's STM performance and scalability

2012-05-09 Thread Jim - FooBar();
Thanks all of you for your input... i was suspecting that i would get replies like these...they all basically come down to the same conclusion, that the functional style favours the STM abstraction and avoids some of its inherent bottlenecks... just one more thing though... what i omitted

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Stuart Halloway
This is the point! On one hand I need to evaluate data from a client on the other hand I'd like to filter out things like rm -rf /, drop table users etc. To me it looks like a contradiction impossible to circumvent. So I ask if there's anything like best practices or even better something

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Lee Spector
On May 9, 2012, at 12:15 PM, Michael Gardner wrote: I've never understood why anyone would use prn/read for data transfer, other than extreme laziness. But extreme laziness is an excellent reason! Larry Wall called laziness the first great virtue of a programmer. -Lee -- You received

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Softaddicts
On May 9, 2012, at 12:15 PM, Michael Gardner wrote: I've never understood why anyone would use prn/read for data transfer, other than extreme laziness. When I encounter the ancestor of XML in the mid 80s, SGML, it was used as a typesetting tool for laser printers, just before the

Re: Reducers

2012-05-09 Thread Christian Romney
I would be indebted to you if you could point me in the direction of the reading material necessary to follow this discussion. I'm afraid I'm currently out of my depth, but very eager to understand. Sincerely, Christian Romney -- You received this message because you are subscribed to the