Couplet 0.1.0 – Unicode code points support for Clojure

2017-10-19 Thread Daniel
Nice!

-- 
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/d/optout.


Re: Clojure for big data

2017-10-19 Thread Christopher Penrose
And I will have to look at Onyx much more closely :)

On Thursday, October 19, 2017 at 2:01:52 PM UTC-7, Christopher Small wrote:
>
> Onyx has been very well maintained, has excellent documentation, and 
> doesn't suffer any of the AOT issues.
>

-- 
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/d/optout.


Re: Clojure for big data

2017-10-19 Thread Alex Miller
Check out https://www.youtube.com/watch?v=OxUHgP4Ox5Q for his talk about it.

On Thursday, October 19, 2017 at 4:01:52 PM UTC-5, Christopher Small wrote:
>
> Thanks for the helpful information Christopher. I'll have to look at 
> Powderkeg.
>
> The AOT issue is a big one. Being able to launch things from the REPL is 
> huge. That's actually one of the many advantages of Onyx over Storm (if 
> you're looking at the streaming side of things). Towards the end of my 
> using Storm I became increasingly frustrated with the project. At the time, 
> it was an Apache Incubator project, and development had slowed to a grind. 
> The Clojure API became woefully incompatible with more recent Clojures, 
> preventing us from upgrading for some time. They also began shifting focus 
> away from the Clojure API, and in turn the documentation became woefully 
> out of date. I've heard that some of these issues got a bit better as the 
> project came out of Incubator status, but others remain. In contrast, Onyx 
> has been very well maintained, has excellent documentation, and doesn't 
> suffer any of the AOT issues.
>
> Chris
>
>
>
> On Thu, Oct 19, 2017 at 1:02 PM, Christopher Penrose <
> cpenr...@steelcase.com> wrote:
>
>>
>> The #bigdata channel over on Clojurians slack is also suspiciously quiet, 
>>> as are many of the Google groups.
>>>
>>> Ray.
>>>
>>
>> I worked with Sparkling and Flambo about a year ago, while Mr. Macbeth is 
>> a fellow Portlander and has a solid API, I found Sparkling to be somewhat 
>> more direct and compact.  For ETL via Hadoop I wouldn't hesitate to try 
>> either of these libraries.  I found them to be stable and preferable to 
>> using Spark in Scala.  However, I used Powderkeg (
>> https://github.com/HCADatalab/powderkeg) a bit and found it the most 
>> intriguing.  Christophe Grand last updated PowderKeg three hours ago (from 
>> time of my posting obviously).  Powderkeg relies heavily on Clojure 
>> transducers and is the only Clojure Spark library I am aware of which 
>> doesn't require AOT compilation -- you can use a Clojure repl to directly 
>> spawn jobs on a Spark cluster.  If you are interested in Clojure 
>> interoperability with Spark, I would look at Powderkeg first.
>>
>> If you require Spark Streaming, you might be better off writing Scala, or 
>> considering another streaming solution such as Storm.  The closest I have 
>> come to getting Spark Streaming to work in Clojure was with Powderkeg.  It 
>> might be worth seeing if Powderkeg has made progress in this area.
>>
>> -- 
>> 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 a topic in the 
>> Google Groups "Clojure" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/clojure/ESkUu0Tmqmg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/d/optout.


Re: Clojure for big data

2017-10-19 Thread Christopher Small
Thanks for the helpful information Christopher. I'll have to look at
Powderkeg.

The AOT issue is a big one. Being able to launch things from the REPL is
huge. That's actually one of the many advantages of Onyx over Storm (if
you're looking at the streaming side of things). Towards the end of my
using Storm I became increasingly frustrated with the project. At the time,
it was an Apache Incubator project, and development had slowed to a grind.
The Clojure API became woefully incompatible with more recent Clojures,
preventing us from upgrading for some time. They also began shifting focus
away from the Clojure API, and in turn the documentation became woefully
out of date. I've heard that some of these issues got a bit better as the
project came out of Incubator status, but others remain. In contrast, Onyx
has been very well maintained, has excellent documentation, and doesn't
suffer any of the AOT issues.

Chris



On Thu, Oct 19, 2017 at 1:02 PM, Christopher Penrose  wrote:

>
> The #bigdata channel over on Clojurians slack is also suspiciously quiet,
>> as are many of the Google groups.
>>
>> Ray.
>>
>
> I worked with Sparkling and Flambo about a year ago, while Mr. Macbeth is
> a fellow Portlander and has a solid API, I found Sparkling to be somewhat
> more direct and compact.  For ETL via Hadoop I wouldn't hesitate to try
> either of these libraries.  I found them to be stable and preferable to
> using Spark in Scala.  However, I used Powderkeg (https://github.com/
> HCADatalab/powderkeg) a bit and found it the most intriguing.  Christophe
> Grand last updated PowderKeg three hours ago (from time of my posting
> obviously).  Powderkeg relies heavily on Clojure transducers and is the
> only Clojure Spark library I am aware of which doesn't require AOT
> compilation -- you can use a Clojure repl to directly spawn jobs on a Spark
> cluster.  If you are interested in Clojure interoperability with Spark, I
> would look at Powderkeg first.
>
> If you require Spark Streaming, you might be better off writing Scala, or
> considering another streaming solution such as Storm.  The closest I have
> come to getting Spark Streaming to work in Clojure was with Powderkeg.  It
> might be worth seeing if Powderkeg has made progress in this area.
>
> --
> 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 a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/clojure/ESkUu0Tmqmg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/d/optout.


Re: Releasing scope-capture, a library for easing REPL-based debugging

2017-10-19 Thread Mike Rodriguez
@Val Waeselynck

I upgraded to 0.1.3 and it seems to be working without the issue #1 
workaround anymore. I read the documentation that you referenced as well. 
It is useful and helps clarify what sort of situations can come up.
Thanks!

On Thursday, October 19, 2017 at 8:19:43 AM UTC-4, Val Waeselynck wrote:
>
> @Mike Rodriguez the 0.1.3 release improves ClojureScript support and 
> should solve the mentioned issue, along with much better documentation 
> 
>  
> regarding ClojureScript support. Please tell me if you still have issues.
>
> Cheers,
>
> Val
>
> On Saturday, 14 October 2017 20:31:35 UTC+2, Mike Rodriguez wrote:
>>
>> I really like this library already. I only had to give it about 5 minutes 
>> of time to immediately see how it simplified quick REPL-driven debugging 
>> workflows for me.
>>
>> The only outstanding issue that is an annoyance for me is the CLJS 
>> support, which is discussed at 
>> https://github.com/alvalval/scope-capture/issues/1 and the 
>> workaround @ 
>> https://github.com/alvalval/scope-capture/issues/1#issuecomment-335117655
>>  
>> is enough to get it working for me. So hopefully that is smoothed over 
>> soon. I haven't dug into the impl details enough at this point to say I 
>> know exactly what the issue is there. I might though if it stays open a 
>> while!
>>
>> Thanks for the lib. It seems really minimal and immediately useful.
>>
>> On Sunday, October 8, 2017 at 3:09:19 AM UTC-4, Val Waeselynck wrote:
>>>
>>> Hi, I'm happy to release a tiny Clojure/Script library called 
>>> scope-capture .
>>>
>>> https://github.com/alvalval/scope-capture
>>>
>>> Loosely speaking, scope-capture makes it trivial to reproduce from the 
>>> REPL the context of a piece of code after it executed. 
>>>
>>> It was inspired by Stuart Halloway's article *REPL Debugging: no 
>>> stacktrace required 
>>> *.
>>>  
>>> Thanks Stu!
>>>
>>> I've been using it professionally for a few weeks now, and it's been a 
>>> significant productivity boost for me. In my view the benefits are:
>>>
>>>- easier debugging
>>>- making Clojure code / projects more accessible to beginners
>>>- easier ad-hoc exploration
>>>
>>> Please let me know what you think!
>>>
>>> Valentin Waeselynck
>>>
>>

-- 
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/d/optout.


Re: why java version in 10 times faster?

2017-10-19 Thread Howard Lewis Ship
Clojure code is typically fast enough, written simply.

Clojure can be about as fast as Java by adding type signatures and/or
adopting some well known approaches (e.g. Transducers, transients)

For real applications, Clojure algorithms are as fast or faster than Java
algorithms.

On Sun, Oct 15, 2017 at 11:42 PM Mike <145...@gmail.com> wrote:

> Hello!
>
> I took an example from https://clojure.org/references/refs (select two
> random positions in two random vectors and swap them, in a transaction.)
> A java version is faster in 10 times (in attach), and threre is no human
> brain complexity in concurrency in  java version.
>
> Why clojure version so slow?
>
> Mike.
>
> --
> 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/d/optout.
>
-- 
Howard M. Lewis Ship

