This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-16
Channels
- # admin-announcements (94)
- # aws (6)
- # beginners (8)
- # boot (303)
- # cider (5)
- # cljsrn (25)
- # clojure (82)
- # clojure-art (28)
- # clojure-chicago (2)
- # clojure-dev (2)
- # clojure-france (1)
- # clojure-japan (1)
- # clojure-my (1)
- # clojure-russia (78)
- # clojurescript (21)
- # clojurex (3)
- # dirac (1)
- # events (3)
- # funcool (5)
- # hoplon (12)
- # jobs (1)
- # ldnclj (2)
- # off-topic (49)
- # om (207)
- # proton (3)
- # re-frame (24)
- # reagent (45)
- # spacemacs (1)
- # yada (48)
Hi. Can anyone suggest, what this horrible error might be caused by? http://dpaste.com/209ZJK8
@andrewboltachev: it looks like these are cljs warnings, you might want to ask in #C03S1L9DN, or even #C06DT2YSY, but it might be some require missing, or project.clj
pointing to something weird
@richiardiandrea: ok, thanks. it's om-intermediate-template
actually
@triss: I think this could do the trick: simple way:
(defn f [v]
(if (some coll? v)
(into [] (mapcat #((if (coll? %) f vector) %)) v)
[v]))
fancier way:
(defn g [v]
(let [branch? #(and (coll? %) (some coll? %))]
(->> (tree-seq branch? identity v)
(into [] (remove branch?)))))
Note this uses transducers (just to keep vectors), but it's easy to adapt to older versions of Clojure.
Also I'm not sure what result you expect for an input such as [1 2 3]
so you may have to tweak a bit for this particular case (do you want [1 2 3]
or [[1 2 3]]
?)Does anyone know how this error reported by Tomcat 8.0.24 can be avoided?
16-Jan-2016 07:49:06.464 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [shell-command-executor-0.1.0-SNAPSHOT-standalone] created a ThreadLocal with key of type [clojure.lang.Var$1] (value [clojure.lang.Var$1@ce59370]) and a value of type [clojure.lang.Var.Frame] (value [clojure.lang.Var$Frame@639ad1cf]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Looks pretty similar to http://dev.clojure.org/jira/browse/CLJ-1125, @hans. It says it is fixed in clojure 1.6.0
I had a nasty bug in my program because I was getting the common part with #(get %1 2) and it turns out that when the maps are different you get a list not a vector
@yenda: done, let me know if it's ok. Also, as a rule, don't use tags like "bug" or "feature" -- the ticket type is already about that
sure. just make sure you have a CA signed and you use the correct patch format (using git format-patch
)
read http://clojure.org/community/contributing here about all of that
sequential collections are compared regardless of type (so list / seq / vector are the same)
so here’s a thing i’m tinkering with… considering finishing it up & submitting a CLJ/west talk about it: https://github.com/brandonbloom/metaclj — hopefully i find the time in the next week or two… feedback welcome
it’s based on the “bracket” and “escape” operators from the staging literature, which are fancy versions of syntax-quote and unquote
jaen: not familiar with metalua, but http://terralang.org/index.html is what got me off my ass to take another look at metaclj
looking at http://metalua.luaforge.net/quicktour.html now, yeah, it looks similar to the +{ and -{ syntax
i’m a proponent of compilers that do only limited, obvious, predictable, optimizations
I have a clojure library which is published on clojars. Newly I have also added a command-line client [1] into it. It has -main
and uses clojure.tools.cli
. I wonder how to instruct people to use it. I can use it from command-line by entering java -jar dirac-0.1.0-standalone.jar
when I have that uberjar built from sources, my question is how to use it from clojars.
@bbloom: that sounds interesting. If I understand what metlaua does properly it would make code like this evaluate instead of complaining about unquote
being unbound?
(let [derp `(+ 2 2)]
`(+ 2 ~(+ 2 ~derp)))
That is you could evaluate some quotation inside other quotation and rely on that result. Or maybe I'm misunderstanding something?i haven’t done unquote yet in metaclj, but it would work just by calling eval … unless it’s inside my macro, then i can do something smarter
@darwin: then just do a bash script that downloads the jar and runs it, or just supply the download link to the jar
@yenda: ok, sound good, I think mvn install
is what I need, and then ask mvn to give me path to that standalone jar
Yeah, I don't think Java land has something similar to Ruby where it takes executable files from bin
in the gem and makes them available to run (not a Java expert though). Writing a shell script seems reasonable in this case.
@darwin unfortunately it's more complicated than this. mvn install takes a jar already on your file system and puts it into your local maven repository- assuming you have maven.
what you probably want is as @yenda said- a bash script that only assumes the presence of java and curl, downloads a jar, and then runs it, a la a simplified version of lein's bootstrap script: https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.
I wonder if there are any existing clojure libraries using this approach, or how they distribute cli clients?
now, I have figured out direct clojars urls: https://clojars.org/repo/binaryage/dirac/0.1.0/
but is seems there are not -standalone.jar versions there (although I’m pretty sure lein deploy clojars
was showing them being uploaded)
Look at capsule for packaging: https://github.com/circlespainter/lein-capsule
you can use an uberjar- a packaging of a jar plus dependencies- but capsule offers nice ergonomic options
going to look into the capsule, thanks @jonahbenton
@yenda: lein uberjar produces both jar and uberjar for me, both get uploaded by lein deploy clojars
but only jar will appear in the clojars repo
@darwin: the deploy task doesn't upload the uberjar by default, so you shouldn't see any notification about it being uploaded
have to download it first with deps: mvn dependency:get -DgroupId=binaryage -DartifactId=dirac -Dversion=0.1.0
then ask maven for classpaths for its deps and then execute java -cp $CLASS_PATH -jar $NON_STANDALONE_JAR_FROM_CLOJARS
and if it is uploaded, clojars does no filtering to prevent it from being in the repo
following this SO post now: http://stackoverflow.com/a/12749243/84283
can anyone point to an example of how to use stylesheets in a clojurescript react native project? (did js react native stuff before, jumping in on a clojurescript project and all i see is inline styles)
@euwyn you may want to ask in #C03S1L9DN :)
just for the record, this is working script I ended up with: https://github.com/binaryage/dirac/blob/master/scripts/agent-launcher.sh
Hey everyone! What happens when a future is never dereferenced?… Or in other words, how safe is to execute some long task using a future if the result is never going to be used. For example, to save something in a database. Can I trust in that after the end of the task all resources are going to be freely available again?