This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # architecture (14)
- # aws (4)
- # aws-lambda (2)
- # beginners (66)
- # cider (63)
- # clara (39)
- # cljsjs (4)
- # cljsrn (3)
- # clojure (111)
- # clojure-berlin (5)
- # clojure-italy (17)
- # clojure-losangeles (1)
- # clojure-nl (4)
- # clojure-uk (93)
- # clojurescript (19)
- # core-async (60)
- # cursive (13)
- # datomic (22)
- # devcards (2)
- # dirac (4)
- # duct (44)
- # emacs (18)
- # fulcro (1)
- # graphql (10)
- # jobs (13)
- # jobs-discuss (27)
- # lumo (1)
- # mount (1)
- # off-topic (22)
- # om-next (1)
- # onyx (16)
- # philosophy (3)
- # planck (4)
- # precept (34)
- # re-frame (66)
- # reagent (6)
- # ring (2)
- # ring-swagger (1)
- # shadow-cljs (333)
- # specter (8)
- # tools-deps (4)
- # vim (15)
- # yada (1)
I'm trying to push my first lib to clojars and am having problems with
lein deploy clojars. When I get to the part where it wants me to enter my password for gpg, I paste it in (it's really long) and first of all, it displays it in plain text (not as asterisks) and when I hit enter, gpg doesn't seem to get the password. Does anyone know how to get around this?
lein can't share stdio with another program outside the jvm, so to use gpg you need a graphical client, or ensure the key is currently unlocked in your cache
also, the gpg signature of the artifact is incomplete with clojars at best, and can be disabled or skipped safely
Hey friends, can anyone shed some light about why the default implementation chosen for
buffers is Java
LinkedList and not, for example,
how could I set the s3 to skip the MD5 check on the uploaded file, I am trying to upload an image to local fakes3, but I get SdkClientException Unable to verify integrity of data upload. Client calculated content hash (contentMD5: 9Uw72PrP2ixIz7jhExr9dg== in base 64) didn't match hash (etag: 85dbae523824f9d892cb09e0af48f124 in hex)
why would you want that? Seems like something is going wrong with your client?
Does anyone know a library for controlling the mouse and keyboard? To simulate key presses and clicks?
Yes, I’ve done a lot of work on it, just haven’t had the time to pull it over the line yet
Not a direct answer but relevant SO answer ? TIL, LinkedList is also implemented as a doubly linked list and hence accessing last element is O(1). Also it seems that ArrayDeque was introduced in Java 6 but I don't know if supporting Java 5 was an issue at the time core async was written. git blame doesn't show any rationale behind this. https://stackoverflow.com/questions/6163166/why-is-arraydeque-better-than-linkedlist
Till Clojure 1.6 (March 2014) JDK 5 was the minimum JDK version supported : https://dev.clojure.org/jira/browse/CLJ-1268 First commit to core.async was on May 2013. Just a wild guess Rich might have used it for JDK 5 compatibility. First core.async commit : https://github.com/clojure/core.async/commit/47b1d24c0291050a1188dbeee2fc9227f694eb3c
It’s been long enough that I don’t recall why. It’s possible it was jdk 5 compatibility but I don’t remember that being a concern.
ArrayDeque should create a lot less GC pressure than a
LinkedList , specially in high load...
Comparator implemented in
clojure.lang.AFunction and not in
clojure.lang.AFn? I was looking at
AFn and was quite confused (I didn't even know that
Relevant commit : https://github.com/clojure/clojure/commit/56431834457820979e55c066e995ffe961ca11b3#diff-dbe6378825c2e51b49c0e222f6b0a102 . Commit message says refactoring without any concrete reason.
AFn is an abstract base class for function implementations and so is pretty generic
AFunction is only used in one place and has a bunch more functionality, so it’s a much more narrow use case
That thing I understand but I was surprised that
Runnable are implemented in
Callable and Runnable are extensions of the IFn interface and thus implemented in the base to provide as much of the base implementation as possible. Acting as a Comparator is not something that is a general part of the IFn contract and so is not in IFn or implemented in the base.
Why do I see i 1, i 2 printed here?
(defn unchunk [s] (when (seq s) (lazy-seq (cons (first s) (unchunk (next s)))))) (defn foo  (unchunk (map #(do (println "i" %) %) (unchunk (range 1 51))))) (first (foo)) ;; returns 1, prints i 1, i 2
Hmm, this prints four of them…
(defn unchunk [s] (when (seq s) (lazy-seq (cons (first s) (unchunk (next s)))))) (defn foo  (map #(do (println "i" %) %) (unchunk (range 1 51)))) (first (mapcat vector (foo)))
I really see that as a defect not an enhancement. Most not totally lazy seqs are due to chunking (32). That one is due to arg count (4)
temporarily I’ll fix it by using the suggested patches:
(defn join [s] (lazy-seq (when-let [s (seq s)] (concat (first s) (join (rest s)))))) (defn mapcat* "Patched mapcat, see CLJ-1218" ([f] (comp (map f) cat)) ([f & colls] (join (apply map f colls)))) (defn foo  (map #(do (println "i" %) %) (unchunk (range 1 51)))) (first (mapcat* (comp vector str) (foo))) ;; only prints 1, returns "1"
I’m writing a crawler and I want to have fine grained control about how many links get crawled.
if you need to precisely control when and how much of a lazy seq is realized, then you should not be using lazy seqs
do transducers offer fine grained control over how many elements of the intermediate steps get realized?
Prints 0 .. 32
(first (sequence (comp (map #(do (println "i" %) %)) (mapcat vector)) (range)))
I can use the more low level stuff, but if I do have fine grained control, I prefer the style of being able to use normal functions like take, first, etc.
eventually it all gets realized anyway, but for development I’d like to
(take 2 ...) just for inspection and if it doesn’t realize too many, this is better
expanding transducers get fully expanded on each step (mapcat is the prime example of this) - this is the difference in the transducer pull model vs seq push
I must be being stupid. I don't quite understand how you're recommending transducers be used here.
looking for a lightweight lib to transform some HTML (specifically replace relative links/image src) — hickory, enlive come to mind, anything else I should check out?
Do you know of some places that have some Clojure code that would help me get started with this kind of thing?
@alexmiller core.async might be a great fit for this too, yes. thanks for the suggestions.
got a question about ring/jetty - I need to read the
HttpInputOverHTTP obj in the
:body, and then reset it so it can be read again by another middleware
ah, it's just an inputstream with a fancy name (at least, that's how the other mysterious middleware in my app uses it)
well InputStream is abstract, so any particular one is going to be "fancy" in some way
I have a dependency problem i am trying fix for hours. core async seems to conflict with some other library and i get the following in the stack-trace: WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/boo lean? WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/boolean? Exception in thread "main" java.lang.ExceptionInInitializerError at clojure.main.<clinit>(main.java:20) Caused by: java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.tools.analyzer.utils/boolean?, compiling:(clojure/core/async.clj:469:6)
my guess is that you are getting an incompatible version of tools.analyzer and that’s causing core.async to fail
which will give you the dep path to the tools.analyzer version being used in the deps tree
Does clojure participate in Google Summer of Code? Will it be possible to apply as a student for clojure at GSoC 2019?
This depends on a) whether someone sends in an application for Clojure and b) and then whether they accept us. All of those possibilities have occurred in the past.
At this point, I think Cognitect will probably not lead this but I have encouraged Clojurists Together to do a.
Sounds awesome. Thanks. The community/students come up with the proposals or do the developers behind the clojure do it?
Anyone can propose projects but there needs to be a mentor willing to do it with the student
I'm currently a GSoC 2018 student working on a Clojure project, there were 2 or 3 projects this year looking for Clojure developers
so you have tools.analyzer 0.6.9 at the top level and that’s what core.async includes as well
another thing to watch out for is some sneaky snake including an older one of these libs inside their own jar (which is bad and wrong :)
I just put tools analyzer there end excluded it from wherever i thought, including core.asyn and then forgot it there