Re: clojure.java.jdbc and joined tables

2013-02-17 Thread Sean Corfield
You should get col and col_1 automatically since it looks for
duplicate column names and makes them unique. Which version of
java.jdbc are you using?

On Sun, Feb 17, 2013 at 8:46 PM, Alex Baranosky
 wrote:
> I have an issue with clojure.java.jdbc, in that I want to join two tables
> that have columns with the same name.  What's happening is that the result
> set maps only have the second key-value pair from the result row in them.
>
> Is there some way to alias or namespace the keywords in the results from
> clojure.java.jdbc/with-query-results so that the result set could include
> both fields?
>
> Alex
>
> --
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




clojure.java.jdbc and joined tables

2013-02-17 Thread Alex Baranosky
I have an issue with clojure.java.jdbc, in that I want to join two tables
that have columns with the same name.  What's happening is that the result
set maps only have the second key-value pair from the result row in them.

Is there some way to alias or namespace the keywords in the results from
clojure.java.jdbc/with-query-results so that the result set could include
both fields?

Alex

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: with-redefs for vars in a different namespace for tests (midje facts)

2013-02-17 Thread Leonardo Borges
Hi,

So I got a working test and it looks like this:


(facts "sets a value for the given key in redis"
   (with-redefs [redis/with-conn (constantly "Ok")]
 (require '[com.leonardoborges.cache :as cache] :reload)
 (fact "with no ttl "
   (cache/set "key" "value") => "Ok"
   (provided
(redis/set "key" "value") => irrelevant

Note the 'require ... :reload' function call - it doesn't work without
that line.


My theory behind why this works is that when I reload the cache
namespace it recompiles it - and at that point, the new var binding is
available.

Is this the case? More importantly, is this how I should be doing this?

The source for cache/set is the same as before.

Cheers,
Leonardo Borges
www.leonardoborges.com


On Mon, Feb 18, 2013 at 10:07 AM, Leonardo Borges
 wrote:
> Hi,
>
> I have some caching code that relies on a macro called 'with-redis' so
> while writing my tests I'd like to redef this macro to bypass all of
> it's redis connection machinery and just execute a function that does
> nothing instead.
>
> Something like this works:
>
> (with-redefs [cache/with-redis (fn [& body] (prn "body called"))]
>  (cache/with-redis (do "stuff")))
> ;; "body called"
>
> But this doesn't:
> (with-redefs [cache/with-redis (fn [& body] (prn "body called"))]
>  (cache/set "key" "value"))
>
> It actually attempts to talk to redis and doesn't run the dummy function at 
> all.
>
> For reference, cache/set is defined as follows, in my cache namespace:
>
> (defn set [key value]
>   (with-redis
> (let [key (cache-key key)]
>   (redis/set key value
>
>
> It would seem that 'with-redefs' doesn't work if the var your
> 'redefining' is being used in the body of a function you're calling?
>
> Or hopefully I'm just doing something wrong.
>
>
> Has anyone seen this before?
>
> Thanks,
> Leonardo Borges
> www.leonardoborges.com
Leonardo Borges
www.leonardoborges.com


On Mon, Feb 18, 2013 at 10:07 AM, Leonardo Borges
 wrote:
> Hi,
>
> I have some caching code that relies on a macro called 'with-redis' so
> while writing my tests I'd like to redef this macro to bypass all of
> it's redis connection machinery and just execute a function that does
> nothing instead.
>
> Something like this works:
>
> (with-redefs [cache/with-redis (fn [& body] (prn "body called"))]
>  (cache/with-redis (do "stuff")))
> ;; "body called"
>
> But this doesn't:
> (with-redefs [cache/with-redis (fn [& body] (prn "body called"))]
>  (cache/set "key" "value"))
>
> It actually attempts to talk to redis and doesn't run the dummy function at 
> all.
>
> For reference, cache/set is defined as follows, in my cache namespace:
>
> (defn set [key value]
>   (with-redis
> (let [key (cache-key key)]
>   (redis/set key value
>
>
> It would seem that 'with-redefs' doesn't work if the var your
> 'redefining' is being used in the body of a function you're calling?
>
> Or hopefully I'm just doing something wrong.
>
>
> Has anyone seen this before?
>
> Thanks,
> Leonardo Borges
> www.leonardoborges.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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RC 16: Last chance to test against Clojure 1.5 before it ships

2013-02-17 Thread Dave Sann
timely comment.

you can create and throw it but catching it requires the imported type. 
(not withstanding catching the generic Exception on the JVM).

see the link for suggestion/discussion on making this more "uniform" for 
clj and cljs:

https://groups.google.com/d/topic/clojurescript/A3wH_Hm3OmQ/discussion

Dave

On Monday, 18 February 2013 03:54:00 UTC+11, Baishampayan Ghose wrote:
>
> You can create an ExceptionInfo instance easily by using the core fn 
> `ex-info`. So something like ... (throw (ex-info {:foo "bar"})) works 
> fine. ~BG 
>
> On Sun, Feb 17, 2013 at 10:05 PM, vemv > 
> wrote: 
> > Couldn't clojure.lang.ExceptionInfo be imported by default? That'd 
> surely 
> > help making ExceptionInfo the idiomatic exception to be thrown. 
> > 
> > 
> > On Thursday, February 14, 2013 4:33:42 AM UTC+1, stuart@gmail.comwrote: 
> >> 
> >> If you care about Clojure 1.5 compatibility for your codebase, please 
> test 
> >> it against RC 16 as soon as possible. 
> >> 
> >> You can get the source and build it yourself from [1], or wait for 
> Maven 
> >> Central [2] to pick up the CI build, which usually takes a few hours. 
> >> 
> >> Thanks! 
> >> Stu 
> >> 
> >> [1] https://github.com/clojure/clojure 
> >> [2] http://bit.ly/WEnjAi 
> > 
> > -- 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@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+u...@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 unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to clojure+u...@googlegroups.com . 
> > 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>
>
> -- 
> Baishampayan Ghose 
> b.ghose at gmail.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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




with-redefs for vars in a different namespace for tests (midje facts)

2013-02-17 Thread Leonardo Borges
Hi,

I have some caching code that relies on a macro called 'with-redis' so
while writing my tests I'd like to redef this macro to bypass all of
it's redis connection machinery and just execute a function that does
nothing instead.

Something like this works:

(with-redefs [cache/with-redis (fn [& body] (prn "body called"))]
 (cache/with-redis (do "stuff")))
;; "body called"

But this doesn't:
(with-redefs [cache/with-redis (fn [& body] (prn "body called"))]
 (cache/set "key" "value"))

It actually attempts to talk to redis and doesn't run the dummy function at all.

For reference, cache/set is defined as follows, in my cache namespace:

(defn set [key value]
  (with-redis
(let [key (cache-key key)]
  (redis/set key value


It would seem that 'with-redefs' doesn't work if the var your
'redefining' is being used in the body of a function you're calling?

Or hopefully I'm just doing something wrong.


Has anyone seen this before?

Thanks,
Leonardo Borges
www.leonardoborges.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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Clojure count and get functions much faster on strings than direct interop with .length and .charAt

2013-02-17 Thread Geo
Clojure is full of pleasant surprises :)

>
>

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: alternative to passing parameters to functions

2013-02-17 Thread vemv
fn's "keyword arguments" feature provide unrolled, optional key-value args:

(defn foo [& {:keys [a b c]}]
  [a b c])

(foo :c 4) ;; [nil nil 4]

On Sunday, February 17, 2013 10:06:13 PM UTC+1, AtKaaZ wrote:
>
> Was there a library or some other way to pass ie. maps to functions
> so that the order of the params isn't predefined, just in case I want to 
> skip some passing parameters without actually having to pass some value for 
> them, I could just refer to which params I'm passing by identifying them 
> with a :key  ?
>
> It's probably not hard at all to implement, but if there's a lib already, 
> it would do a better job that I could.
>
> -- 
> Please correct me if I'm wrong or incomplete,
> even if you think I'll subconsciously hate it.
>
>  

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




alternative to passing parameters to functions

2013-02-17 Thread AtKaaZ
Was there a library or some other way to pass ie. maps to functions
so that the order of the params isn't predefined, just in case I want to
skip some passing parameters without actually having to pass some value for
them, I could just refer to which params I'm passing by identifying them
with a :key  ?

It's probably not hard at all to implement, but if there's a lib already,
it would do a better job that I could.

-- 
Please correct me if I'm wrong or incomplete,
even if you think I'll subconsciously hate it.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Using local jar

2013-02-17 Thread Jarod
James, Aaron and Jim: thanks for your help, but it still get the old error 
message and another: "Leiningen managed dependencies issue: problem 
resolving following dependencies: [jaad/jaad "0.8.4"]".  If anyone has 
time, my lein version is 1.7.1 and maven version is 2.2.1 and I used the 
following steps:

1) I created a new Leningen project that I called "project1".
2) Within the project1 directory, I create sub-directory: "maven_repository"
3) I place the jaad jar file into maven_repository, go to maven_repository 
and run the following:
 mvn install:install-file -Dfile=jaad-0.8.4.jar -DartifactId=jaad 
-Dversion=0.8.4 -DgroupId=jaad -Dpackaging=jar -DlocalRepositoryPath=.

Output looks like this:
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO] 

[INFO] Building Maven Default Project
[INFO]task-segment: [install:install-file] (aggregator-style)
[INFO] 

[INFO] [install:install-file {execution: default-cli}]
[INFO] Installing 
/home/abc/software/eclipse/workspace/project1/maven_repository/jaad-0.8.4.jar 
to 
/home/abc/software/eclipse/workspace/project1/maven_repository/jaad/jaad/0.8.4/jaad-0.8.4.jar
[INFO] 

[INFO] BUILD SUCCESSFUL
[INFO] 

[INFO] Total time: 2 seconds
[INFO] Finished at: Sun Feb 17 14:48:24 EST 2013
[INFO] Final Memory: 4M/74M
[INFO] 


4) I modify project.clj by adding the repository and dependency line.

(defproject project1 "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME";
  :license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"local" ~(str (.toURI (java.io.File. "maven_repository")))}
  :dependencies [[org.clojure/clojure "1.4.0"]
 [jaad/jaad "0.8.4"]])

5) I look in maven_repository/jaad/jaad and see a subdirectory "0.8.4" and 
a file called "maven-metadata-local.xml".
6) I run "lein deps" using leiningen version 1.7.1 and get:

Downloading: jaad/jaad/0.8.4/jaad-0.8.4.pom from repository central at 
http://repo1.maven.org/maven2
Unable to locate resource in repository
[INFO] Unable to find resource 'jaad:jaad:pom:0.8.4' in repository central 
(http://repo1.maven.org/maven2)
Downloading: jaad/jaad/0.8.4/jaad-0.8.4.pom from repository clojars at 
http://clojars.org/repo/
Unable to locate resource in repository
[INFO] Unable to find resource 'jaad:jaad:pom:0.8.4' in repository clojars 
(http://clojars.org/repo/)
Downloading: jaad/jaad/0.8.4/jaad-0.8.4.pom from repository local at 
file:/home/abc/software/eclipse/workspace/project1/maven_repository/
Transferring 0K from local
[WARNING] *** CHECKSUM FAILED - Error retrieving checksum file for 
jaad/jaad/0.8.4/jaad-0.8.4.pom - IGNORING
Downloading: jaad/jaad/0.8.4/jaad-0.8.4.jar from repository central at 
http://repo1.maven.org/maven2
Unable to locate resource in repository
[INFO] Unable to find resource 'jaad:jaad:jar:0.8.4' in repository central 
(http://repo1.maven.org/maven2)
Downloading: jaad/jaad/0.8.4/jaad-0.8.4.jar from repository clojars at 
http://clojars.org/repo/
Unable to locate resource in repository
[INFO] Unable to find resource 'jaad:jaad:jar:0.8.4' in repository clojars 
(http://clojars.org/repo/)
Downloading: jaad/jaad/0.8.4/jaad-0.8.4.jar from repository local at 
file:/home/abc/software/eclipse/workspace/project1/maven_repository/
Transferring 653K from local
[WARNING] *** CHECKSUM FAILED - Error retrieving checksum file for 
jaad/jaad/0.8.4/jaad-0.8.4.jar - IGNORING
Copying 2 files to /home/abc/software/eclipse/workspace/project1/lib

7) I look in "lib" directory and see clojure-1.4.0.jar  and jaad-0.8.4.jar
8) I open up core.clj and try to run it and get the same error message.
9) When I look at project.clj in eclipse/counterclockwise, I see a red x at 
the top saying:
Leiningen managed dependencies issue: problem resolving following 
dependencies: [jaad/jaad "0.8.4"]

Thanks for any advice.

On Saturday, February 16, 2013 7:13:38 PM UTC-5, Aaron Cohen wrote:
>
> I'm not sure if this is your problem, but a newbie might not realize one 
> thing from that blog post.
>
> After doing all the steps there, you still have to add the dependency for 
> that artifact in your project.clj
>
> I don't know how you named your local jar, but for their example you would 
> need to add
>
> :dependencies [
> 
> [jaad/jaad "0.8.3"]]
>
>
> On Sat, Feb 16, 2013 at 6:00 PM, Jarod 
> > wrote:
>
>> Hi.  This is a really basic question, as I'm new to Clojure and Java. 
>>  I'm trying to use a jar file for Stanford's NLP software that isn't 
>> available on Maven.  I successfully ran the 

Re: Clojure count and get functions much faster on strings than direct interop with .length and .charAt

2013-02-17 Thread Akhil Wali
What's happening is a classic example of "Functional Lisp FTW" :P


On Sun, Feb 17, 2013 at 7:47 PM, Geo  wrote:

> I am writing an expensive algorithms in Clojure and while trying to
> optimize the code I discovered something that puzzled me. Clojure count and
> get functions are much faster on strings than direct interop with .length
> and .charAt. On my machine I get the following:
>
> (def sss (apply str (repeat 1000 \a)))
>
> I execute each of the following tests a few times:
>
> (time (dotimes [_ 1000] (count sss)))
> "Elapsed time: 0.56 msecs"
> "Elapsed time: 0.539 msecs"
> "Elapsed time: 0.551 msecs"
> "Elapsed time: 0.453 msecs"
> "Elapsed time: 0.612 msecs"
>
> (time (dotimes [_ 1000] (.length sss)))
> "Elapsed time: 170.819 msecs"
> "Elapsed time: 114.892 msecs"
> "Elapsed time: 10.111 msecs"
> "Elapsed time: 32.106 msecs"
> "Elapsed time: 10.803 msecs"
>
> Even after something under the hood warms up (feel free to enlighten me
> :). .length is still significantly slower.
>
> (time (dotimes [_ 1000] (get sss (rand-int 1000
> "Elapsed time: 4.651 msecs"
> "Elapsed time: 3.699 msecs"
> "Elapsed time: 3.672 msecs"
> "Elapsed time: 4.561 msecs"
> "Elapsed time: 3.742 msecs"
>
> (time (dotimes [_ 1000] (.charAt sss (rand-int 1000
> "Elapsed time: 13.211 msecs"
> "Elapsed time: 14.874 msecs"
> "Elapsed time: 32.044 msecs"
> "Elapsed time: 13.849 msecs"
> "Elapsed time: 39.493 msecs"
>
> .charAt is also significantly slower than get.
>
> By replacing .length with count and .charAt with get I was able to reduce
> the running time of my algo by orders of magnitude.
>
> These results are surprising and puzzling. You'd think direct interop with
> Java would be the faster. Can anyone venture a guess or explain what's
> going on here?
>
>  --
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Akhil Wali

# http://github.com/darth10 
# http://darth10.github.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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Clojure count and get functions much faster on strings than direct interop with .length and .charAt

2013-02-17 Thread AtKaaZ
and in the case of String, this happens:
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L547

else if(o instanceof CharSequence)
return ((CharSequence) o).length();

=> (dorun (map println (supers (class "a string here"
java.lang.Object
java.lang.Comparable
java.io.Serializable
java.lang.*CharSequence*
nil



On Sun, Feb 17, 2013 at 6:08 PM, Herwig Hochleitner
wrote:

> 2013/2/17 Geo 
>
>> So how come Clojure's get and count don't incur the reflection penalty?
>
>
> Clojure's collection functions do a typeof dispatch for JVM types. In a
> bootstrapped clojure, that would be solved with protocols.
>
> E.g.
> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L527
>
>  --
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Please correct me if I'm wrong or incomplete,
even if you think I'll subconsciously hate it.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: λ machine as a d3 tree, parsed with PEG

2013-02-17 Thread AtKaaZ
it's about time, now let's see that in 3d and with clojure structures :)


On Sun, Feb 17, 2013 at 7:40 PM, Rich Morin  wrote:

> Some folks here may enjoy this:
>
>   λ machine as a d3 tree, parsed with PEG
>   http://brycec.github.com/vizlamb/
>
> -r
>
>  --
> http://www.cfcl.com/rdmRich Morin
> http://www.cfcl.com/rdm/resume r...@cfcl.com
> http://www.cfcl.com/rdm/weblog +1 650-873-7841
>
> Software system design, development, and documentation
>
>
> --
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
Please correct me if I'm wrong or incomplete,
even if you think I'll subconsciously hate it.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




λ machine as a d3 tree, parsed with PEG

2013-02-17 Thread Rich Morin
Some folks here may enjoy this:

  λ machine as a d3 tree, parsed with PEG
  http://brycec.github.com/vizlamb/

-r

 -- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RC 16: Last chance to test against Clojure 1.5 before it ships

2013-02-17 Thread vemv
ah nice, never realised that, thank you. still it'd be somewhat more 
consistent to import ExceptionInfo:

(throw (Exception.))
(throw (IndexOutOfBoundsException.))
(throw (IllegalArgumentException.))
;; ...there's quite clearly a pattern here, which many are accustomed to
(throw (ex-info "" {})) ;; ex-info (however more pleasant is it to type) 
breaks that pattern

OTOH, I see ex-info is "alpha, subject to change" so relying on Java 
constructors may not be the right choice right now.

On Sunday, February 17, 2013 5:54:00 PM UTC+1, Baishampayan Ghose wrote:
>
> You can create an ExceptionInfo instance easily by using the core fn 
> `ex-info`. So something like ... (throw (ex-info {:foo "bar"})) works 
> fine. ~BG 
>
> On Sun, Feb 17, 2013 at 10:05 PM, vemv > 
> wrote: 
> > Couldn't clojure.lang.ExceptionInfo be imported by default? That'd 
> surely 
> > help making ExceptionInfo the idiomatic exception to be thrown. 
> > 
> > 
> > On Thursday, February 14, 2013 4:33:42 AM UTC+1, stuart@gmail.comwrote: 
> >> 
> >> If you care about Clojure 1.5 compatibility for your codebase, please 
> test 
> >> it against RC 16 as soon as possible. 
> >> 
> >> You can get the source and build it yourself from [1], or wait for 
> Maven 
> >> Central [2] to pick up the CI build, which usually takes a few hours. 
> >> 
> >> Thanks! 
> >> Stu 
> >> 
> >> [1] https://github.com/clojure/clojure 
> >> [2] http://bit.ly/WEnjAi 
> > 
> > -- 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@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+u...@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 unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to clojure+u...@googlegroups.com . 
> > 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>
>
> -- 
> Baishampayan Ghose 
> b.ghose at gmail.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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Clojure count and get functions much faster on strings than direct interop with .length and .charAt

2013-02-17 Thread Herwig Hochleitner
2013/2/17 Geo 

> So how come Clojure's get and count don't incur the reflection penalty?


Clojure's collection functions do a typeof dispatch for JVM types. In a
bootstrapped clojure, that would be solved with protocols.

E.g.
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L527

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RC 16: Last chance to test against Clojure 1.5 before it ships

2013-02-17 Thread Baishampayan Ghose
You can create an ExceptionInfo instance easily by using the core fn
`ex-info`. So something like ... (throw (ex-info {:foo "bar"})) works
fine. ~BG

On Sun, Feb 17, 2013 at 10:05 PM, vemv  wrote:
> Couldn't clojure.lang.ExceptionInfo be imported by default? That'd surely
> help making ExceptionInfo the idiomatic exception to be thrown.
>
>
> On Thursday, February 14, 2013 4:33:42 AM UTC+1, stuart@gmail.com wrote:
>>
>> If you care about Clojure 1.5 compatibility for your codebase, please test
>> it against RC 16 as soon as possible.
>>
>> You can get the source and build it yourself from [1], or wait for Maven
>> Central [2] to pick up the CI build, which usually takes a few hours.
>>
>> Thanks!
>> Stu
>>
>> [1] https://github.com/clojure/clojure
>> [2] http://bit.ly/WEnjAi
>
> --
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Baishampayan Ghose
b.ghose at gmail.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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RC 16: Last chance to test against Clojure 1.5 before it ships

2013-02-17 Thread vemv
Couldn't clojure.lang.ExceptionInfo be imported by default? That'd surely 
help making ExceptionInfo the idiomatic exception to be thrown.

On Thursday, February 14, 2013 4:33:42 AM UTC+1, stuart@gmail.com wrote:
>
> If you care about Clojure 1.5 compatibility for your codebase, please test 
> it against RC 16 as soon as possible.
>
> You can get the source and build it yourself from [1], or wait for Maven 
> Central [2] to pick up the CI build, which usually takes a few hours.
>
> Thanks!
> Stu
>
> [1] https://github.com/clojure/clojure
> [2] http://bit.ly/WEnjAi
>  

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Clojure count and get functions much faster on strings than direct interop with .length and .charAt

2013-02-17 Thread Geo
Thank you!

Adding type hints solves the problem. The interop now slightly outperforms 
Clojure's get and count.

So how come Clojure's get and count don't incur the reflection penalty?

On Sunday, February 17, 2013 9:17:55 AM UTC-5, Geo wrote:
>
> I am writing an expensive algorithms in Clojure and while trying to 
> optimize the code I discovered something that puzzled me. Clojure count and 
> get functions are much faster on strings than direct interop with .length 
> and .charAt. On my machine I get the following:
>
> (def sss (apply str (repeat 1000 \a)))
>
> I execute each of the following tests a few times:
>
> (time (dotimes [_ 1000] (count sss)))
> "Elapsed time: 0.56 msecs"
> "Elapsed time: 0.539 msecs"
> "Elapsed time: 0.551 msecs"
> "Elapsed time: 0.453 msecs"
> "Elapsed time: 0.612 msecs"
>
> (time (dotimes [_ 1000] (.length sss)))
> "Elapsed time: 170.819 msecs"
> "Elapsed time: 114.892 msecs"
> "Elapsed time: 10.111 msecs"
> "Elapsed time: 32.106 msecs"
> "Elapsed time: 10.803 msecs"
>
> Even after something under the hood warms up (feel free to enlighten me 
> :). .length is still significantly slower.
>
> (time (dotimes [_ 1000] (get sss (rand-int 1000
> "Elapsed time: 4.651 msecs"
> "Elapsed time: 3.699 msecs"
> "Elapsed time: 3.672 msecs"
> "Elapsed time: 4.561 msecs"
> "Elapsed time: 3.742 msecs"
>
> (time (dotimes [_ 1000] (.charAt sss (rand-int 1000
> "Elapsed time: 13.211 msecs"
> "Elapsed time: 14.874 msecs"
> "Elapsed time: 32.044 msecs"
> "Elapsed time: 13.849 msecs"
> "Elapsed time: 39.493 msecs"
>
> .charAt is also significantly slower than get.
>
> By replacing .length with count and .charAt with get I was able to reduce 
> the running time of my algo by orders of magnitude.
>
> These results are surprising and puzzling. You'd think direct interop with 
> Java would be the faster. Can anyone venture a guess or explain what's 
> going on here?
>
>

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




ANN Neocons 1.1.0-beta4 is released

2013-02-17 Thread Michael Klishin
Neocons [1] is a feature rich idiomatic Clojure client for the Neo4J REST
API.

1.1.0-beta4 is a milestone release with one bug fix. Release
notes are at
http://blog.clojurewerkz.org/blog/2013/02/17/neocons-1-dot-1-0-beta4-is-released/

1. http://clojureneo4j.info
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Clojure count and get functions much faster on strings than direct interop with .length and .charAt

2013-02-17 Thread Akhil Wali
Tried it out.

user> (time (dotimes [_ 1000] (.length ^String sss)))
"Elapsed time: 0.341035 msecs"
user> (time (dotimes [_ 1000] (.length ^String sss)))
"Elapsed time: 0.341105 msecs"
user> (time (dotimes [_ 1000] (.length ^String sss)))
"Elapsed time: 0.356121 msecs"
user> (time (dotimes [_ 1000] (.length ^String sss)))
"Elapsed time: 0.341035 msecs"



On Sun, Feb 17, 2013 at 7:51 PM, Nicola Mometto  wrote:

>
> Try to set! *warn-on-reflection* to true and you'll find out that
> there's a lot of reflection going on when using direct java interop.
>
> Try benchmarking (.length ^String sss) and you'll see the difference
>
> Geo writes:
>
> > I am writing an expensive algorithms in Clojure and while trying to
> > optimize the code I discovered something that puzzled me. Clojure count
> and
> > get functions are much faster on strings than direct interop with .length
> > and .charAt. On my machine I get the following:
> >
> > (def sss (apply str (repeat 1000 \a)))
> >
> > I execute each of the following tests a few times:
> >
> > (time (dotimes [_ 1000] (count sss)))
> > "Elapsed time: 0.56 msecs"
> > "Elapsed time: 0.539 msecs"
> > "Elapsed time: 0.551 msecs"
> > "Elapsed time: 0.453 msecs"
> > "Elapsed time: 0.612 msecs"
> >
> > (time (dotimes [_ 1000] (.length sss)))
> > "Elapsed time: 170.819 msecs"
> > "Elapsed time: 114.892 msecs"
> > "Elapsed time: 10.111 msecs"
> > "Elapsed time: 32.106 msecs"
> > "Elapsed time: 10.803 msecs"
> >
> > Even after something under the hood warms up (feel free to enlighten me
> :).
> > .length is still significantly slower.
> >
> > (time (dotimes [_ 1000] (get sss (rand-int 1000
> > "Elapsed time: 4.651 msecs"
> > "Elapsed time: 3.699 msecs"
> > "Elapsed time: 3.672 msecs"
> > "Elapsed time: 4.561 msecs"
> > "Elapsed time: 3.742 msecs"
> >
> > (time (dotimes [_ 1000] (.charAt sss (rand-int 1000
> > "Elapsed time: 13.211 msecs"
> > "Elapsed time: 14.874 msecs"
> > "Elapsed time: 32.044 msecs"
> > "Elapsed time: 13.849 msecs"
> > "Elapsed time: 39.493 msecs"
> >
> > .charAt is also significantly slower than get.
> >
> > By replacing .length with count and .charAt with get I was able to reduce
> > the running time of my algo by orders of magnitude.
> >
> > These results are surprising and puzzling. You'd think direct interop
> with
> > Java would be the faster. Can anyone venture a guess or explain what's
> > going on here?
> >
> > --
>
> --
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
Akhil Wali

# http://github.com/darth10 
# http://darth10.github.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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Clojure count and get functions much faster on strings than direct interop with .length and .charAt

2013-02-17 Thread Nicola Mometto

Try to set! *warn-on-reflection* to true and you'll find out that
there's a lot of reflection going on when using direct java interop.

Try benchmarking (.length ^String sss) and you'll see the difference

Geo writes:

> I am writing an expensive algorithms in Clojure and while trying to
> optimize the code I discovered something that puzzled me. Clojure count and
> get functions are much faster on strings than direct interop with .length
> and .charAt. On my machine I get the following:
>
> (def sss (apply str (repeat 1000 \a)))
>
> I execute each of the following tests a few times:
>
> (time (dotimes [_ 1000] (count sss)))
> "Elapsed time: 0.56 msecs"
> "Elapsed time: 0.539 msecs"
> "Elapsed time: 0.551 msecs"
> "Elapsed time: 0.453 msecs"
> "Elapsed time: 0.612 msecs"
>
> (time (dotimes [_ 1000] (.length sss)))
> "Elapsed time: 170.819 msecs"
> "Elapsed time: 114.892 msecs"
> "Elapsed time: 10.111 msecs"
> "Elapsed time: 32.106 msecs"
> "Elapsed time: 10.803 msecs"
>
> Even after something under the hood warms up (feel free to enlighten me :).
> .length is still significantly slower.
>
> (time (dotimes [_ 1000] (get sss (rand-int 1000
> "Elapsed time: 4.651 msecs"
> "Elapsed time: 3.699 msecs"
> "Elapsed time: 3.672 msecs"
> "Elapsed time: 4.561 msecs"
> "Elapsed time: 3.742 msecs"
>
> (time (dotimes [_ 1000] (.charAt sss (rand-int 1000
> "Elapsed time: 13.211 msecs"
> "Elapsed time: 14.874 msecs"
> "Elapsed time: 32.044 msecs"
> "Elapsed time: 13.849 msecs"
> "Elapsed time: 39.493 msecs"
>
> .charAt is also significantly slower than get.
>
> By replacing .length with count and .charAt with get I was able to reduce
> the running time of my algo by orders of magnitude.
>
> These results are surprising and puzzling. You'd think direct interop with
> Java would be the faster. Can anyone venture a guess or explain what's
> going on here?
>
> --

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Clojure count and get functions much faster on strings than direct interop with .length and .charAt

2013-02-17 Thread Geo
I am writing an expensive algorithms in Clojure and while trying to 
optimize the code I discovered something that puzzled me. Clojure count and 
get functions are much faster on strings than direct interop with .length 
and .charAt. On my machine I get the following:

(def sss (apply str (repeat 1000 \a)))

I execute each of the following tests a few times:

(time (dotimes [_ 1000] (count sss)))
"Elapsed time: 0.56 msecs"
"Elapsed time: 0.539 msecs"
"Elapsed time: 0.551 msecs"
"Elapsed time: 0.453 msecs"
"Elapsed time: 0.612 msecs"

(time (dotimes [_ 1000] (.length sss)))
"Elapsed time: 170.819 msecs"
"Elapsed time: 114.892 msecs"
"Elapsed time: 10.111 msecs"
"Elapsed time: 32.106 msecs"
"Elapsed time: 10.803 msecs"

Even after something under the hood warms up (feel free to enlighten me :). 
.length is still significantly slower.

(time (dotimes [_ 1000] (get sss (rand-int 1000
"Elapsed time: 4.651 msecs"
"Elapsed time: 3.699 msecs"
"Elapsed time: 3.672 msecs"
"Elapsed time: 4.561 msecs"
"Elapsed time: 3.742 msecs"

(time (dotimes [_ 1000] (.charAt sss (rand-int 1000
"Elapsed time: 13.211 msecs"
"Elapsed time: 14.874 msecs"
"Elapsed time: 32.044 msecs"
"Elapsed time: 13.849 msecs"
"Elapsed time: 39.493 msecs"

.charAt is also significantly slower than get.

By replacing .length with count and .charAt with get I was able to reduce 
the running time of my algo by orders of magnitude.

These results are surprising and puzzling. You'd think direct interop with 
Java would be the faster. Can anyone venture a guess or explain what's 
going on here?

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-17 Thread Michael Klishin
2013/2/17 Jim - FooBar(); 

> "clojure-doc.org" ??
> OMG, is this new? it seems to have some gorgeous tutorials for newcomers
>

It has been up since October 2012. Not much activity recently but except
for macros,
all the essentials are pretty well covered already.
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-17 Thread Mayank Jain
It's been around for quite some time actually but not known to many people
still.


On Sun, Feb 17, 2013 at 4:43 PM, Jim - FooBar(); wrote:

>  "clojure-doc.org" ??
> OMG, is this new? it seems to have some gorgeous tutorials for
> newcomers...LIke Bizics, i had no idea this site existed! How come google
> is not showing this in the first page when typing "Clojure docs" or
> something like that? I'm definately bookmarking this...
>
> Jim
>
>
>
> On 17/02/13 04:57, Bizics wrote:
>
> @Andy: Talk about unfortunate naming !!
> clojuredocs.org vs. clojure-doc.org
> There is a site called "clojure-doc.org" ??
> And it has some excellent documentation?
> I just read their CCW guide - it is excellent and would have saved me so
> much frustration but I had no idea the site existed.
>
>  "clojuredocs.org" is the goto site for example usage of clojure
> functions.
> And it is referenced from clojure.org under Documentation.
>
>  Any idea why clojure-doc.org is not mentioned under Documentation on
> clojure.org?
>
>  Maybe clojure-guides.org might be a better name?
>
>
> On Saturday, February 16, 2013 5:48:13 AM UTC-8, Jules wrote:
>>
>> @Andy: I hadn't seen that page before, and it is excellent. It explains
>> everything step-by-step and also gives key information, for example that it
>> is not necessary to install leiningen manually because it comes with CCW.
>> If possible, that guide should be featured prominently on
>> http://code.google.com/p/**counterclockwise/and
>>  perhaps on
>> clojure.org. That would solve 90% of the difficulty of installation I
>> think. Even following that guide, CCW still won't run leiningen on my
>> windows 7 system, but maybe that's an anomaly possibly caused by me messing
>> up something during previous installation attempts.
>>
>--
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>  --
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Regards,
Mayank.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Using local jar

2013-02-17 Thread Jim - FooBar();
Even though what Aaron said is correct, I'll just add that with lein2 
you can get away with not "installing" your jar in ~/.m2/. Just use the 
:resource-paths key in your project.clj and point to a folder with 
'orphan' jars...something like this:


:resource-paths ["orphan-jars/*"]  ;;all jars under directory 
orphan-jars (temporary hack)


this tells lein2 to include this directory in your classpath...all that 
is left is to import the classes you want from your own namespaces...If 
you've got bare classes instead of a jar use the :java-source-paths key 
instead...


HTH, :-)

Jim


On 17/02/13 00:18, Aaron Cohen wrote:

Also, reading further on the blog, for lein2 you need to change


mvninstall:install-file-Dfile=jaad-0.8.3.jar-DartifactId=jaad-Dversion=0.8.3-DgroupId=jaad-Dpackaging=jar-DlocalRepositoryPath=maven_repository

to
|mvn deploy:deploy-file|  -Dfile=jaad-0.8.3.jar  -DartifactId=jaad  
-Dversion=0.8.3  -DgroupId=jaad -Dpackaging=jar -Durl=file:maven_repository


On Sat, Feb 16, 2013 at 7:13 PM, Aaron Cohen > wrote:


I'm not sure if this is your problem, but a newbie might not
realize one thing from that blog post.

After doing all the steps there, you still have to add the
dependency for that artifact in your project.clj

I don't know how you named your local jar, but for their example
you would need to add

:dependencies [

[jaad/jaad "0.8.3"]]


On Sat, Feb 16, 2013 at 6:00 PM, Jarod mailto:jaaroddeerfi...@yahoo.com>> wrote:

Hi.  This is a really basic question, as I'm new to Clojure
and Java.  I'm trying to use a jar file for Stanford's NLP
software that isn't available on Maven.  I successfully ran
the commands from this website:

www.pgrs.net/2011/10/30/using-local-jars-with-leiningen/


to create a local maven repository, but how do I access the
methods in the jar now?  I created a project using leiningen
with eclipse and counterclockwise and I add the following to
core.clj in the src directory to import the jar:

(import 'stanford-corenlp)

where stanford-corenlp is the name of the directory in the
local maven repository.  However, I get the error:

ClassNotFoundException stanford-corenlp
 java.net.URLClassLoader$1.run (URLClassLoader.java:217)

Thanks in advance for your help.
-- 
-- 
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 unsubscribe from this group and stop receiving emails from
it, send an email to clojure+unsubscr...@googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.




--
--
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 unsubscribe from this group and stop receiving emails from it, send 
an email to clojure+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.




--
--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-17 Thread Jim - FooBar();

"clojure-doc.org" ??
OMG, is this new? it seems to have some gorgeous tutorials for 
newcomers...LIke Bizics, i had no idea this site existed! How come 
google is not showing this in the first page when typing "Clojure docs" 
or something like that? I'm definately bookmarking this...


Jim


On 17/02/13 04:57, Bizics wrote:

@Andy: Talk about unfortunate naming !!
clojuredocs.org vs. clojure-doc.org
There is a site called "clojure-doc.org" ??
And it has some excellent documentation?
I just read their CCW guide - it is excellent and would have saved me 
so much frustration but I had no idea the site existed.


"clojuredocs.org" is the goto site for example usage of clojure functions.
And it is referenced from clojure.org under Documentation.

Any idea why clojure-doc.org is not mentioned under Documentation on 
clojure.org?


Maybe clojure-guides.org might be a better name?


On Saturday, February 16, 2013 5:48:13 AM UTC-8, Jules wrote:

@Andy: I hadn't seen that page before, and it is excellent. It
explains everything step-by-step and also gives key information,
for example that it is not necessary to install leiningen manually
because it comes with CCW. If possible, that guide should be
featured prominently on http://code.google.com/p/counterclockwise/
 and perhaps on
clojure.org . That would solve 90% of the
difficulty of installation I think. Even following that guide, CCW
still won't run leiningen on my windows 7 system, but maybe that's
an anomaly possibly caused by me messing up something during
previous installation attempts.

--
--
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 unsubscribe from this group and stop receiving emails from it, send 
an email to clojure+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.




--
--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




ANN Langohr 1.0.0-beta11

2013-02-17 Thread Michael Klishin
Langohr [1] is a Clojure RabbitMQ client that embraces AMQP 0.9.1 Model [2].

Release notes for beta11:
http://blog.clojurewerkz.org/blog/2013/02/17/langohr-1-dot-0-0-beta11-is-released/

1. http://clojurerabbitmq.info
2. http://www.rabbitmq.com/tutorials/amqp-concepts.html
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-17 Thread BJG145
...agreed, the introduction to CCW at:

http://clojure-doc.org/articles/tutorials/eclipse.html

...is simple enough even for me to understand, and I'm now happy that CCW 
is working. I'd previously tried:

http://dev.clojure.org/display/doc/Getting+Started+with+Eclipse+and+Counterclockwise

...which I found very confusing. (It doesn't help that the brief 
introductory paragraph is immediately followed by a lengthy error report 
that someone has posted up.)

Just for reference, the only point of difficulty for a total beginner 
seeing the clojure-doc.org version for the first time is that the "Hello 
World" function described on that page differs from the one I see, which 
has "defn foo" with an argument instead of "defn -main" without. (I also 
find the automatic bracket insertion in the REPL and the way you have to 
cursor past them instead of typing them quite off-putting; I'd prefer it as 
an option than as a default. I only mention it because it was one of the 
things that muddled my first attempt with CCW to the extent that I didn't 
think the REPL was working, and I think it deserves a mention in the 
introduction.)

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.