Fork me on GitHub

The problem was Dropbox


I’m drawing a blank, and google doesn’t help — I have a data structure, that I want to convert to JSON in UTF-8 and get the byte length so I can put that in a “Content-Length” header. I’m using Cheshire and Pedestal, but I’m not sure if the String I get back with cheshire/generate-string is in UTF-8 or not — or how I should convert that or count its bytes?

Charles Fourdrignier12:07:06

I plan to work on some OpenCV code soonly. I hope Clojure could help me in this job. I see a lot of mentions around “connect a REPL to a running program” and I’m looking for good references on the subject. There is my idea : - Writing a simple “infinite loop” which capture the webcam and send frames to an analysis function. - Launch the program. - Connect (?) to the program via REPL - Update (?) the analysis function and check the results until I get what I want Is it realistic ? Or did I misundertand the concept ?


@charles.fourdrignier There's a great guide on using the REPL on the clojure site:


You're correct in your interpretation of how it can be used 🙂


Hi. Is there a neater way to write this anon fn? It does what I want (remove optional list wrapping around some elements) but I find it quite ugly.

(def hic [:p {:moo 123} '("pew" "dew") [:b "oops"]])
(apply concat (map #(if (list? %) (vec %) (vector %)) hic))


I can't see a way to make that anon fn neater, but you can also do the same with a reduce:

(reduce (fn [acc e] (if (list? e) (into acc e) (conj acc e))) [] hic)

👍 4

Thanks. Your version is nicer cos it returns a vector instead of a list. Also just noticed that in mine, mapcat can replace the apply concat map 🙂

✌️ 4

True! I always forget that mapcat exists 😛

Charles Fourdrignier12:07:54

@andre.stylianos Thanks ! I’ll try this and get back when hitting too much walls.

✌️ 4

I want to do some machine learning and/or neural nets with clojure today. aside from Cortex what can I use?


Check out Neanderthal


But basically why use clojure for that?


You have it all in scikit, pytorch, etc


Follow Carin Meier on Twitter and find her giggasquid blog. She's very big into this I believe

✔️ 4

Something else ... Where does the clojure ecosystem have anything that implements so called back-pressure??


@matan you mean back prop? (backwards propagation) i'm not sure what back-pressure is.


@sova backpressure is a behavior in an asynchronous system which intentionally slows a producer down when a consumer is overloaded, it leads to better failure and degradation behaviors

🐝 4

@matan core.async and manifold both implement good backpressure when used properly


Thanks @noisesmith! Long time :-))


I was just asked by some Scala devs


They have Akka


right, but backpressure is just one behavior of a distributed processing system, and clojure doesn't have something all tied up with a bow and ready to go like akka


Yes sure, core.async is only infrastructure for things like Akka I guess


core.async only works inside one vm, akka works across vms / hosts iirc

Mario C.20:07:29

Quick question. What is the correct way of using the function? I am doing this.

(sql/get-by-id @url
                   (keyword (:my-table-name table-names))
But I get an error that states: PSQLException ERROR: operator does not exist: uuid = character varying

Mario C.20:07:19

I am assuming here that :guid is telling the jdbc wrapper that :guid is the primary key.

Mario C.20:07:11

The id I am passing is generated by java.util.UUID/randomUUID and it is of type string

Mario C.20:07:29

It doesn't like that I am passing a string representation of a UUID. So I think I need to find a way to convert that string into a UUID and then send that over.

Karol Wójcik21:07:06

Does anybody have a problem with running the compojure example? I tried:

lein new compojure new-app
cd new-app
lein ring server
and poof:
Could not transfer artifact org.eclipse.jetty.orbit:javax.servlet:jar:2.5.0.v201103041518 from/to central (): Read timed out
Could not find artifact org.eclipse.jetty.orbit:javax.servlet:jar:2.5.0.v201103041518 in clojars ()
Could not find artifact org.eclipse.jetty.orbit:javax.servlet:jar:2.5.0.v201103041518 in  ()
Could not find artifact org.eclipse.jetty.orbit:javax.servlet:jar:2.5.0.v201103041518 in sonatype ()
Could not find artifact org.eclipse.jetty.orbit:javax.servlet:jar:2.5.0.v201103041518 in redhat ()
Could not transfer artifact org.eclipse.jetty.orbit:javax.servlet:pom:2.5.0.v201103041518 from/to central (): Read timed out
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.


works fine here, I would check all the things it mentions there (network, permissions, proxies)

Karol Wójcik21:07:19

ok that's problem with my network

Karol Wójcik21:07:18

😕 has anybody had a similar issue?


is it repeatable? it says there "Read timed out". Possible its just a transient thing?

Karol Wójcik21:07:43

It's repeatable. It seems that's something wrong with my router. I am able to surf the net without any problems but when I try to download the jar manually then chrome says that this jar can harm my computer

Karol Wójcik22:07:03

What is funny it;s not a problem with the antivirus. 😛 Tried with mobile network and it worked perfectly.