This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-09
Channels
- # aws (51)
- # beginners (57)
- # calva (10)
- # chlorine-clover (7)
- # cider (20)
- # clj-kondo (55)
- # clojure (43)
- # clojure-europe (9)
- # clojure-italy (1)
- # clojure-nl (5)
- # clojure-spec (8)
- # clojure-uk (71)
- # clojurescript (33)
- # core-async (22)
- # cursive (20)
- # datomic (3)
- # emacs (8)
- # figwheel-main (8)
- # fulcro (13)
- # garden (2)
- # graalvm (60)
- # graphql (26)
- # jobs (6)
- # joker (6)
- # kaocha (2)
- # lambdaisland (5)
- # malli (36)
- # off-topic (9)
- # portkey (15)
- # re-frame (3)
- # reagent (25)
- # remote-jobs (4)
- # spacemacs (3)
- # sql (111)
- # tree-sitter (29)
- # uncomplicate (3)
- # xtdb (2)
Hey, I am havin a problem with wrap-reload
of the ring library: It expects a var
as argument, but since I am using a component-based approach, the routes are created via a closure.
I tried just wrapping the closure with wrap-reload
, but it does not really work.
Here a short code example:
(defn app-routes [app-component]
(api
(GET "/" [] "<h1> Hello, World! </h1>))
(defrecord WebServer [config http-server app-component]
component/Lifecycle
(start [this]
(assoc this :http-server (jetty/run-jetty (app-routes app-component) config))))
@aoellerer you might need to create a handler component, and then set that as a dependency for the jetty component, something like this here: https://github.com/weavejester/ring-jetty-component/pull/5#issuecomment-301809215
anyone using neanderthal?
nope didnt know that, do you mean channel?
nothing showed up when i searched
I installed mkl via intel installer and set the value in proj.cli…same error
you might want to use the os package manager instead of the mkl instructions in some cases
i’m on macos, no package manager
Thanks anyway…I think I might have gotten it to work, environment variable problem
@datran I use Google's Java SDK for their translate API, it's pretty easy to use from Clojure, I'd say a wrapper is unnecessary
You're right, but it's not working out of the box for me so I thought I'd cast a desperate plea into the wind.
that always helps ;-) Word about credentials - Google is particular about where you store them and how. It's easier if you're running on GCP, as the SDK can pull the credentials for you, assuming all service accounts and permission scopes are wired correctly
I think once I clear up authentication and dependencies the actual api seems very simple, but auth and deps are making my day not go smoothly : /
fyi, the problem was an out-of-date com.google.protobuf/protobuf-java
dep, bumping that fixed the current error
I might be going overboard. But I often have cases where I'm threading stuff, and I need to branch. Like A->B->CONDITION->cOR->d
(-> a
(b)
(cond->
condition (c)
(not condition) (d)))
Like that you mean @didibusor
(-> a
(b)
(as-> v
(if condition
(c v)
(c d))))
maybe that's clearer?It really depends on how complex a, b, c, d, and condition are.
We have condp->
and condp->>
for that in our ws.clojure.extensions
lib (`worldsingles/commons` I think on github)