Hi there ,
I am a little confused here (no big deal though) .
Is org.clojure/java.jdbc an official clojure library? if yes, why is the
version still 0.2.3 and not 1.4.x as clojure ?
TIA
Josh
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to
On Tuesday, January 15, 2013 12:36:04 AM UTC+1, Jim foo.bar wrote:
On 14/01/13 22:15, Marko Topolnik wrote:
But... you were quite clear in stating that your function isn't lazy, and
you were right to say that: *doall* will not return until *all* the tasks
have completed. Maybe you did
java.jdbc is one of several Clojure contrib libraries, others of which you can
see listed in the two places below:
https://github.com/clojure
http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
They are like Clojure in that they are released under the same Eclipse Public
Andy;
Thanks for the clarification.
Josh.
On Tue, Jan 15, 2013 at 1:20 PM, Andy Fingerhut andy.finger...@gmail.comwrote:
java.jdbc is one of several Clojure contrib libraries, others of which you
can see listed in the two places below:
https://github.com/clojure
On 15/01/13 09:25, Marko Topolnik wrote:
The order in which you are polling is not very relevant given the fact
that /doall/ won't return until *all* futures are realized. It's just
an internal detail.
I finally fully grasped what you were saying...So yes you're right - as
long as I'm
user= (def dummy-times [3000 10 9 8 7 6 5 4 3 2 1])
#'user/dummy-times
user= (time (pmap #(do (Thread/sleep %) %) dummy-times))
Elapsed time: 16.213366 msecs
(3000 10 9 8 7 6 5 4 3 2 1);;here you waited 3s before sleeping for
0.01 s
user= (time (pool-map #(do (Thread/sleep %) %)
Hi Andrew,
On Tuesday, January 15, 2013 at 10:23 AM, Andrew Xue wrote:
Hi --
Building some generic joining functionality on top of cascalog, the clojure
package for big data.
I have a join function that is defined like this:
(defn join [lhs rhs join-ons] ..implementation ...)
On 15/01/13 12:57, Marko Topolnik wrote:
The tasks are waiting in the queue, they are not being executed at
all. And the time they spend waiting cannot theoretically be a
function of the time they will take to execute, once they get their
chance.
a so Java Futures are not the same as
On 2013-01-14, at 3:58 PM, Jonas jonas.enl...@gmail.com wrote:
Hi
I created a middleware for nrepl that saves a transcript of your repl
interactions so you can go back and see what you did.
https://github.com/jonase/nrepl-transcript
Feedback welcome!
Oh! Thank you!
Bob
Jonas
This is an unrelated issue. We could probably simulate this by creating a
Unbound type and initializing def'ed vars without init expressions to
instances of it.
David
On Tue, Jan 15, 2013 at 1:08 AM, Frank Siebenlist
frank.siebenl...@gmail.com wrote:
ClojureScript:cljs.user (def a nil)
nil
so Java Futures are not the same as Clojure futures then! A
Clojure future will fire up as soon as you define it yes? If what you
say is true, then Java Future objects are not the same! I was under the
impression that as soon as you submit the job and get the Future Object
back , the
On 15/01/13 13:49, Marko Topolnik wrote:
It's not about futures, but about the way the ExecutorService is
configured. Clojure's /future-call/ apparently uses the /agent
send-off pool/, which is an unbounded thread pool executor. So you can
use the same thing with
(defn pool-map
A saner, more disciplined version of pmap.
Submits jobs eagerly but polls for results lazily.
Don't use if original ordering of 'coll' matters.
[f coll]
(let [exec (Executors/newCachedThreadPool)
pool (ExecutorCompletionService. exec)
futures (doall
*Executors/newCachedThreadPool* works exactly as I 'd want without the
risk of overwhelming the system with threads (which the fixed-size pool
will if I initialize it with (count coll))...
You will either ovewhelm the system with threads or have the tasks waiting
in the queue, there is
Right, I was testing against 1.5.0-RC1 and 1.5.0-RC2. Same problem occurred
both times. I should have reported that in my initial bug report. Sorry
about that. Also, thanks for the quick turnaround. I'll pull it and test it
out.
~Gary
On Monday, January 14, 2013 7:16:29 PM UTC-5, Leonardo
I opened issue CLJS-457 for this enhancement/bug.
As a workaround, one can test for undefined?, although that is not really the
same and cljs-specific, but for my use case that will do.
Thanks, Frank.
On Jan 15, 2013, at 5:32 AM, David Nolen dnolen.li...@gmail.com wrote:
This is an
Worked like a charm. Thanks.
On Tuesday, January 15, 2013 12:33:26 PM UTC-5, Gary Johnson wrote:
Right, I was testing against 1.5.0-RC1 and 1.5.0-RC2. Same problem
occurred both times. I should have reported that in my initial bug report.
Sorry about that. Also, thanks for the quick
Hello good people of Clojure.
This weekend we had the pleasure of releasing the second release
candidate for Leiningen 2.0.0. There was an RC1 release a bit before
that which contained a number of bugs that have been fixed too, but if
you're currently using a preview release of Leiningen it
Thanks, will look into it.
On Tue, Jan 15, 2013 at 12:33 PM, Frank Siebenlist
frank.siebenl...@gmail.com wrote:
I opened issue CLJS-457 for this enhancement/bug.
As a workaround, one can test for undefined?, although that is not really
the same and cljs-specific, but for my use case that
There actually is a standardized value for no value in clojure: nil
The reason it's not useable as such in some places, is exactly it being
standardized.
Were we to introduce another such non-value, e.g. #blackhole, I think the
following would happen:
- people would be horribly confused on
I am not sure if this is a Ring problem or a Compojure problem. I set
up my app as you see below. However, when I go to /, I have the
function do this:
(prn (apply str request))
and I see a great deal of information printed out at the terminal, but
no session is set. What am I doing wrong? How
Using `undefined?` for anything other than JS interop is not recommended. I
don't see any issues with:
(def foo (atom ::uninitialized))
For your watcher case.
On Mon, Jan 14, 2013 at 11:25 PM, Frank Siebenlist
frank.siebenl...@gmail.com wrote:
Ok - ClojureScript has an undefined? function
On 01/15/2013 11:48 AM, Herwig Hochleitner wrote:
There actually is a standardized value for no value in clojure: nil
The reason it's not useable as such in some places, is exactly it being
standardized.
Were we to introduce another such non-value, e.g. #blackhole, I think the
following would
Hi all,
In Stuart Halloway's book (Programming Clojure) is a wonderful example of
the succinctness of Clojure where he compares the Apache Commons
implementation of the isBlank method (
http://commons.apache.org/lang/api-2.5/src-html/org/apache/commons/lang/StringUtils.html#line.227)
with a
I think I just answered my own question...
user= (time (dotimes [n 2] (s-blank? asdf)))
Elapsed time: 2481.018 msecs
nil
user= (time (dotimes [n 2] (blank? asdf)))
Elapsed time: 14.347 msecs
nil
user=
Quite a difference I have to say.
Thomas
--
You received this message because you
When you find non-idiomatic code in clojure's impl, the reason is almost
always performance.
In this case the clojure.string version is more performant since it saves:
1) the allocation of a lazy seq over the characters of the string
2) the allocation of a java.lang.Character for every char in the
Quite a difference I have to say.
well, you can still be happy that first, get it right. then, make it
fast is still easier in clojure than in java! (of course if, like me,
you are a static typing bigot, there's more to be said on that :-)
--
You received this message because you are
On Tuesday, January 15, 2013 9:35:07 PM UTC+1, Thomas wrote:
I think I just answered my own question...
user= (time (dotimes [n 2] (s-blank? asdf)))
Elapsed time: 2481.018 msecs
nil
user= (time (dotimes [n 2] (blank? asdf)))
Elapsed time: 14.347 msecs
nil
user=
Quite a
Note that the two functions aren't actually equivalent, since the
blank? that uses every? will accept anything that can be made a seq,
while the blank? in clojure.string does not.
Given an annotation like this, and assuming that every? is clojure.core/every?
(defn blank? [^CharSequence s]
Given an annotation like this, and assuming that every? is
clojure.core/every?
(defn blank? [^CharSequence s] (every? #(Character/isWhitespace %) s))
it seems as if it should be possible for the compiler to generate the
faster code.
Yes, there is enough information for a compiler
Formative is a library for dealing with web forms. Features:
- Describe forms using simple data
- Render forms via pluggable renderers (comes with Bootstrap and other
renderers built-in)
- Parse submitted form data from Ring params
- Validate parsed data using Verily
Excellent.
I'll push 0.2.2 final to clojars soon - as soon as I get the ANN email out.
Thanks for the help.
Cheers
Leonardo Borges
www.leonardoborges.com
On Wed, Jan 16, 2013 at 4:37 AM, Gary Johnson gwjoh...@uvm.edu wrote:
Worked like a charm. Thanks.
On Tuesday, January 15, 2013
bouncer is a validation DSL for Clojure apps
Github: https://github.com/leonardoborges/bouncer
Clojars: https://clojars.org/bouncer
Highlights of version 0.2.2:
- Use of a qualified keyword for storing the validation results
- The defvalidator macro allows defining validators with an arbitrary
This is interesting. We can get quite a huge performance boos by type
hinting that impl.
Times on my system running Clojure 1.4.0:
user= (defn s-blank? [s] (every? #(Character/isWhitespace %) s))
user= (time (dotimes [n 2] (s-blank? asdf)))
Elapsed time: 247.252 msecs
Now if we type hint
On Sun, 2013-01-13 at 19:03 +0100, Marcel Möhring wrote:
Currently I am using this approach but it feels rather clumsy:
Takes a screen and a pixel coordinate and returns
a map of maps with pixel colors
and adjusted pixel coordinates around the pixel.
Directions are degree
https://github.com/xumingming/tracer
tracer
trace clojure call stack.
When I read some open source clojure source code, I find that some
function/logic are so complex that it is not so easy to understand the
whole logic, I think it will help me a lot if I can see the real function
call stack
I have the following setting up an app where some pages will be
protected by Friend.
(defroutes app-routes
(GET / request (index request))
(GET /search-results request (search-results request))
(GET /account request (friend/authorize #{::user} (account
request)))
(GET /admin request
Reading here:
https://github.com/cemerick/friend
I see this:
(Note that Friend itself requires some core Ring middlewares: params,
keyword-params and nested-params.
I did not have nested-params so I will add this.
This might be a stupid question, but why doesn't Friend include the
Ring
Looking here:
https://github.com/cemerick/friend/blob/master/src/cemerick/friend.clj
I see in the stacktrace that the problem seems to be with the last
line of this function:
(defn default-unauthenticated-handler
[request]
(- request
::auth-config
:login-uri
For anyone else who might make the same mistake I did, I changed this:
(GET /admin request (friend/authorize #{::admin} (admin
request)))
to this:
(GET /admin request (friend/authorize #{::admin} {} (admin
request)))
adding an empty map before the string that is my actual HTML page.
That
This is very interesting. Have you tried running the Ring Jetty adapter
with a larger thread pool? It's set lower than the default so as not to
overload cloud hosts like Heroku.
Okay, bumped the :max-threads from 50 to 100 without seeing much change to
the results at these relatively low
Curious: how's this different from tools.trace?
On Tue, Jan 15, 2013 at 8:29 PM, James Xu xumingming64398...@gmail.comwrote:
https://github.com/xumingming/tracer
tracer
trace clojure call stack.
When I read some open source clojure source code, I find that some
function/logic are so
Actually the same purpose, don't know there is such a tool before I wrote
itŠ |o|
From: Alex Baranosky alexander.barano...@gmail.com
Reply-To: clojure@googlegroups.com
Date: Tue, 15 Jan 2013 22:58:42 -0800
To: clojure@googlegroups.com
Subject: Re: [ANN] tracer, trace your clojure function
43 matches
Mail list logo