This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-18
Channels
- # admin-announcements (7)
- # arachne (24)
- # beginners (40)
- # boot (24)
- # braid-chat (22)
- # cider (8)
- # cljsrn (35)
- # clojure (32)
- # clojure-austin (1)
- # clojure-belgium (52)
- # clojure-russia (16)
- # clojure-sanfrancisco (1)
- # clojure-taiwan (2)
- # clojure-uk (25)
- # clojurescript (112)
- # core-async (3)
- # cursive (18)
- # data-science (1)
- # datascript (7)
- # datomic (30)
- # devcards (2)
- # dirac (12)
- # emacs (4)
- # flambo (1)
- # funcool (5)
- # hoplon (146)
- # jobs (9)
- # jvm (5)
- # off-topic (4)
- # om (141)
- # onyx (22)
- # re-frame (89)
- # reagent (86)
- # ring-swagger (31)
- # rum (3)
- # spacemacs (1)
- # specter (10)
- # untangled (112)
- # yada (3)
@jeff.engebretsen: thanks for the recommendation. I will definitely pass that on.
Are nested refs a terrible idea? I’m trying to build some kind of todo list GUI with Swing and I’m trying to code a „view-model“ and that kind of leads me straight down that road. Because I need to watch the whole list and I need to watch each individual item of the list.
maybe someone know what i`m doing wrong: when i do "lain uberjar" for my project , i reseive these error: java.lang.ClassNotFoundException: org.eclipse.jetty.server.nio.SelectChannelConnector, compiling:(jetty.clj:1:1) [6:16] i`m use [info.sunng/ring-jetty9-adapter "0.9.3"] for ability use latest 9.3.8 jetty server
that's strange... maybe first try lein clean
and then again lein uberjar
. If you still have the same error please post the output of lein deps :tree
as suggested in #C03S1KBA2 you can try adding [org.eclipse.jetty/jetty-server "9.3.8.v20160314"]
to your :dependencies
in project.clj
. That's the version that ring-jetty9-adapter 9.3.8 expects to find
i try exclude ring-jetty-adapter from ring(have deps conflict with "[info.sunng/ring-jetty9-adapter "0.9.3"]"), and program run well, but when i try to compile this with "lein uberjar" i have some strange errors. In this case, when i need jetty 9.3.8 and ring in one project, i need to clone ring git-repository, compile it with my custom deps in ring-jetty-adapter(set "org.eclipse.jetty/jetty-server "9.8.3""), push it to clojars and just now i can add new jetty in my project, right?
@agi_underground: You should not need to create a custom version of Ring to achieve this! You just need to get the dependencies and exclusions right in your project.
@seancorfield: yes, thank you, that's exactly what I did. But now, when i try to start my project with http2 : java -jar target/project-0.1.0-SNAPSHOT-standalone.jar --add-to-startd=http2 i have this error: "Exception in thread "main" java.lang.NumberFormatException: For input string: "--add-to-startd=http2"" my versions of java etc.: java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
The stack trace will show you which line is causing that. Your -main
program is trying to process the command line arguments and expects a number where you’re passing a string.
@seancorfield: oy!) I'm dumb)
all works perfect! thanks for all!
one more question: when i need provide port to my app and in the same time param like http2, how to do this? with: java -jar target/app-0.1.0-SNAPSHOT-standalone.jar 4334 --add-to-startd=http2 it dont work
if you want something more fancy checkout https://github.com/clojure/tools.cli
but, i think --add-to-startd is option for java, isn`t it?
user=> (require '[org.httpkit.client :as c])
user=> (defn callback [{:keys [status headers body error]}] (println status))
user=> (c/get "" { :query-params { :access_token "mytok" }} callback)
401
user=> (c/get "" {} callback)
200
...am I missing something glaringly obvious here?well...i'm more talking about the :query-params
bit - the second one is just a string with the token in the url, which is what i thought the first should wind up as when the request is made
they look like they should make exactly the same request, accd to http://www.http-kit.org/client.html#async
so the url should look like "https://api.pinterest.com/v1/me/myotk” ?
yeah, the second call in the example up there returns a 200, so it's definitely working when the url is a string (and from curl as well)
i'm just wondering what beginner-level dumb mistake i'm making for the request with the param map to not work
hmm, yeah looks weird. My guess is that query-params
in that context doesn’t mean what we think it means
user=> (c/get "" {:query-params { :access_token "mytok"}} callback)
(in another terminal...)
$ python -m SimpleHTTPServer 8000
127.0.0.1 - - [18/May/2016 17:32:19] "GET /?access_token=mytok HTTP/1.1" 200 -