I'd vote for it. *smiles*
On Feb 8, 2:23 am, Baishampayan Ghose b.gh...@ocricket.com wrote:
Hi,
This is an interesting attempt by the StackOverflow people to promote
FOSS
projectshttp://meta.stackoverflow.com/questions/31913/open-source-advertising
sidebar-1h-2010/31972
Hi all.
I'm trying to learn clojure with the excellent Programming Clojure
and projecteuler.net. I am encountering the java heap space error, and
can't find a workaround, nor a smarter way to write my code (which I
am certain exist).
Trying to solve Problem 14 (some spoilers might be ahead, for
Hello Clojure group
I am testing Clojure and I have an error parsing thix XML excerpt
below.
Is this a SAX bug ou a Clojure bug .. or my mistake ?
thank's for help
IN REPL
(ns x (:require [clojure.xml :as xml]) )
x= (try (xml/parse exampleSortieXML.xml)(catch Exception e (. e
Thanks, that answers my questions.
--
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
Hi,
There are several blog posts about setting up a development
environment for Clojure mostly in Emacs (and on Linux or Mac and not
Windows). Is there one place where I can find up-to-date information
on how to create a real-world Clojure project (and using Clojure and
Java libraries)? Do you
I know that loo exists - and I'm puzzled by what the lazy functions
do.
What I think would be interesting functionality is to have an emitter/
collector combination, for example:
(collect
(doseq [ n (range 10)]
(when (even? n) (emit n
would return the list (0 2 4 6 8). Any ideas how I
That's exactly what Debian does. For every Java package also provide
the maven xml file and the jar is discoverable from maven. The
installed packages on the local system acts as a local maven repo.
http://wiki.debian.org/Java/MavenRepoSpec
I see they also solved the problem of not
Hi,
I was just wondering if (by now) Open CL has been 'wrapped' by higher
level languages. I came across these from the Khronos site (http://
www.khronos.org/developers/resources/opencl/#timplementations) -
1. http://ruby-opencl.rubyforge.org/
2.
(Disclaimer: never tried myself)
http://hausheer.osola.com/docs/5
2010/2/10 Aviad R avi@gmail.com
Hi all.
I'm trying to learn clojure with the excellent Programming Clojure
and projecteuler.net. I am encountering the java heap space error, and
can't find a workaround, nor a smarter way
Not sure about Clojure bindings but the JavaCL bindings (both
mid-level and low level) might get you closer:
http://code.google.com/p/javacl/
OpenCL's ugly and finicky API is crying out for wrapping in better
languages; and the OpenCL language itself would ideally get wrapped
as well (see:
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
2010/2/9 abaitam abai...@gmail.com:
Hi,
There are several blog posts about setting up a development
environment for Clojure mostly in Emacs (and on Linux or Mac and not
Windows). Is there one place where I can find up-to-date information
on how to create a real-world Clojure project (and
This type of stuff could be done easily w/ the existing sequence fns
You first one is simply
(filter even? (range 10))
The second one is a little trickier, but it could be written like this
(map (juxt identity #(* 2 %))
(filter even?
(range 10)))
This is usually considered better form
Hi,
On Feb 10, 12:31 am, Brian Schlining bschlin...@gmail.com wrote:
That's exactly what Debian does. For every Java package also provide
the maven xml file and the jar is discoverable from maven. The
installed packages on the local system acts as a local maven repo.
Hello Yvan,
I guess it's neither a clojure nor java SAX parser problem, but rather
a problem in the xml file itself.
It is illegal to have ampersands in attributes values.
The ampersand should be replaced by amp; everywhere in attribute
values. In other case, the xml parser tries to resolve
From his todo list (1), it looks as if ztellman (2) might have
concrete plans to include it in the (currently OpenGL) wrapper project
penumbra (3).
1. http://wiki.github.com/ztellman/penumbra/todo
2. http://ideolalia.com/
3. http://github.com/ztellman/penumbra
On Feb 9, 9:48 pm, ka
Here is the proof I was searching !
http://www.w3.org/TR/xml/#NT-AttValue
2010/2/10 Laurent PETIT laurent.pe...@gmail.com:
Hello Yvan,
I guess it's neither a clojure nor java SAX parser problem, but rather
a problem in the xml file itself.
It is illegal to have ampersands in attributes
+1 on this. Although of course you could just use the shell for this
(e.g. grep or awk). But it's certainly nicer to have that integrated
in the compiler (possibly also in the compiled code?)
On Feb 9, 12:45 pm, Jeff Rose ros...@gmail.com wrote:
I agree, the error reporting from the compiler can
On 10 Feb, 12:23, Mark Carter alt.mcar...@googlemail.com wrote:
Any ideas how I could implement
this?
I've made a stab at it, but I'm not there yet.
(import (java.util ArrayList List))
(defn arraylist-list [aList]
(let [size (. aList size)]
(loop [accum nil
index 0]
thank you.
I have -server and -Xmx1024m set in my 'swank-clojure-extra-vm-args, but
the problem remains.
Aviad
On 10 February 2010 15:57, Joop Kiefte iko...@gmail.com wrote:
(Disclaimer: never tried myself)
http://hausheer.osola.com/docs/5
2010/2/10 Aviad R avi@gmail.com
Hi all.
Hi,
On Feb 10, 1:23 pm, Mark Carter alt.mcar...@googlemail.com wrote:
I know that loo exists - and I'm puzzled by what the lazy functions
do.
What I think would be interesting functionality is to have an emitter/
collector combination, for example:
(collect
(doseq [ n (range 10)]
It looks like you want to implement something akin to what other
languages call generators.
In Clojure, we generally use list comprehensions to get (almost) the
same effect, but it's a little cleaner in my opinion.
eg. in your first two examples
(collect
(doseq [ n (range 10)]
(when (even?
Hello Group,
I'm working on a Clojure project and I'm using Leiningen for the
builds. I'm trying to use the most recent clojure and clojure-
contrib, but I'm having a problem getting it to compile due to
apparent errors in clojure.contrib.string. This works fine on the
more stable versions of
There are some bugs with my previous post. Here's a revised version.
;;--USING LIST COMPREHENSIONS---
(for [n (range 10) :when (even? n)] n)
(apply concat
(for [n (range 10) :when (even? n)]
[n (* 2 n)]))
;;EMIT/COLLECT IMPLEMENTATION--
(def -collector)
(defn
Patrick,
I can't speak for the OP, but I found his question interesting and I'd like to
compliment you on your response. You gave alternative Clojure-like ways to do
the same thing, but in addition to that you actually answered his question.
I find these kinds of responses very instructive
On 10 Feb, 15:57, CuppoJava patrickli_2...@hotmail.com wrote:
Here's a revised version.
OK. Wow guys. Thanks for your help. I've still a lot to learn, being
new to Java, Lisp and Clojure.
You are right, generators was the kind of thing I was after.
I had come to Clojure after I had given up
It sounds like Clojure might be a good fit for you then. I personally
came to Clojure after getting fed up with Java, and experimenting with
Ruby, so I can understand your predicament.
The most dangerous thing to watch out for, and this really can't be
stressed enough, is that learning Clojure is
yes,thank you, this looks very helpful
On Feb 9, 3:44 pm, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
I wrote up a post:http://tr.im/NwCL
Hope it helps.
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group,
Aviad,
Welcome to Clojure.
I don't want to tell you how to solve it. That's all part of the fun.
But my hint to you would be that you don't need to keep all 1 million
lists in memory. In fact, you should be able to solve this problem by
only keeping three numbers in memory at any one time: The
Hi,
yvan wrote:
Hello Clojure group
I am testing Clojure and I have an error parsing thix XML excerpt
below.
Is this a SAX bug ou a Clojure bug .. or my mistake ?
thank's for help
IN REPL
(ns x (:require [clojure.xml :as xml]) )
x= (try (xml/parse exampleSortieXML.xml)(catch
Hi Matt,
Just pushed a fix, see if that helps.
Note that argument order was reversed in most functions from c.c.str-
utils2 to c.c.string.
-SS
On Feb 10, 10:44 am, Matt Culbreth mattculbr...@gmail.com wrote:
Hello Group,
I'm working on a Clojure project and I'm using Leiningen for the
Hi guys,
I'm new to both clojure and functional programming and as an exercise
in learning Clojure, I decided to write a naive bayes categorizer. I
have a piece of code wherein I have a doseq inside which i am calling
a function which returns a value. What I would like to do is have the
value
On 10 Feb, 16:21, Greg g...@kinostudios.com wrote:
Patrick,
I can't speak for the OP, but I found his question interesting and I'd like
to compliment you on your response.
I've been experimenting with Patrick's solution - and it's really
quite good. I had a function which collected the
Hi Aviad,
Disclaimer: I haven't read the book, nor do I know Clojure very well.
However, based on your question (which I did read) and Brenton's hint, it seems
to me like the solution will involve a lazy sequence, which is a frequent tool
to use whenever you're dealing with a problems that
I ran across this on reddit this morning, and thought people on the
group might find it interesting:
http://docs.google.com/viewer?url=http%3A%2F%2Fresearch.sun.com%2Fprojects%2Fplrg%2FPublications%2FICFPAugust2009Steele.pdfpli=1
It actually mentions clojure briefly at the end, although I'm not
chaosprophet,
Clojure wants you to think in terms of sequences instead to loops.
Instead to looping through cat-all and keeping track of the sum, you
want to use map and reduce.
(reduce + (map #(probability-of-category-given-document % tokens) cat-
all))
Brenton
On Feb 10, 7:14 am,
Thank you all!
your advice were indeed very helpful!
I eventually solved it using memoization. and indeed keeping only
(http://clojure-euler.wikispaces.com/Problem+014 - lxmonk if you're
interested)
This indeed is a great community, so let me try another (related) question.
Comparing my
אביעד
On 10 February 2010 19:54, Aviad Reich avi@gmail.com wrote:
Thank you all!
your advice were indeed very helpful!
I eventually solved it using memoization. and indeed keeping only 3 values
in memory.
(http://clojure-euler.wikispaces.com/Problem+014 - lxmonk, if you're
Aviad,
You don't get a speedup because you are never calling the memoized
function with the same arguments. In your code, n is different each
time.
memoize basically creates a map of arguments to results. When you call
the function with args that it has seen before it bypasses actually
calling
Looking at your post I notice some things that strike me as 'odd'.
The use of (def) in a form that is not a top most form. From my
experience this leads to trouble in the best of times. I think a
better way would be to close over your known-map with a closure.
While I don't have high hopes that
Yes that worked very well, thanks Stuart. I'm assuming that this fix
will make its way to the nightly build and will be published to
http://build.clojure.org/job/clojure-contrib/ as usual?
On Feb 10, 12:32 pm, Stuart Sierra the.stuart.sie...@gmail.com
wrote:
Hi Matt,
Just pushed a fix, see if
yes
On Feb 10, 1:25 pm, Matt Culbreth mattculbr...@gmail.com wrote:
Yes that worked very well, thanks Stuart. I'm assuming that this fix
will make its way to the nightly build and will be published
tohttp://build.clojure.org/job/clojure-contrib/as usual?
On Feb 10, 12:32 pm, Stuart Sierra
A few months back I created very basic bindings for CL4Java (the code
for it still exists in Penumbra, under src/opencl). It then
subsequently was renamed to JOCL, which was already in use by another
OpenCL library, and they started to work on combining their efforts,
and I decided to wait until
Meikel,
As a beginner, I tried running the first example,changing namespaces
or not, etc ,and I keep getting
user= (ns some.Example
(gen-class))
nil
some.Example= (defn -toString
[this]
HI !)
#'some.Example/-toString
some.Example= (ns user)
nil
What he said is basically right, only instead of list it's called
vector. Not sure if vector branching is 64 or 32.
On 10 fev, 15:42, Paul Mooser taron...@gmail.com wrote:
I ran across this on reddit this morning, and thought people on the
group might find it interesting:
Hello,
I apologize in advance it this is an inappropriate forum for this
message.
I organize the Detroit Java User Group (www.detroitjug.org) and I'd
like to find a knowledgeable speaker who
can present Clojure to our JUG. If there are any members of the
group in the Michigan or Ohio area that
Hi,
Am 10.02.2010 um 21:05 schrieb Brian Wolf:
As a beginner, I tried running the first example,changing namespaces
or not, etc ,and I keep getting
user= (ns some.Example
(gen-class))
nil
some.Example= (defn -toString
[this]
HI !)
hi,
is there a query to tell me if a datatype implements a particular
protocol? i'm guessing there must be some forehead-slapping answer,
but i haven't gleaned the clue yet :-{
thanks.
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this
2010/2/10 André Ferreira greis...@gmail.com:
What he said is basically right, only instead of list it's called
vector. Not sure if vector branching is 64 or 32.
If you could append two vectors quickly in Clojure, you'd be able to
use a lot of the techniques described in those slides.
The whole
On 7 feb, 13:09, Hubert Iwaniuk neo...@kungfoo.pl wrote:
Great to hear that there is Clojure group around.
For ease of finding
it:http://groups.google.com/group/amsterdam-clojurians?hl=en
Cheers,
Hubert
Joined as well. I'm in Utrecht.
Shame I missed today's meeting.
--
You received
No need to slap your forehead, but here it is:
-
clojure.core/extends?
([protocol atype])
Returns true if atype explicitly extends protocol
-SS
On Feb 10, 4:03 pm, Raoul Duke rao...@gmail.com wrote:
hi,
is there a query to tell me if a datatype implements a
On Wed, Feb 10, 2010 at 1:20 PM, Stuart Sierra
the.stuart.sie...@gmail.com wrote:
No need to slap your forehead, but here it is:
-
clojure.core/extends?
([protocol atype])
Returns true if atype explicitly extends protocol
thanks!
at least a d'oh will be required.
Yeah, I'm aware of the tree nature of many clojure data structures,
but just wasn't sure that applied to actual lists.
On Feb 10, 12:06 pm, André Ferreira greis...@gmail.com wrote:
What he said is basically right, only instead of list it's called
vector. Not sure if vector branching is 64 or
clojure.core/extends?
doesn't seem to cover all the use cases? or i'm mistyping (er ha ha) something?
(ns p)
(defprotocol P1 (foo [this]))
(ns d)
(deftype T1 [f] :as this p/P1 (foo [] (println this)))
(deftype T2 [f] :as this)
(extend ::T2 p/P1 {:foo (fn [this] (println this))})
(println P1?T1
Hi,
Am 10.02.2010 um 22:20 schrieb Stuart Sierra:
No need to slap your forehead, but here it is:
-
clojure.core/extends?
([protocol atype])
Returns true if atype explicitly extends protocol
This only checks whether extend was explicitly called on atype. What you
Hi all.
Is it not recommended to use defn within defn?
Normal function is faster than the function which has inner function
which actually doesn't run.
--
(defn aaa1 []
(defn bbb [] 1)
1)
(defn aaa2 [] 1)
user (time
Hozumi, nested defn's are definitely not recommended. I suggest using
letfn for the inner function.
Bill Smith
Austin, TX
On Feb 10, 3:28 pm, Hozumi fat...@googlemail.com wrote:
Hi all.
Is it not recommended to use defn within defn?
Normal function is faster than the function which has
scheme's define is scoped inside a function. clojure is not scheme.
clojure's def (which defn uses) is not lexical or scoped in anyway, it
always operates on global names. if you want lexical scope please use
one of clojure's lexical scoping constructs, let or letfn.
On Wed, Feb 10, 2010 at 1:28
http://clojure.org/contributing
seq-utils was recently renamed:
http://groups.google.com/group/clojure-dev/browse_thread/thread/49068754a8c2efb9#
On Wed, Feb 10, 2010 at 3:38 PM, Wardrop t...@tomwardrop.com wrote:
I've written a function which I think would be a good inclusion into
the
Take a look here:
http://clojure.org/contributing
On Feb 10, 6:38 pm, Wardrop t...@tomwardrop.com wrote:
I've written a function which I think would be a good inclusion into
the Clojure.Contrib library. I have two questions though, the first is
how? How do I go about adding a single function
Just at home, 4 of us were there. 1 american, 1 italian, 1 pole and me, a
dutchy. I don't think this was the last time for me, and maybe some day I
should invite you to Ede :) or arrange something in Utrecht or Rotterdam (I
work there nearby).
2010/2/10 Joost jo...@zeekat.nl
On 7 feb, 13:09,
Hi, Bill.
oh, letfn is what I wanted ! Thank you.
Sorry, I missed preview disqussion.
letfn - mutually recursive local functions
http://groups.google.com/group/clojure/browse_thread/thread/a7aad1d5b94db748
letfn is pretty good.
Thanks for the link.
As part of my second question, could someone take a look at the code
I've posted and tell me if it's a good implementation and follows
clojure idioms and standards. By the way, does anyone know of a good
resource that specifies common clojure coding and formatting
standards,
http://groups.google.com/group/clojure-dev/browse_thread/thread/d090b5599909497c#
On Wed, Feb 10, 2010 at 3:57 PM, Wardrop t...@tomwardrop.com wrote:
Thanks for the link.
As part of my second question, could someone take a look at the code
I've posted and tell me if it's a good implementation
Hello,
We have a very interesting big-data project need more devs. We are
looking for our 7th clojure dev on an all work-at-home team. You must
live in the US to be on our team.Full-time employees get a MBP 15
3g (for travel backup internet).
So far our team consists of (in no particular
Ah, I didn't know about the reduce function. I'll give that a try and
thanks a lot.
On Feb 10, 10:42 pm, Brenton bashw...@gmail.com wrote:
chaosprophet,
Clojure wants you to think in terms of sequences instead to loops.
Instead to looping through cat-all and keeping track of the sum, you
I have this code:
(def material (ref 2))
(def products-store (ref 2))
(def products (ref 0))
(def artisan (agent idle))
(defn manufacture [state]
(dosync
(alter material dec)
(alter products inc))
(str idle))
(defn ask-material [a-key the-ref
On 11 February 2010 02:50, MiltondSilva shadowtr...@gmail.com wrote:
I have this code:
[snip]
java.lang.RuntimeException: Agent has errors (repl-1:8)
Your code works fine for me.
To help you debug your problem: you can use (agent-errors artisan) to
discover what the exception is about,
This solved the problem:
(defn ask-material [a-key the-ref old-state new-state]
(if (= new-state 0)
(dosync (alter material + (int (rand 10)
(str asked for materials))
When the function ask-materials is invoked, it updates the state of
the agent that caused
Hi,
On Feb 11, 12:57 am, Wardrop t...@tomwardrop.com wrote:
As part of my second question, could someone take a look at the code
I've posted and tell me if it's a good implementation and follows
clojure idioms and standards.
I haven't checked the algorithm itself, but just some random notes
Again, your input was incredibly beneficial for me.
William:
Thank you for your comments.
As i wrote, eventually I came up with a different solution altogether. To
answer your question concerning the previous code:
my initial idea was that since (although unproven) all the different
sequences
71 matches
Mail list logo