This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-24
Channels
- # admin-announcements (16)
- # announcements (2)
- # beginners (12)
- # boot (92)
- # cider (1)
- # clojure (149)
- # clojure-argentina (1)
- # clojure-australia (3)
- # clojure-dev (2)
- # clojure-italy (2)
- # clojure-japan (1)
- # clojure-russia (9)
- # clojurescript (48)
- # clojutre (2)
- # core-logic (18)
- # datomic (48)
- # editors (43)
- # emacs (11)
- # funcool (12)
- # hoplon (11)
- # ldnclj (30)
- # ldnproclodo (1)
- # rdf (6)
- # re-frame (13)
- # reagent (10)
- # testing (1)
- # yada (1)
The first Clojure I did was building R2RML and a full SPARQL engine with federation and a pretty nice query optimizer
Unfortunately all proprietary and now dead
@machty someone else can probably explain this better than me but keywords have namespaces
so when you say :foo/bar you are providing a ns (before “/“) and a name (after “/“)
you can do ::foo to get a keyword in the current ns
or (keyword “foo/bar/baz”) if you really want more than one slash in a keyword
clumsyjedi: maybe this is the wrong channel since it's an Om cljs piece of code that confused me in the first place, but i'm looking at this: https://github.com/omcljs/om/blob/master/dev/om/dev.cljs#L47-L55
there's namespaced keywords like :app/title
but it's not clear to me whether that's just a cosmetic choice or whether it "means" something to clojure in that case
@rickmoynihan: Why not just make a Slack #rdf channel right here in this team?
Does anyone have experience with JDBC or using SQLite from Clojure? I’m dipping my toes into it for the first time, but a really simple program is throwing a java.lang.IllegalStateException: I/O in transaction
: https://gist.github.com/cigitia/e1635fd4272f8c921303
I do have the SQLite JDBC driver in my dependencies.
The connection itself also seems to be working—running the Gist does create a test.db
file in my project root, but it also throws that error.
Adding a false
second argument to db-do-commands
seems to prevent the error, though I don’t yet understand why.
That certainly doesn’t match the tutorial at http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html.
@bmay: Do you mean :classname
instead of :subname
? I had thought that the subname is the database filename or location, but I’m not sure.
@bmay: [Edit: Not actually fixed unfortunately] Using :classname org.sqlite.JDBC
works! Thank you very much!
I…don’t know why that mattered, since adding that transaction?
parameter to false
suppressed the error and made it work correctly too, but I’m not complaining too much.
I can’t seem to get it to work compatibly with http://jwt.io
hey, should it be okay to generally run clojure 1.7 on java 8 or should I switch to java 7?
We've been running Clojure 1.7 on Java 8 for ages. It's all good.
yeh, I worked out my problem. We’re trialling clojure at my new gig. I’ll probably have a few more questions for the channel in the next few days
We've been running 1.8 Alphas in production but we backed off to 1.7 this week as we're trying to track down a very slow memory leak and need to isolate which of several changes may have caused it... 😞
I don't really think it was 1.8 but moving back to stable releases is just a basic first step!
right, Im being a total noob and just diving in and writing a data migrator from mongo to firebase in clojure
ive learnt clojure twice at different times but havent written a lot of clojure programs
so it’s a good exercise for me. Was confused as to whether or not clojure 1.7 needed clj-time because of the new time package in java 8
I learned it at a Saturday bootcamp back in May 2010... and we first went to production with 1.3.0 Alpha 7... and we love Clojure
There are several date/time library options but clj-time is pretty standard since it wraps Joda Time.
unsure if you recall but we know each other from #Polyhack and facebook, share a common friend in Mark Mandel
We use clj-time heavily at World Singles (I co-maintain it with Michael Klishin).
right, yeh, I have the code loading up clj-time now. It’s failing for a different reason now
We also use date-clj for some date arithmetic and because it creates java.util.Date which is easy for MongoDB/MySQL
Oh cool... I thought I recognized the name but couldn't think where from (I'm terrible with names!).
Which library are you using for MongoDB?
Cool. Michael et al work really hard on Monger. We use CongoMongo (which I seem to have become the lead maintainer of) but I've looked at migrating to Monger because it's better supported
@seancorfield: you're the man! thanks for java.jdbc
used it on pretty much every project
seancorfield: ok, thanks. We are moving everything to firebase for our client side data
@prachetasp: appreciated... I just put out a new release... I haven't done the formal announcement yet... will do that Monday.
Oh wait, no, that was tools.cli I just made a release of... java.jdbc will get a new release... in a few weeks...
So, tools.cli 0.3.3 release announcement coming tomorrow
I have a bunch of stuff coming to java.jdbc ... just need to set aside a week to work on it ...
What’s that site that shows you which jar is using which other jar?
Are the mappings generated by :refer
in (ns)
stored somewhere with the namespace? Or is it only a transient state of a reader/compiler?
cfleming: thanks.
@dottedmag: see ns-refers
too
@crisptrutski: Thanks, very handy.
not sure, but don’t think so
cljs.user/ns-refers
doesn’t exist for a start
not sure the data is even around, may have to dig into analyser cache
question for the #C07UQ678E wizards
Any ideas why I keep getting this when doing a lein release: gpg: skipped "J. Pablo Fernández <[email protected]>": secret key not available?
My key is there.
@pupeno: Leiningen 2.5.2? I remember there was an issue about that and the workaround was to downgrade to 2.5.1.
It's fixed now, see https://github.com/technomancy/leiningen/issues/1963
nberger: argh, yes, 2.5.2.
2.5.1 also gives me that error.
The same error exactly? There are a few different error scenarios in https://github.com/technomancy/leiningen/blob/master/doc/GPG.md#troubleshooting with similar error messages, have you checked that?
nberger: yeah, same error, which I’m not seeing in that page, although I didn’t have use-agent in my conf. To test whether it’s working, it’s pointing to a command to decrypt ~/.lein/credentials.clj.gpg, a file I don’t even have.
Hey Clojurians, I'm looking for a messaging library that integrates with core.async (zeromq for example), is there anything out there?
There is https://github.com/lynaghk/zmq-async but it seems a bit outdated
onyx uses Aeron but sadly its not generalized and it tightly bound to the project https://github.com/onyx-platform/onyx/blob/master/src/onyx/messaging/aeron.clj
Posted this question on StackOverflow (since logs don’t stay around long here): http://stackoverflow.com/q/32186163/17498
We’ve created the #C09GHBXRC channel for those interested in using Clojure with Semantic Web and RDF!
I want to check if a seq is alternating strings with a certain data structure; is there something neater than:
(every? identity
(map apply
(cycle [string? #{[:br {}]}])
subrows))
every? identity is similar to reduce and I guess, but reduce and doesn’t work because and’s a macro.
I’m already using core.match
, so if there’s a nicer way to describe preds-over-seqs, I’m all ears
(every? (fn
[maybe-str]
(string? maybe-str)
[maybe-str maybe-br]
(and (string? maybe-str)
(#{[:br {}]} maybe-br)))
subrows)
> Returns a lazy sequence of lists like partition, but may include partitions with fewer than n items at the end. Returns a stateful transducer when no collection is provided.
(every? (fn [[maybe-str maybe-br]]
(and (string? maybe-str)
(#{nil [:br {}]} maybe-br)))
(partition-all 2 subrows))
vs
(every? identity
(map apply
(cycle [string? #{[:br {}]}])
subrows))
@lvh: check the docs for contains?
. the second argument is a 'key'. for vectors, this would be index. so you're asking if nil
is within the range of [nil]
user=> (contains? [nil] 0)
true
user=> (contains? [nil] 1)
false
for the most part, you can think of a vector as a map where its 'keys' are the indexes
however, (keys v)
does not 😜
What protocol do I need to implement if I want to make a java object as a lazy-seq
or can I just implement ISeq and pass it to lazy-seq?
@joelkuiper: java.lang.LazySeq
is a final class, so my guess is to implement ISeq
public final class LazySeq extends Obj implements ISeq, Sequential, List, IPending, IHashEq
or maybe IPending
Right, the concrete use case is that I have an object that implements Iterator, and want to use that as a sequence
hmm, gotta check that out
@joelkuiper: Does your object not implement Iterable
?
Yeah its [https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/query/ResultSet.html](ResultSet)
but I want to consume the results as a lazy-seq
I’m not sure about laziness, but does iterator-seq
not do what you want? https://clojuredocs.org/clojure.core/iterator-seq (Note in the docs it mentions using an Iterable as a seq directly)
Though it doesn’t look like ResultSet
implements Iterable
. It just is an Iterator
itself.
Another alternative would be to write a fn
that returns a lazy-seq by calling the lazy-seq
macro itself.
It's an optimization. PersistentArrayMap is faster for small maps
is it possible to dynamically add a field to a Java Object?
@joelkuiper: You can't add fields, as that would change the memory layout. You may be able to wrangle java.lang.reflect.Proxy
to simulate it, though.
I want something like https://github.com/pjlegato/ring.middleware.logger but to use it with taoensso/timbre. I don't want to bring a dependency on onelog which brings slf4j-log4j12 ... any alternative?
@nberger: you could just fork it and swap out the logging statements for timbre
I wish it didn’t use onelog, and just used clojure.tools.logging
@danielcompton: yes, I'll do something like that, thanks
you should fork it, and submit a PR to allow users to supply a logging implementation 😜
probably a bit more work
if it used c.t.logging then that would fit the 90% use case, although not timbre users
unless timbre provided a slf4j facade?
@bostonaholic: yes, I'll probably do that... I just wanted something to use like "right now", if it was available
we all do 😜