This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-02
Channels
- # announcements (4)
- # aws (18)
- # beginners (227)
- # boot (1)
- # calva (13)
- # cider (22)
- # clara (2)
- # cljs-dev (17)
- # clojure (85)
- # clojure-brasil (2)
- # clojure-dev (55)
- # clojure-europe (2)
- # clojure-italy (18)
- # clojure-japan (4)
- # clojure-losangeles (1)
- # clojure-nl (5)
- # clojure-uk (53)
- # clojurescript (46)
- # clojureverse-ops (8)
- # cursive (17)
- # data-science (3)
- # datascript (3)
- # datomic (25)
- # duct (4)
- # emacs (2)
- # figwheel-main (1)
- # fulcro (9)
- # hoplon (2)
- # hyperfiddle (1)
- # jobs-discuss (5)
- # kaocha (7)
- # leiningen (3)
- # nrepl (50)
- # off-topic (32)
- # portland-or (1)
- # re-frame (19)
- # reitit (2)
- # shadow-cljs (30)
- # spacemacs (2)
- # sql (8)
- # tools-deps (4)
- # vim (26)
- # xtdb (3)
- # yada (8)
@lilactown do you mean clojure.java.jdbc
?
@noisesmith can you explain semantics of ::keyword
it expands to a namespaced keyword in the current namespace
here's what I'm trying to do:
$ clojure -A:rebl:rebel -Sdeps '{mysql/mysql-connector-java {:mvn/version "5.1.6"}}'
[Rebel readline] Type :repl/help for online help info
user=> (require '[next.jdbc :as jdbc])
nil
user=> (def db {:dbtype "mysql" :dbname "content_service"})
#'user/db
user=> (def ds (jdbc/get-datasource db))
#'user/ds
user=> (jdbc/execute! ds "show tables")
Execution error (SQLException) at java.sql.DriverManager/getConnection (DriverManager.java:702).
No suitable driver found for jdbc:
Hmm, I would have expected that to work, but that's a pretty old MySQL driver.
It's been tested against mysql/mysql-connector-java {:mvn/version "5.1.41"}
Yeah, just noticed
Missing :deps
Best place to ask questions about next.jdbc
-- or clojure.java.jdbc
or databases in general -- is #sql
:: means "keyword, autoresolved in the current namespace context"
@nxtk fwiw, i have found the following page quite handy: https://clojure.org/guides/weird_characters#autoresolved_keys
How to include a git repo in deps.edn which have java source. I am trying like this
{:deps
{org.clojure/data.csv {:git/url ""
:sha "e5beccad0bafdb8e78f19cba481d4ecef5fabf36"}}}
but I am getting ClassNotFoundException
for Java files. Any pointers or help is appreciated.@gdrte Java has to be compiled first. You can't just pull in source files, unlike Clojure.
@gdrte That repo does not have Java code in it so I'm not sure what you're asking/trying to do here.
Nvm, the above is just an example. Here is the repo https://github.com/gdrte/suricatta
the error is Syntax error (ClassNotFoundException) compiling reify* at (impl.clj:106:3). suricatta.impl.IParam
Right, you can't use Java source files with clj
/`deps.edn`. They need to be compiled (via javac
) first.
You would need to compile, build, and publish your Java code as a JAR somewhere, and depend on that.
aah... actually I forked that project, and upgraded clojure and some other libs. I didn't tried to send a PR to original author. I thought clojure git deps will work for me without messing the artifactory id.
For some situations, you can actually hack around this by shelling out and running a javac ...
command line.
You can add a JAR to the classpath as a :local/root
dep.
every week I get an email from the Rust team called "This Week in Rust", it's an update on news, jobs, calls for participation in open source projects, events and so on is there an equivalent for Clojure?
Cherished Clojure weeklies are: Daniel Compton’s The REPL newsletter https://www.therepl.net/Newsletters/ and Eric Normand’s http://PurelyFunctional.tv Newsletter https://purelyfunctional.tv/newsletter/
What’s up with this?
(= 40.4 (float 40.4)) ;; => false
(= 47.5 (float 47.5)) ;; => true
For me, it's the otherway round. Comparing precision on floats on the JVM, using the equals method, I suspect is the same issue when comparing floats on Java on the JVM. You're not sure on the precision that the JVM uses per call.
There's lots of results on google on comparing floats (on Java, but equality valid to Clojure)
Rich Hickey added a comment - 05/Sep/13 8:27 AM
It is out of scope for Clojure to fix this for Java types Float/Double/BigInteger
I have a com.cognitect.aws/glacier
question; I want to run list-vaults
but when I run
(aws/invoke dev/gl {:op :ListVaults
:request {:accountId "099465141348"
:apiVersion "2012-06-01"
}})
I get
=>
{:code "MissingParameterValueException",
:message "Required parameter missing: API version",
:type "Client",
:cognitect.anomalies/category :cognitect.anomalies/incorrect}
what is the secret sauce for getting the apiVersion
accepted?
(I tried putting into
(aws/client {:api :com.cognitect.aws/glacier
:version "2012-06-01"
:region :eu-west-1
...)
but that didn't help either@ben.hammond turn on request validation
same error message ..?
yeah that doc does not talk about API versions at all
yes so I get a helpful error message if I leave out the required :accountId
I think there might be a regression for the AWS glacier API floating around; but I'm not quite sure
these are all JSON apis at the AWS end of things aren't they
there's a
x-amz-glacier-version: 2012-06-01
header in some of the docs@veix.q5 Yes, maps do not guarantee order. If you need a sorted map I suggest looking at: http://clojuredocs.org/clojure.core/sorted-map
Is this a bug?
user=> :0
:0
user=> ::0
:user/0
user=> (ns foo)
nil
foo=> (ns user)
nil
user=> (require '[foo])
nil
user=> ::foo/0
Syntax error reading source at (REPL:2:0).
Invalid token: ::foo/0
:0 isn't meant to work, but happens to
that is actually a very complicated question connected to many mailing list posts, irc and slack discussions
:foo/0
instead of ::foo/0
? (already namespaced)
@djtango :0 was never designed to work, a version of clojure existed where it worked anyway, it was kept that way. ::foo/0 never worked because the issue was understood before ::foo/bar existed
Could someone remind me, I think I remember seeing a fn named something like requiring-resolve
. Where would I find this :thinking_face:
clojure versions 1.10+
why use a 1.10 alpha?
it's in clojure.core, I'm not sure if it was present in the 1.10 alphas or not, but it is present in the 1.10 release
I see. Just haven’t gotten around to changing that version string quite yet. Thank you!
oh, I might be wrong, it might be a 1.11 thing... - nope, definitely here in 1.10
$ clj
Clojure 1.10.0
(ins)user=> (requiring-resolve 'clojure.set/union)
#'clojure.set/union
It was added till very late in the release cycle
I think it was in one of the final Beta versions?