This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # admin-announcements (4)
- # alda (3)
- # aws (1)
- # beginners (2)
- # boot (33)
- # braid-chat (4)
- # braveandtrue (20)
- # cider (52)
- # cljs-dev (13)
- # cljsrn (55)
- # clojure (111)
- # clojure-belgium (4)
- # clojure-brasil (6)
- # clojure-dusseldorf (1)
- # clojure-greece (116)
- # clojure-mexico (1)
- # clojure-nl (3)
- # clojure-russia (56)
- # clojure-spec (72)
- # clojure-uk (13)
- # clojurescript (66)
- # community-development (2)
- # component (24)
- # core-async (1)
- # cursive (19)
- # datomic (27)
- # devcards (5)
- # emacs (1)
- # funcool (34)
- # hoplon (313)
- # jobs (1)
- # lein-figwheel (11)
- # luminus (5)
- # mount (30)
- # off-topic (63)
- # om (375)
- # onyx (67)
- # perun (8)
- # proton (1)
- # reagent (4)
- # rum (1)
- # specter (55)
- # spirituality-ethics (7)
- # test-check (2)
- # untangled (34)
- # yada (20)
Hi people. Is there an easy way to start a
lein repl and include a specific jar in the classpath for just that session?
lein update-in :dependencies conj \[ring-middleware-format\ \"0.7.0\"\] -- repl
hi all! Anyone knows if there is a nice way to show some info about what is been tested at that time using clojure.test?
@aspra do you mean logging what is being tested?
I don’t see that often in Clojure, but you could add your own logging calls, or wrap it around
testing, or similar
Hi, do you guys know how to get those profiles with specific task? for example: when I run
lein test, I wanna know how many profiles being merged.
@danielcompton I mean more that when a test is running it outputs a piece of text, a description, so it is easy to see which test is in progress.Like what midje does with the text input in "fact"
anybody using https://github.com/gorillalabs/sparkling?
I am having some trouble with a “clojure.lang.Var$Unbound.throwArity” exception
which I assume is due to the way functions are serialized/deserialized
wouldn't it be nice if Leiningen coordinates given on githubs were text, not an image link to Clojars
(so one could copypaste immediately rather than having to go to Clojars and come back again)
@danlebrero: sounds like your not compiling stuff properly. Check your uberjar for the classes and/or your project.clj. Otherwise send me more info...
@chrisbetz: The issue is when I try to use the spark streaming “foreachRRD” function. The code looks like “(.foreachRDD dstream (sparkling.function/function2 f))
and to use it (mysparkling/foreach-rdd dstream (fn [rdd _] (sparkling/foreach-partition ….)))
@chrisbetz: the fn that I pass to “foreach-partition” is the one that throws the unbound exception
@chrisbetz: I found that doing a (Class/forName “com.ig.somenamspace__init”) is a workaround
@chrisbetz: but (import ‘com.ig.somenamespace__init) or (require ‘com.ig.somenamespace) does not work
@chrisbetz: I do that from within the fn passed to “foreach-partition"
@danlebrero not sure about the foreachRDD with the arity 2 function, but i’ve been successful with this -
(defn foreach-rdd [f dstream] (.foreachRDD dstream (function f)))
@jstokes: do you do a "sparkling.core/foreach-partition” inside the “f”?
If I understand Spark correctly, “println” will be run on the driver, right?
@danlebrero: is your fn a thing from defn?
@chrisbetz: no, it is an anon fn, I just changed it to a defn and trying to test it
i believe on the worker node @danlebrero
Did you make sure to require it in the executor-vm? One way is to require it from serializer code? Because requiring should fix it
@chrisbetz: the “unbounded” fn is in the same namespace
moving all fn to defn did not work
@nathanmarz: in your
static-field example -- I can't see why you can't already do that just by closing over a
It has to be declared inside the function
(fn [...] (select [:a :b :c] ...))
My select macro is what's responsible for declaring that it needs to use a static field
Right now it generates a UUID string at macro-time for doing gets/puts into a global map
@jstokes @chrisbetz found the root cause of the issue. sparkling.core/foreach-partition uses (comp f iterator-seq), so Clojure creates a fn in clojure.core$fnxxx for it, which means that my namespace is never hits the sparkling.serialization.Utils/requireNamespace method to load the namespace, so it is never initialized
@jstokes @chrisbetz workaround is to use a define a foreach-partition without the comp, or to make sure that other fn in the same namespace is used before and will trigger the ns load
Anyone know how to add a + to a regex?
@josh_tackett: you want to match a literal +? Try escaping it.
it was in JSON so it was actually #”\\+"
That’s why I was getting tripped up
I didn’t think there was a full changelog yet — I doooon’t think 1.9 is out? You could check out the in-progress release notes on the Clojure JIRA tho http://dev.clojure.org/jira/secure/ReleaseNote.jspa?projectId=10010&version=10750
@gastove: It's not out yet. Otherwise this would be the place: http://dev.clojure.org/jira/browse/CLJ#selectedTab=com.atlassian.jira.plugin.system.project%3Achangelog-panel
empty? internally calls
(seq coll) and quite a lot of things can be used with
basically, I want to test for emptiness via
empty? but need to make sure the target thing can support
Seqable is an interface, you can test that with
instance?. I don't think clojure.core has
seqable?, but have a look on crossclj I'm sure you'll find half a dozen implementations
Does anyone do a lot of interop with Clojure and MS Excel? I don't suppose there's a library that skips Apache POI and parses Excel xml directly into Clojure?
@lopalghost: I've used https://github.com/mjul/docjure which uses POI.
there was a tool or library using Clojure/.net interfacing with excel, if I remember correctly
@lopalghost: might checkout https://github.com/tomfaulhaber/excel-templates and the Clojure West talk linked from the readme. May or may not be the type of thing you are looking for.
I'm not sure if this is the right channel, but is the ClojureCLR project dead? it seems kind of dead, it's way behind in terms of updates
I had dreams of combining it with Xamarin to make mobile games/apps now that they killed RoboVM
@lopalghost: excel-templates won't help you if you're trying to read Excel files (it's really a templating library for Excel). But docjure does that. There's also https://github.com/outpace/clj-excel
Excel-templates actually looks pretty nice--I'm looking to read and write
I think excel-templates is the best on the output side, but I would. I wrote it 🙂.
But the problem with all these libraries is that none of them do exactly what I want, so I end up using POI directly
its mutable objects give me a headache 😞
POI is really the most complete in terms of covering all the functionality. If you were going to wrap it, you'd be wrapping the mutability which is pointless
I've been noodling dropping POI in excel-templates and simply doing immutable ops on the Excel zip/xml structure. I'm already doing that in some places.
Yeah, that's why I'd like a library that translates the XML directly to clojure data and vise versa
That's cool, I imagine its a lot of work
@lopalghost: we'll that wouldn't be too hard to do yourself
but then you need to understand all the semantics of Excel
Its mostly that I'm not very familiar with ooxml--any good resources?
the spec is the best resource. Look here for a link and some of my thoughts on the subject: https://github.com/tomfaulhaber/excel-templates/issues/28
and also here: https://github.com/tomfaulhaber/excel-templates/issues/30#issuecomment-205090791
@tomfaulhaber: thanks! I will look into it
excel-templates should cover a lot of what I need to do
The compiler doesn't seem to care if you create a qualified keyword that starts with a number, however, if you alias the ns in a different ns and try to use the qualified keyword that started with a number the compiler barfs.
Compiler barfs on the
(ns foo) (s/def ::1d-vector (s/and coll? #(or (empty? %) (number? (first %))))) (ns bar (:require [foo :as f])) ::f/1d-vector
::f/1d-vectorline. Using 1.9.0-alpha3
Just strange that the compiler doesn't care as long as the qualified keyword that begins with a number is used in the ns it was created in.
well, I am mean, I am not sure, I haven't tried it, but I am pretty sure it would be the reader
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Invalid token: ::ms/1d-vector, compiling:
Okay. Anyways, not relevant to the discussion. It seems like there should be consistent behaviour unless there is another reason for an error not to be thrown.
in 1.8, if I recall, there was a commit to change the reader to be more inline with the documentation about the reader, which suggests that keywords shouldn't start with numbers
but it wouldn't surprise me if the reader was using slightly different regexes for parsing slightly different keyword syntaxes
because, even though the docs on the reader say symbols and keywords must start with non-numeric characters, because the reader allowed it, they started using it, and then got ticked off when someone actually tried to make it consistent with the docs
the other thing is, people really want the set of keywords you can create via the keyword function to match exactly with the set of keywords you can create using the reader