This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-22
Channels
- # aws (4)
- # bangalore-clj (2)
- # beginners (99)
- # boot (8)
- # clojars (22)
- # clojure (87)
- # clojure-dev (2)
- # clojure-greece (10)
- # clojure-russia (22)
- # clojurescript (80)
- # cursive (4)
- # data-science (2)
- # datomic (10)
- # emacs (1)
- # fulcro (1)
- # garden (2)
- # luminus (1)
- # lumo (29)
- # off-topic (20)
- # om (6)
- # onyx (18)
- # parinfer (7)
- # perun (1)
- # portkey (28)
- # re-frame (93)
- # reagent (59)
- # ring-swagger (2)
- # shadow-cljs (31)
- # slack-help (15)
- # spacemacs (5)
- # uncomplicate (3)
- # yada (6)
1. I'm looking for a Clojure database/persistent/storage solution. 2. I know about Datomic. I don't think Datomic is the correct answer. 3. It needs to support the following ops [:assoc-in path value] ==> returns nil [:delete-in path] ==> returns nil [:get-in path] ==> returns part of submap [:get-in-keys path] ==> returns just the keys instead of entire submap 4. so my storage is a giant clojure atom/map, and those 4 ops are available via rest is there any clojure storage solution that is structured like this?
hey folks. I've been away from the clojure universe for a few years and am working on getting back into it. I'm looking for guidance from the masses on what the current state of the art is vis-a-vis packages for microservices authentication. Previously I've used Chas Emerick's friend - but I'm seeing in the project readme on github that he's been looking for a new maintainer, and I'm not seeing alot of activity in the repo at all. Which, all adds up to a general unease I have with using it on a new project. Any tips, guidance, etc is much appreciated!
@smnirven did you have issues with it before? If not, and if it worked for you, then that should count for something. I'm just playing devil's advocate here π
just trying to avoid the trap of using it if the rest of the community has moved onto something that's better supported
@smnirven not sure what the breakdown is but Buddy is another relatively well-known security library
at a repl, why would functions like get, get-in be available to me, but not int?
where I get CompilerException java.lang.RuntimeException: Unable to resolve symbol: int? in this context
-- very strange? I'm using Clojure 1.9
i think i found the issue. clojure repls are just too reliable and this one was running for weeks without a restart, even after changing the clojure version to 1.9, and this fn was the only one from 1.9 that is now in the code, so the lack of a restart was not discovered yet.
syntax-quote sets up a context so that unquote will work, to do so it must wrap all its sequential elements in lists and series of concats
so every time you nest syntax quote it will wrap the transformed body and flatten everything into wrapped lists etc
ah, here right? https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L977-L1147
what is the difference, if any, between these two macros?
(defmacro a [& body]
(eval (cons 'do body)))
(defmacro b [& body]
`(do ~@body))
I'm using http-kit for web-server + web-socket-server. I have created a self signed SSL certificate. What is the easiest way to "wrap" my http/ws as https/wss ?
@qqq for production or development?
I use the simple way out
@pesterhazy: what's the simple way out ?
use https://github.com/indexzero/http-server with arg --proxy
simply provide the certs as command line args, run the proxy server in a separate terminal, done
lol, the instructions I was reading on setting up self signed certificates suggested that very package
http-server
is solid
https://certsimple.com/blog/localhost-ssl-fix is the tutorial I'm reading
I think I followed the same
pretty much
there was a problem with Chrome I remember
you need to set the alt-name or something like that when creating the cert
but it was reasonably simple
http-server -ssl --cert ~/.localhost-ssl/cert.pem --key ~/.localhost-ssl/key.pem
/usr/bin/env: βnodeβ: No such file or directory
do I now install node via "npm" or via "sudo apt-get install nodejs-legacy" ?install node on ubuntu the normal way, whichever that is
preferably not legacy π
e: To avoid conflicts, the executable from the Ubuntu repositories is titled nodejs instead of node. Keep this in mind as you are executing applications.
haha lol
ln -s /usr/bin/nodejs /usr/bin/node
right π
the really poor design there is that tyoing "node" in bash leads apt-get recommending "nodejs-legacy" (sinde that's the apckage that provides the binary 'node')
so I'm running:
http-server -ssl --cert ~/.localhost-ssl/cert.pem --key ~/.localhost-ssl/key.pem
and then I can access http://localhost:8080 , but I can't access https://localhost:8080
then I do a "netstat -ln" ... and besides 8080, I don't see any other ports openedFor anyone curious, the resolution is (credit for all this goes to @pesterhazy , resolved in #off-topic ) 1. the command is
http-server --ssl --cert ~/.localhost-ssl/cert.pem --key ~/.localhost-ssl/key.pem -p 8443
2. osx / chrome has some weird ssl issue // there are complicated instructions at https://alexanderzeitler.com/articles/Fixing-Chrome-missing_subjectAltName-selfsigned-cert-openssl/
3. first comment suggest alternative solution of
defaults write com.google.Chrome EnableCommonNameFallbackForLocalAnchors -bool true
I'm not sure the security implications of that -- but it made things work on my machine.for java interop if I import a java inner class I need seem to need to use the full name since Foo$Bar/xyz
doesn't work? Any way around that? (nvm, I was importing incorrectly)
@mnewhook: one of the most useful things I found is (clojure.reflect/reflect JAVA-CLASS-NAME) and looking over that, it shows all the members / inner classes / etc ...
yeah, I was trying to import com.abc.Foo$Bar
, or com.abc.Foo$ Bar
, etc. When I should have been using com.abc Foo$Bar
π©
Hi! I read quite a bit about spec and am really fascinated by the concept, but I am still wondering how Clojurians are actually integrating it into their development workflow. Do you just (instrument)
your REPL? Or integrate it with your test suite somehow? I would be super interested in experience reports!
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_144-b01
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (java.util.HashMap.)
{}
user=>
"loading" of a java class happens on first use/reference, import is not necessary if you refer by the fully qualified name
is there a pattern used for sending functions onto a channel for completion? something like this
(defn expensive-call [number]
(let [sleep-count (rand-int 5000)]
(Thread/sleep sleep-count)
[number sleep-count]))
(defn executor [buff-size]
(let [in-ch (async/chan buff-size)
out-ch (async/chan buff-size)]
(async/thread
(loop []
(let [pending (async/<!! in-ch)]
(when (instance? clojure.lang.Delay pending)
(async/thread
(async/>!! out-ch (force pending)))
(recur)))))
{:input-ch in-ch :output-ch out-ch}))
(defn test [buff-size send-count]
(let [{:keys [input-ch output-ch]} (executor buff-size)]
(doseq [n (range send-count)]
(async/>!! input-ch (delay (expensive-call n))))
(dotimes [n send-count]
(let [result (async/<!! output-ch)]
(println "got result:" result)))))
> (time (test 1 10))
got result: [5 766]
got result: [0 795]
got result: [9 991]
got result: [1 1034]
got result: [4 1524]
got result: [3 1708]
got result: [7 2148]
got result: [2 2486]
got result: [8 3531]
got result: [6 3682]
"Elapsed time: 3690.147902 msecs"
nil
@beoliver pipelines? https://clojuredocs.org/clojure.core.async/pipeline#example-57f58bd2e4b0709b524f0521
@keymone yeah, I think the pipeline-async might be even closer https://clojuredocs.org/clojure.core.async/pipeline-async