Senior Mobile Developer at Walmart Labs

Creator of Apache Tapestry

(971) 678-5210
http://howardlewisship.com
@hlship

-- 
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/d/optout.


Couplet 0.1.0 – Unicode code points support for Clojure

2017-10-19 Thread David Bürgin
Clojure strings are made up of chars, but the conventional unit of
digital texts is Unicode characters (‘code points’). Effective work at
the boundary requires a library –

• a reducible seqable representation of strings as code points
• supports fold
• transducer for converting chars to code points
• copy-pastably small

https://github.com/glts/couplet

Thank you,


-- 
David

-- 
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/d/optout.


RE: mysql and clojure

2017-10-19 Thread Sean Corfield
I don’t know what documentation you’re working from but it looks outdated, 
based on your code.

Have a read of http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html -- 
that will walk you through the basics of using java.jdbc

If you’re on the Clojurians Slack (signup at http://clojurians.net/ and 
read/post messages from https://clojurians.slack.com/ or use a desktop client), 
there’s a #sql channel for all things JDBC-related.

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


From: clojure@googlegroups.com  on behalf of Damien 
Mattei 
Sent: Thursday, October 19, 2017 3:37:08 AM
To: Clojure
Subject: mysql and clojure

hello again,

i tried dozen of web example about mysql and clojure but it doen't work, here 
is some of my code:

for dependencies:

(defproject jclojure "0.1.0-SNAPSHOT"
  :description "clojure JVM source code for Sidonie web interface 
administration"
  :url "https://sidonie.oca.eu;
  :license {:name "Eclipse Public License"
  :url "http://www.eclipse.org/legal/epl-v10.html"}

  :dependencies [
  [org.clojure/clojure "1.8.0"]
  [mysql/mysql-connector-java "5.1.38"]
  [org.clojure/java.jdbc "0.7.3"]
  ]

  :main ^:skip-aot jclojure.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})


