This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-21
Channels
- # announcements (1)
- # aws-lambda (62)
- # babashka (116)
- # beginners (67)
- # chlorine-clover (39)
- # cider (10)
- # cljs-dev (5)
- # clojure (30)
- # clojure-austin (2)
- # clojure-europe (2)
- # clojure-italy (6)
- # clojure-nl (24)
- # clojure-uk (28)
- # clojurescript (33)
- # data-science (6)
- # datascript (10)
- # datomic (5)
- # duct (39)
- # emacs (1)
- # events (8)
- # fulcro (9)
- # graalvm (29)
- # hoplon (7)
- # juxt (10)
- # malli (4)
- # off-topic (6)
- # pathom (10)
- # perun (1)
- # reagent (45)
- # shadow-cljs (5)
- # sql (14)
- # tools-deps (10)
- # xtdb (9)
Hello,I want to know is there any useful libs for clojure operating file of binary and text??
@steiner3044 The idiomatic approach would be to use interop and rely on the Java I/O libraries.
I knew why, but I don’t remember. Why spec/assert
doesn’t throw exception by default and this is solved by
(s/check-asserts true)
?
I am thinking if I am going to use assert
in correct wayAssertions are a dev time feature, off by default
#:clojure.spec.alpha{:problems ({:path [:shop/uuid],
:pred clojure.core/uuid?,
:val "999",
:via [:shop/uuid],
:in [:shop/uuid]}),
:spec :api.shops.spec/shop,
:value #:shop{:uuid "999"},
:failure :assertion-failed}
vs
#:clojure.spec.alpha{:problems ({:path [:shop/uuid],
:pred clojure.core/uuid?,
:val "999",
:via [:api.shops.spec/shop :shop/uuid],
:in [:shop/uuid]}),
:spec :api.shops.spec/shop,
:value #:shop{:uuid "999"}}
(comment
(try
(s/explain-data ::s-shop/shop {:shop/uuid "999"})
(s/assert ::s-shop/shop {:shop/uuid "999"})
(catch Exception e
(ex-data e))))
Hey guys, can i use datomic-free as a persistent database( Preferably over mysql) or is it available only as an in-memory database and i have to get the Starter edition in order to use persistent db?
You may want to try #datomic
i'm developing an http proxy (between two services). which library/libraries would you recommend for evented io? i searched around and it looks like aleph is almost the only way to go..
anyone run into trouble when trying to post to an Incoming Slackhook? I can curl
successfully with the code snippet they provide but I'm unable to make the same request using the clj-http
library. I keep getting a 400 Bad Request. Double and triple-checked my url and that the headers and the json body are correct. I have no idea at this point but I'm probably missing something obvious. Will post some code
curl -X POST -v --http1.1 -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' https://hooks.slack.com/services/0000000000000/000000000000/000000000000000 works fine
(defn alert
[payload]
(client/post slackhook
{
:accept "*/*"
:content-type :json
:body "{\"json\": \"input\"}" ;(ch/generate-string {:hello "world"})
:debug true
}))
i've tried setting the headers explicitly. the body is hardcoded right now because i just want to make sure its working. no dice400 Bad Request error is the response I keep getting
ah, i'm oblivious. there needs to be a "text" key in the body
https://github.com/dakrone/clj-http/blob/3.x/README.org#post shows a different way to set the content type header
thanks, @U11BV7MTK . i tried both ways of setting the header and just confirmed that the way I was setting still works. My mistake was that my payload wasn't following the correct pattern. Something I overlooked but also probably could have been a little more explicit in the documentation
You use proxy
to instantiate abstract classes.
It's pretty similar.
But it can instantiate non-interfaces (such as abstract classes).
one thing to be careful of is proxy-super
is the only way to invoke superclass methods, and it is not thread safe
if two threads call proxy-super on the same proxy concurrently, the proxy itself can be replaced by an auto-generated instance of the superclass, which as you might expect, breaks everything