This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # bangalore-clj (1)
- # beginners (60)
- # boot (30)
- # cider (7)
- # cljs-dev (10)
- # cljsrn (2)
- # clojure (163)
- # clojure-conj (10)
- # clojure-france (1)
- # clojure-greece (2)
- # clojure-italy (7)
- # clojure-russia (41)
- # clojure-serbia (22)
- # clojure-spec (41)
- # clojure-uk (41)
- # clojurescript (178)
- # cursive (36)
- # datascript (1)
- # datomic (23)
- # dirac (38)
- # graphql (12)
- # hoplon (20)
- # immutant (32)
- # instaparse (3)
- # keechma (1)
- # lein-figwheel (18)
- # leiningen (8)
- # liberator (1)
- # luminus (30)
- # lumo (29)
- # off-topic (18)
- # om (17)
- # pedestal (7)
- # planck (37)
- # precept (1)
- # re-frame (67)
- # ring-swagger (2)
- # timbre (1)
- # untangled (8)
- # vim (2)
I think I'm close to completing my first "microservice" in clojure. It works fine when using
lein run: a small server using ring-jetty starts and accepts requests and gives back the responses I expect.
However when I try to compile using
lein uberjar it seems to start up the service but then hangs and never finishes the compilation.
I have a feeling it might have something to do with core.async channels that I use. Could that indeed be the case?
jlmr: the typical cause of this behavior is top level side effects, including side effects inside
clojure doesn’t have a “compile only mode” - when it aot compiles to make your uberjar, the namespace is run exactly the way it would be if you require it
which means that to use uberjar correctly, especially with aot, you need to ensure that any stateful top level objects are initialized inside your -main or something it calls
@U051SS2EU, ok this gives me somehting to work on then. Will look at it tomorrow. Thanks!
Hello, I try ask to others again about how convert URL content -> image with clojure? I tried with
io/input-stream but in this case I get the source code. How can I get the pic of the website like a screenshot?
I saw solution what can work with Electron app (desktop screenshot), but I can’t modify to linux server use for other urls. Any idea? Without PhantomJS?
@dominicm Thanks for the links! I think, that is a little bit harder than I thought without PhantomJS.
I found now that https://code.google.com/archive/p/java-html2image/
Hi, I have "almost" no idea about Java and I try to get the Java Classes get running via Interop: https://github.com/CogComp/cogcomp-nlp/blob/master/chunker/src/main/java/edu/illinois/cs/cogcomp/chunker/main/ChunkerDemo.java so far I tried the following, but I'am doing something stupidly wrong
@novel have you tried removing the spaces between the . and the function?
(def annotator (.CuratorFactory buildCuratorClient))
yes, without the space it gives me "Unable to resolve symbol: createBasicTextAnnotation in this context"
the idiomatic translation of
(. CuratorFactory buildCuratorClient) is
(CuratorFactory/buildCuratorClient) but they both do the same thing https://clojure.org/reference/java_interop
Hi! I need to import
as described in this issue https://github.com/react-community/react-navigation/issues/1400. How I can do? Thanks 🙂
so changing to (ClusterFactory/buildCuratorClient) with (def ta (. annotator createBasicTextAnnotation "corpus", "id", "text")) call to method createBasicTextAnnotation can't be resolved (target class is unknown) and (def ta (.annotator createBasicTextAnnotation "corpus", "id", "text")) times out with "Unable to resolve symbol: createBasicTextAnnotation in this context"
you can either use
(. annotator createBasicTextAnnotation ...) or
(.createBasicTextAnnotation annotator …), they both mean the same thing but the latter is preferred
are you doing this in a repl? if not I suggest working that way, checking what the class of annotator is
well according to the javadoc that class implements AnnottatorService which has this method http://cogcomp.cs.illinois.edu/software/doc/apidocs/edu/illinois/cs/cogcomp/annotation/AnnotatorService.html#createBasicTextAnnotation(java.lang.String,%20java.lang.String,%20java.lang.String)
there are many ways to do it, I kind of like
#(reduce (comp inc first list) 0 %) if just using
count isn’t allowed
Hey all, I'm a newbie and just trying to find my footing. I was playing around with the repl, and read about
apropos. Seems pretty cool… but maybe I'm just using this wrong.
user=> (find-doc "sin") ... <massive wall of text> ... user=> (find-doc "Math/sin") nil user=> (apropos "sin") (clj-antlr.interpreted/singlethreaded-parser instaparse.cfg/single-quoted-regexp instaparse.cfg/single-quoted-string instaparse.reduction/singleton?) user=> (apropos "Math/sin") () user=> (Math/sin 90) 0.8939966636005579
sinhave a docstring? Why isn't it showing up in
sin is a static method on the Java class
java.lang.Math. I think the function
apropos only searches Clojure namespaces and their docstrings, not Java classes and their Javadocs.
Ah, I see - thank you @aengelberg! Seeing as how Clojure leans on Java's std lib a lot, is there any way to access the associated java doc from the repl?
I dimly remember a note about this in the Joy of Clojure, but I'm having difficulty finding it now
That’s a good question. I don’t know of an easy way to do that. Clojure docs are generally represented as strings, stored as metadata on the functions, and they’re accessible from Clojure at runtime, which is what enables helpful functions like
doc. Javadocs are just comments in the source code, that get produced into HTML as a compile-time step, but I think that documentation gets compiled away and isn’t stored the actual JVM.
The note I saw in Joy of Clojure mentioned a function that would return a URL to the javadoc page.
That said, one could probably use reflection to search all of the classes and do a search based on just method-names.
But this is probably an overly complex theoretical discussion for the #beginners channel. 😛
you can also access javadocs from the repl using clojure.java.javadoc/javadoc