the code (some of...):

(ns jclojure.core
(:gen-class))

(defn -main
  "I don't do a whole lot ... yet."
  [& args]

  ;(:require [clojure.java [jdbc :as sql]])

  ;(require '[clojure.java.jdbc :as jdbc])

  (ns dbns
  (:require [clojure.java.jdbc :as jdbc]
  [mysql/mysql-connector-java "5.1.38"]))

  ;(use 'clojure.java.jdbc)

  (println "Hello, World!")

  (let [
db-host "localhost"
db-port 3306
db-name "sidonie"
]

(def db {
 :classname "com.mysql.jdbc.Driver" ; must be in classpath
 :subprotocol "mysql"
 :subname (str "//" db-host ":" db-port "/" db-name)
; Any additional keys are passed to the driver
; as driver-specific properties.
 :user "mattei"
 :password "sidonie2"}))

;(jdbc/query db ["SELECT * FROM Sigles"])

  (jdbc/with-connection db
(jdbc/with-query-results rows
 ["select * from Sigles"]
 (println rows)))


  )


and now the error:

[mattei@moita jclojure]$ lein run
Exception in thread "main" java.lang.RuntimeException: No such namespace: jdbc, 
compiling:(jclojure/core.clj:37:3)
at clojure.lang.Compiler.analyze(Compiler.java:6688)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3766)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5380)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3972)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6866)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:589)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler.eval(Compiler.java:6931)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5774)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
  

Re: Clojure for big data

2017-10-19 Thread Erik Assum
FWIW, I filed an issue and submitted a PR against flambo this summer.
It was merged on the same day and released two weeks later, so flambo seems 
active when needed.

Erik.

> On 18 Oct 2017, at 13:02, Ray Miller  wrote:
> 
> This is partly prompted by the lack of activity on the Github repos. Are the 
> Parkour, Flambo and Sparkling libraries rock solid, or simply not getting 
> enough use to trigger bugs and feature requests?

-- 
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/d/optout.


Re: Clojure for big data

2017-10-19 Thread 'William Parker' via Clojure
Perhaps it is an obvious point, but I'll mention that like other Java 
libraries, it is possible to use libraries from the Java Big Data ecosystem 
e.g. Spark directly from Clojure using interop, or to consume Clojure code 
as part of processing infrastructure written in other JVM languages.  We've 
had considerable success using both approaches.  The experience with 
interop has been pretty smooth; the only significant hassles I recall 
having related to having to write serialization/deserialization logic that 
we would have gotten out of the box with Java classes and with AOT-compiled 
code interacting in strange ways with Hadoop's classloading (we never 
satisfactorily diagnosed this and eventually just stopped using AOT).

On Wednesday, October 18, 2017 at 6:03:11 AM UTC-5, Ray Miller wrote:
>
> Hi,
>
> Here at Metail we have been using Clojure for medium-sized data processing 
> on AWS EMR. We started out with Cascalog about 5 years ago, switched to 
> Parkour 2 years ago, and are now considering a move to Spark.
>
> My question is: is Clojure still a good choice for medium/large data 
> processing on EMR?
>
> This is partly prompted by the lack of activity on the Github repos. Are 
> the Parkour, Flambo and Sparkling libraries rock solid, or simply not 
> getting enough use to trigger bugs and feature requests? 
>
> The #bigdata channel over on Clojurians slack is also suspiciously quiet, 
> as are many of the Google groups.
>
> Ray.
>

-- 
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/d/optout.


Re: mysql and clojure

2017-10-19 Thread Lubomir Konstantinov
Cool. You had to remove it, cause it was a leiningen dependency, not a 
proper :require clause - I guess I didn't pay enough attention too :)

It looks like you are trying to learn by example and are skipping the 
basics. If you havent - this is very nice and gentle introduction that will 
help you lay the foundations - https://www.braveclojure.com/

On Thursday, 19 October 2017 16:10:39 UTC+3, Damien Mattei wrote:
>
> Thank Lubomir,
> it works, i'm new to Clojure and did not use the name space the right way, 
> i had to remove [mysql/mysql-connector-java "5.1.38"] also , do not know 
> why...
>
> here is the working code and result:
>
> (ns jclojure.core
> (:gen-class)
> (:require [clojure.java.jdbc :as jdbc] )
> )
>
> ;(ns jclojure.core
> ;(:gen-class)
> ;(:require [clojure.java.jdbc :as jdbc]
> ;  [mysql/mysql-connector-java "5.1.38"]))
>
>
> (defn -main
>   "I don't do a whole lot ... yet."
>   [& args]
>   
>   ;(:require [clojure.java [jdbc :as sql]])
>
>   ;(require '[clojure.java.jdbc :as jdbc])
>
>   ;(ns dbns
>;   (:require [clojure.java.jdbc :as jdbc]
>   ;[mysql/mysql-connector-java "5.1.38"]))
>   
>   ;(use 'clojure.java.jdbc)
>   
>   (println "Hello, World!")
>
>   (let [
> db-host "localhost"
> db-port 3306
> db-name "sidonie"
> ]
> 
> (def db {
>  :classname "com.mysql.jdbc.Driver" ; must be in classpath
>  :subprotocol "mysql"
>  :subname (str "//" db-host ":" db-port "/" db-name)
> ; Any additional keys are passed to the driver
> ; as driver-specific properties.
>  :user "mattei"
>  :password "sidonie2"}))
>   
> ;(jdbc/query db ["SELECT * FROM Sigles"])
>
>   (jdbc/query db
>   ["select * from Sigles"]
>   {:row-fn println}  )
>
>   ;(jdbc/with-connection db
> ;(jdbc/with-query-results rows
> ; ["select * from Sigles"]
> ; (println rows)))
>
>  
>   )
>
> [mattei@moita jclojure]$ lein run
> Hello, World!
> {:sigle ApJ, :intitulé AstroPhysical Journal}
> {:sigle ApJS, :intitulé AstroPhysical Journal - supplement}
> {:sigle A, :intitulé Astronomy and Astrophysics}
> {:sigle A, :intitulé Astronomy and Astrophysics - supplement series}
> {:sigle A.A.W., :intitulé Acta Astronomica Warszawa}
> {:sigle ABO, :intitulé Annals Bosscha Observatory}
> {:sigle ABS, :intitulé Annals Bosscha Sterrenwacht}
> {:sigle ADONU, :intitulé Annals Dearborn Observatory - Northwestern 
> University}
> {:sigle AJ, :intitulé Astronomical Journal}
> {:sigle AJS, :intitulé Astronomical Journal - supplement}
> {:sigle AN, :intitulé Astronomische Nachrichten}
> {:sigle AORB, :intitulé Annales de l'Observatoire Royal de Belgique}
> {:sigle AOS, :intitulé Annales de l'Observatoire
>
> ...
>
>
> Damien
>
>
> On Thursday, October 19, 2017 at 12:49:31 PM UTC+2, Lubomir Konstantinov 
> wrote:
>>
>> Bad case of copy pasta?
>>
>> You have am extra namespace definition:
>>
>>   (ns dbns
>>   (:require [clojure.java.jdbc :as jdbc]
>>   [mysql/mysql-connector-java "5.1.38"]))
>>
>> You need to remove it, and move the require clause up in your ns:
>>
>> (ns jclojure.core
>> (:gen-class)
>> (:require [clojure.java.jdbc :as jdbc]
>>   [mysql/mysql-connector-java "5.1.38"]))
>>
>> On Thursday, 19 October 2017 13:37:08 UTC+3, Damien Mattei wrote:
>>>
>>> hello again,
>>>
>>> i tried dozen of web example about mysql and clojure but it doen't work, 
>>> here is some of my code:
>>>
>>> for dependencies:
>>>
>>> (defproject jclojure "0.1.0-SNAPSHOT"
>>>   :description "clojure JVM source code for Sidonie web interface 
>>> administration"
>>>   :url "https://sidonie.oca.eu;
>>>   :license {:name "Eclipse Public License"
>>>   :url "http://www.eclipse.org/legal/epl-v10.html"}
>>>
>>>   :dependencies [
>>>   [org.clojure/clojure "1.8.0"]  
>>>   [mysql/mysql-connector-java "5.1.38"]
>>>   [org.clojure/java.jdbc "0.7.3"]
>>>   ]
>>>
>>>   :main ^:skip-aot jclojure.core
>>>   :target-path "target/%s"
>>>   :profiles {:uberjar {:aot :all}})
>>>
>>>
>>> the code (some of...):
>>>
>>> (ns jclojure.core
>>> (:gen-class))
>>>
>>> (defn -main
>>>   "I don't do a whole lot ... yet."
>>>   [& args]
>>>   
>>>   ;(:require [clojure.java [jdbc :as sql]])
>>>
>>>   ;(require '[clojure.java.jdbc :as jdbc])
>>>
>>>   (ns dbns
>>>   (:require [clojure.java.jdbc :as jdbc]
>>>   [mysql/mysql-connector-java "5.1.38"]))
>>>   
>>>   ;(use 'clojure.java.jdbc)
>>>   
>>>   (println "Hello, World!")
>>>
>>>   (let [
>>> db-host "localhost"
>>> db-port 3306
>>> db-name "sidonie"
>>> ]
>>> 
>>> (def db {
>>>  :classname "com.mysql.jdbc.Driver" ; must be in classpath
>>>  :subprotocol "mysql"
>>>  :subname (str "//" db-host ":" db-port "/" db-name)
>>> ; Any additional keys are passed to the driver
>>> ; as driver-specific 

Re: mysql and clojure

2017-10-19 Thread Rostislav Svoboda
Have a look at dbcon.clj and db.clj in my https://github.com/Bost/ufo
It's a rather minimal example of clojure/clojurescript + mysql


2017-10-19 15:10 GMT+02:00 Damien Mattei :
> Thank Lubomir,
> it works, i'm new to Clojure and did not use the name space the right way, i
> had to remove [mysql/mysql-connector-java "5.1.38"] also , do not know
> why...
>
> here is the working code and result:
>
> (ns jclojure.core
> (:gen-class)
> (:require [clojure.java.jdbc :as jdbc] )
> )
>
> ;(ns jclojure.core
> ;(:gen-class)
> ;(:require [clojure.java.jdbc :as jdbc]
> ;  [mysql/mysql-connector-java "5.1.38"]))
>
>
> (defn -main
>   "I don't do a whole lot ... yet."
>   [& args]
>
>   ;(:require [clojure.java [jdbc :as sql]])
>
>   ;(require '[clojure.java.jdbc :as jdbc])
>
>   ;(ns dbns
>;   (:require [clojure.java.jdbc :as jdbc]
>   ;[mysql/mysql-connector-java "5.1.38"]))
>
>   ;(use 'clojure.java.jdbc)
>
>   (println "Hello, World!")
>
>   (let [
> db-host "localhost"
> db-port 3306
> db-name "sidonie"
> ]
>
> (def db {
>  :classname "com.mysql.jdbc.Driver" ; must be in classpath
>  :subprotocol "mysql"
>  :subname (str "//" db-host ":" db-port "/" db-name)
> ; Any additional keys are passed to the driver
> ; as driver-specific properties.
>  :user "mattei"
>  :password "sidonie2"}))
>
> ;(jdbc/query db ["SELECT * FROM Sigles"])
>
>   (jdbc/query db
>   ["select * from Sigles"]
>   {:row-fn println}  )
>
>   ;(jdbc/with-connection db
> ;(jdbc/with-query-results rows
> ; ["select * from Sigles"]
> ; (println rows)))
>
>
>   )
>
> [mattei@moita jclojure]$ lein run
> Hello, World!
> {:sigle ApJ, :intitulé AstroPhysical Journal}
> {:sigle ApJS, :intitulé AstroPhysical Journal - supplement}
> {:sigle A, :intitulé Astronomy and Astrophysics}
> {:sigle A, :intitulé Astronomy and Astrophysics - supplement series}
> {:sigle A.A.W., :intitulé Acta Astronomica Warszawa}
> {:sigle ABO, :intitulé Annals Bosscha Observatory}
> {:sigle ABS, :intitulé Annals Bosscha Sterrenwacht}
> {:sigle ADONU, :intitulé Annals Dearborn Observatory - Northwestern
> University}
> {:sigle AJ, :intitulé Astronomical Journal}
> {:sigle AJS, :intitulé Astronomical Journal - supplement}
> {:sigle AN, :intitulé Astronomische Nachrichten}
> {:sigle AORB, :intitulé Annales de l'Observatoire Royal de Belgique}
> {:sigle AOS, :intitulé Annales de l'Observatoire
>
> ...
>
>
> Damien
>
>
>
> On Thursday, October 19, 2017 at 12:49:31 PM UTC+2, Lubomir Konstantinov
> wrote:
>>
>> Bad case of copy pasta?
>>
>> You have am extra namespace definition:
>>
>>   (ns dbns
>>   (:require [clojure.java.jdbc :as jdbc]
>>   [mysql/mysql-connector-java "5.1.38"]))
>>
>> You need to remove it, and move the require clause up in your ns:
>>
>> (ns jclojure.core
>> (:gen-class)
>> (:require [clojure.java.jdbc :as jdbc]
>>   [mysql/mysql-connector-java "5.1.38"]))
>>
>> On Thursday, 19 October 2017 13:37:08 UTC+3, Damien Mattei wrote:
>>>
>>> hello again,
>>>
>>> i tried dozen of web example about mysql and clojure but it doen't work,
>>> here is some of my code:
>>>
>>> for dependencies:
>>>
>>> (defproject jclojure "0.1.0-SNAPSHOT"
>>>   :description "clojure JVM source code for Sidonie web interface
>>> administration"
>>>   :url "https://sidonie.oca.eu;
>>>   :license {:name "Eclipse Public License"
>>>   :url "http://www.eclipse.org/legal/epl-v10.html"}
>>>
>>>   :dependencies [
>>>   [org.clojure/clojure "1.8.0"]
>>>   [mysql/mysql-connector-java "5.1.38"]
>>>   [org.clojure/java.jdbc "0.7.3"]
>>>   ]
>>>
>>>   :main ^:skip-aot jclojure.core
>>>   :target-path "target/%s"
>>>   :profiles {:uberjar {:aot :all}})
>>>
>>>
>>> the code (some of...):
>>>
>>> (ns jclojure.core
>>> (:gen-class))
>>>
>>> (defn -main
>>>   "I don't do a whole lot ... yet."
>>>   [& args]
>>>
>>>   ;(:require [clojure.java [jdbc :as sql]])
>>>
>>>   ;(require '[clojure.java.jdbc :as jdbc])
>>>
>>>   (ns dbns
>>>   (:require [clojure.java.jdbc :as jdbc]
>>>   [mysql/mysql-connector-java "5.1.38"]))
>>>
>>>   ;(use 'clojure.java.jdbc)
>>>
>>>   (println "Hello, World!")
>>>
>>>   (let [
>>> db-host "localhost"
>>> db-port 3306
>>> db-name "sidonie"
>>> ]
>>>
>>> (def db {
>>>  :classname "com.mysql.jdbc.Driver" ; must be in classpath
>>>  :subprotocol "mysql"
>>>  :subname (str "//" db-host ":" db-port "/" db-name)
>>> ; Any additional keys are passed to the driver
>>> ; as driver-specific properties.
>>>  :user "mattei"
>>>  :password "sidonie2"}))
>>>
>>> ;(jdbc/query db ["SELECT * FROM Sigles"])
>>>
>>>   (jdbc/with-connection db
>>> (jdbc/with-query-results rows
>>>  ["select * from 

Re: mysql and clojure

2017-10-19 Thread Damien Mattei
Thank Lubomir,
it works, i'm new to Clojure and did not use the name space the right way, 
i had to remove [mysql/mysql-connector-java "5.1.38"] also , do not know 
why...

here is the working code and result:

(ns jclojure.core
(:gen-class)
(:require [clojure.java.jdbc :as jdbc] )
)

;(ns jclojure.core
;(:gen-class)
;(:require [clojure.java.jdbc :as jdbc]
;  [mysql/mysql-connector-java "5.1.38"]))


(defn -main
  "I don't do a whole lot ... yet."
  [& args]
  
  ;(:require [clojure.java [jdbc :as sql]])

  ;(require '[clojure.java.jdbc :as jdbc])

  ;(ns dbns
   ;   (:require [clojure.java.jdbc :as jdbc]
  ;[mysql/mysql-connector-java "5.1.38"]))
  
  ;(use 'clojure.java.jdbc)
  
  (println "Hello, World!")

  (let [
db-host "localhost"
db-port 3306
db-name "sidonie"
]

(def db {
 :classname "com.mysql.jdbc.Driver" ; must be in classpath
 :subprotocol "mysql"
 :subname (str "//" db-host ":" db-port "/" db-name)
; Any additional keys are passed to the driver
; as driver-specific properties.
 :user "mattei"
 :password "sidonie2"}))
  
;(jdbc/query db ["SELECT * FROM Sigles"])

  (jdbc/query db
  ["select * from Sigles"]
  {:row-fn println}  )

  ;(jdbc/with-connection db
;(jdbc/with-query-results rows
; ["select * from Sigles"]
; (println rows)))

 
  )

[mattei@moita jclojure]$ lein run
Hello, World!
{:sigle ApJ, :intitulé AstroPhysical Journal}
{:sigle ApJS, :intitulé AstroPhysical Journal - supplement}
{:sigle A, :intitulé Astronomy and Astrophysics}
{:sigle A, :intitulé Astronomy and Astrophysics - supplement series}
{:sigle A.A.W., :intitulé Acta Astronomica Warszawa}
{:sigle ABO, :intitulé Annals Bosscha Observatory}
{:sigle ABS, :intitulé Annals Bosscha Sterrenwacht}
{:sigle ADONU, :intitulé Annals Dearborn Observatory - Northwestern 
University}
{:sigle AJ, :intitulé Astronomical Journal}
{:sigle AJS, :intitulé Astronomical Journal - supplement}
{:sigle AN, :intitulé Astronomische Nachrichten}
{:sigle AORB, :intitulé Annales de l'Observatoire Royal de Belgique}
{:sigle AOS, :intitulé Annales de l'Observatoire

...


Damien


On Thursday, October 19, 2017 at 12:49:31 PM UTC+2, Lubomir Konstantinov 
wrote:
>
> Bad case of copy pasta?
>
> You have am extra namespace definition:
>
>   (ns dbns
>   (:require [clojure.java.jdbc :as jdbc]
>   [mysql/mysql-connector-java "5.1.38"]))
>
> You need to remove it, and move the require clause up in your ns:
>
> (ns jclojure.core
> (:gen-class)
> (:require [clojure.java.jdbc :as jdbc]
>   [mysql/mysql-connector-java "5.1.38"]))
>
> On Thursday, 19 October 2017 13:37:08 UTC+3, Damien Mattei wrote:
>>
>> hello again,
>>
>> i tried dozen of web example about mysql and clojure but it doen't work, 
>> here is some of my code:
>>
>> for dependencies:
>>
>> (defproject jclojure "0.1.0-SNAPSHOT"
>>   :description "clojure JVM source code for Sidonie web interface 
>> administration"
>>   :url "https://sidonie.oca.eu;
>>   :license {:name "Eclipse Public License"
>>   :url "http://www.eclipse.org/legal/epl-v10.html"}
>>
>>   :dependencies [
>>   [org.clojure/clojure "1.8.0"]  
>>   [mysql/mysql-connector-java "5.1.38"]
>>   [org.clojure/java.jdbc "0.7.3"]
>>   ]
>>
>>   :main ^:skip-aot jclojure.core
>>   :target-path "target/%s"
>>   :profiles {:uberjar {:aot :all}})
>>
>>
>> the code (some of...):
>>
>> (ns jclojure.core
>> (:gen-class))
>>
>> (defn -main
>>   "I don't do a whole lot ... yet."
>>   [& args]
>>   
>>   ;(:require [clojure.java [jdbc :as sql]])
>>
>>   ;(require '[clojure.java.jdbc :as jdbc])
>>
>>   (ns dbns
>>   (:require [clojure.java.jdbc :as jdbc]
>>   [mysql/mysql-connector-java "5.1.38"]))
>>   
>>   ;(use 'clojure.java.jdbc)
>>   
>>   (println "Hello, World!")
>>
>>   (let [
>> db-host "localhost"
>> db-port 3306
>> db-name "sidonie"
>> ]
>> 
>> (def db {
>>  :classname "com.mysql.jdbc.Driver" ; must be in classpath
>>  :subprotocol "mysql"
>>  :subname (str "//" db-host ":" db-port "/" db-name)
>> ; Any additional keys are passed to the driver
>> ; as driver-specific properties.
>>  :user "mattei"
>>  :password "sidonie2"}))
>>   
>> ;(jdbc/query db ["SELECT * FROM Sigles"])
>>
>>   (jdbc/with-connection db
>> (jdbc/with-query-results rows
>>  ["select * from Sigles"]
>>  (println rows)))
>>
>>  
>>   )
>>
>>
>> and now the error:
>>
>> [mattei@moita jclojure]$ lein run
>> Exception in thread "main" java.lang.RuntimeException: No such namespace: 
>> jdbc, compiling:(jclojure/core.clj:37:3)
>> at clojure.lang.Compiler.analyze(Compiler.java:6688)
>> at clojure.lang.Compiler.analyze(Compiler.java:6625)
>> at 

Re: Releasing scope-capture, a library for easing REPL-based debugging

2017-10-19 Thread Val Waeselynck
@Mike Rodriguez the 0.1.3 release improves ClojureScript support and should 
solve the mentioned issue, along with much better documentation 

 
regarding ClojureScript support. Please tell me if you still have issues.

Cheers,

Val

On Saturday, 14 October 2017 20:31:35 UTC+2, Mike Rodriguez wrote:
>
> I really like this library already. I only had to give it about 5 minutes 
> of time to immediately see how it simplified quick REPL-driven debugging 
> workflows for me.
>
> The only outstanding issue that is an annoyance for me is the CLJS 
> support, which is discussed at 
> https://github.com/alvalval/scope-capture/issues/1 and the workaround 
> @ 
> https://github.com/alvalval/scope-capture/issues/1#issuecomment-335117655 
> is enough to get it working for me. So hopefully that is smoothed over 
> soon. I haven't dug into the impl details enough at this point to say I 
> know exactly what the issue is there. I might though if it stays open a 
> while!
>
> Thanks for the lib. It seems really minimal and immediately useful.
>
> On Sunday, October 8, 2017 at 3:09:19 AM UTC-4, Val Waeselynck wrote:
>>
>> Hi, I'm happy to release a tiny Clojure/Script library called 
>> scope-capture .
>>
>> https://github.com/alvalval/scope-capture
>>
>> Loosely speaking, scope-capture makes it trivial to reproduce from the 
>> REPL the context of a piece of code after it executed. 
>>
>> It was inspired by Stuart Halloway's article *REPL Debugging: no 
>> stacktrace required 
>> *.
>>  
>> Thanks Stu!
>>
>> I've been using it professionally for a few weeks now, and it's been a 
>> significant productivity boost for me. In my view the benefits are:
>>
>>- easier debugging
>>- making Clojure code / projects more accessible to beginners
>>- easier ad-hoc exploration
>>
>> Please let me know what you think!
>>
>> Valentin Waeselynck
>>
>

-- 
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/d/optout.


Re: mysql and clojure

2017-10-19 Thread Lubomir Konstantinov
Bad case of copy pasta?

You have am extra namespace definition:

  (ns dbns
  (:require [clojure.java.jdbc :as jdbc]
  [mysql/mysql-connector-java "5.1.38"]))

You need to remove it, and move the require clause up in your ns:

(ns jclojure.core
(:gen-class)
(:require [clojure.java.jdbc :as jdbc]
  [mysql/mysql-connector-java "5.1.38"]))

On Thursday, 19 October 2017 13:37:08 UTC+3, Damien Mattei wrote:
>
> hello again,
>
> i tried dozen of web example about mysql and clojure but it doen't work, 
> here is some of my code:
>
> for dependencies:
>
> (defproject jclojure "0.1.0-SNAPSHOT"
>   :description "clojure JVM source code for Sidonie web interface 
> administration"
>   :url "https://sidonie.oca.eu;
>   :license {:name "Eclipse Public License"
>   :url "http://www.eclipse.org/legal/epl-v10.html"}
>
>   :dependencies [
>   [org.clojure/clojure "1.8.0"]  
>   [mysql/mysql-connector-java "5.1.38"]
>   [org.clojure/java.jdbc "0.7.3"]
>   ]
>
>   :main ^:skip-aot jclojure.core
>   :target-path "target/%s"
>   :profiles {:uberjar {:aot :all}})
>
>
> the code (some of...):
>
> (ns jclojure.core
> (:gen-class))
>
> (defn -main
>   "I don't do a whole lot ... yet."
>   [& args]
>   
>   ;(:require [clojure.java [jdbc :as sql]])
>
>   ;(require '[clojure.java.jdbc :as jdbc])
>
>   (ns dbns
>   (:require [clojure.java.jdbc :as jdbc]
>   [mysql/mysql-connector-java "5.1.38"]))
>   
>   ;(use 'clojure.java.jdbc)
>   
>   (println "Hello, World!")
>
>   (let [
> db-host "localhost"
> db-port 3306
> db-name "sidonie"
> ]
> 
> (def db {
>  :classname "com.mysql.jdbc.Driver" ; must be in classpath
>  :subprotocol "mysql"
>  :subname (str "//" db-host ":" db-port "/" db-name)
> ; Any additional keys are passed to the driver
> ; as driver-specific properties.
>  :user "mattei"
>  :password "sidonie2"}))
>   
> ;(jdbc/query db ["SELECT * FROM Sigles"])
>
>   (jdbc/with-connection db
> (jdbc/with-query-results rows
>  ["select * from Sigles"]
>  (println rows)))
>
>  
>   )
>
>
> and now the error:
>
> [mattei@moita jclojure]$ lein run
> Exception in thread "main" java.lang.RuntimeException: No such namespace: 
> jdbc, compiling:(jclojure/core.clj:37:3)
> at clojure.lang.Compiler.analyze(Compiler.java:6688)
> at clojure.lang.Compiler.analyze(Compiler.java:6625)
> at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3766)
> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870)
> at clojure.lang.Compiler.analyze(Compiler.java:6669)
> at clojure.lang.Compiler.analyze(Compiler.java:6625)
> at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
> at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5380)
> at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3972)
> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6866)
> at clojure.lang.Compiler.analyze(Compiler.java:6669)
> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
> at clojure.lang.Compiler.analyze(Compiler.java:6669)
> at clojure.lang.Compiler.access$300(Compiler.java:38)
> at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:589)
> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
> at clojure.lang.Compiler.analyze(Compiler.java:6669)
> at clojure.lang.Compiler.analyze(Compiler.java:6625)
> at clojure.lang.Compiler.eval(Compiler.java:6931)
> at clojure.lang.Compiler.load(Compiler.java:7379)
> at clojure.lang.RT.loadResourceScript(RT.java:372)
> at clojure.lang.RT.loadResourceScript(RT.java:363)
> at clojure.lang.RT.load(RT.java:453)
> at clojure.lang.RT.load(RT.java:419)
> at clojure.core$load$fn__5677.invoke(core.clj:5893)
> at clojure.core$load.invokeStatic(core.clj:5892)
> at clojure.core$load.doInvoke(core.clj:5876)
> at clojure.lang.RestFn.invoke(RestFn.java:408)
> at clojure.core$load_one.invokeStatic(core.clj:5697)
> at clojure.core$load_one.invoke(core.clj:5692)
> at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
> at clojure.core$load_lib.invokeStatic(core.clj:5736)
> at clojure.core$load_lib.doInvoke(core.clj:5717)
> at clojure.lang.RestFn.applyTo(RestFn.java:142)
> at clojure.core$apply.invokeStatic(core.clj:648)
> at clojure.core$load_libs.invokeStatic(core.clj:5774)
> at clojure.core$load_libs.doInvoke(core.clj:5758)
> at clojure.lang.RestFn.applyTo(RestFn.java:137)
> at clojure.core$apply.invokeStatic(core.clj:648)
> at clojure.core$require.invokeStatic(core.clj:5796)
> at clojure.core$require.doInvoke(core.clj:5796)
> at clojure.lang.RestFn.invoke(RestFn.java:408)
>

mysql and clojure

2017-10-19 Thread Damien Mattei
hello again,

i tried dozen of web example about mysql and clojure but it doen't work, 
here is some of my code:

for dependencies:

(defproject jclojure "0.1.0-SNAPSHOT"
  :description "clojure JVM source code for Sidonie web interface 
administration"
  :url "https://sidonie.oca.eu;
  :license {:name "Eclipse Public License"
  :url "http://www.eclipse.org/legal/epl-v10.html"}

  :dependencies [
  [org.clojure/clojure "1.8.0"]  
  [mysql/mysql-connector-java "5.1.38"]
  [org.clojure/java.jdbc "0.7.3"]
  ]

  :main ^:skip-aot jclojure.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})


the code (some of...):

(ns jclojure.core
(:gen-class))

(defn -main
  "I don't do a whole lot ... yet."
  [& args]
  
  ;(:require [clojure.java [jdbc :as sql]])

  ;(require '[clojure.java.jdbc :as jdbc])

  (ns dbns
  (:require [clojure.java.jdbc :as jdbc]
  [mysql/mysql-connector-java "5.1.38"]))
  
  ;(use 'clojure.java.jdbc)
  
  (println "Hello, World!")

  (let [
db-host "localhost"
db-port 3306
db-name "sidonie"
]

(def db {
 :classname "com.mysql.jdbc.Driver" ; must be in classpath
 :subprotocol "mysql"
 :subname (str "//" db-host ":" db-port "/" db-name)
; Any additional keys are passed to the driver
; as driver-specific properties.
 :user "mattei"
 :password "sidonie2"}))
  
;(jdbc/query db ["SELECT * FROM Sigles"])

  (jdbc/with-connection db
(jdbc/with-query-results rows
 ["select * from Sigles"]
 (println rows)))

 
  )


and now the error:

[mattei@moita jclojure]$ lein run
Exception in thread "main" java.lang.RuntimeException: No such namespace: 
jdbc, compiling:(jclojure/core.clj:37:3)
at clojure.lang.Compiler.analyze(Compiler.java:6688)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3766)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5380)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3972)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6866)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:589)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler.eval(Compiler.java:6931)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5774)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$require.invokeStatic(core.clj:5796)
at clojure.core$require.doInvoke(core.clj:5796)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at user$eval5$fn__7.invoke(form-init7437695112761150837.clj:1)
at user$eval5.invokeStatic(form-init7437695112761150837.clj:1)
at user$eval5.invoke(form-init7437695112761150837.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6917)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.Compiler.loadFile(Compiler.java:7317)
at clojure.main$load_script.invokeStatic(main.clj:275)
at clojure.main$init_opt.invokeStatic(main.clj:277)
at clojure.main$init_opt.invoke(main.clj:277)
at