This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-25
Channels
- # aws (2)
- # beginners (57)
- # boot (31)
- # carry (15)
- # cider (9)
- # cljs-dev (9)
- # cljs-experience (32)
- # cljsrn (94)
- # clojure (129)
- # clojure-dusseldorf (3)
- # clojure-greece (4)
- # clojure-italy (8)
- # clojure-norway (3)
- # clojure-russia (344)
- # clojure-sg (39)
- # clojure-spec (2)
- # clojure-uk (39)
- # clojurescript (84)
- # core-async (99)
- # cursive (10)
- # data-science (1)
- # datascript (4)
- # datomic (66)
- # emacs (10)
- # graphql (4)
- # hoplon (28)
- # jobs (15)
- # luminus (3)
- # lumo (5)
- # off-topic (23)
- # om (4)
- # onyx (32)
- # pedestal (24)
- # re-frame (2)
- # reagent (7)
- # ring-swagger (32)
- # spacemacs (4)
- # untangled (57)
- # utah-clojurians (1)
People say "go do some internships" but i feel like internship really depends on the team you are in. I've had bad experience and i feel reluctant to do it again unless i feel the team is great. What is your opinion? Should you rush and go as fast as you can to work in teams change as much as you can before landing in a good one or develop alone then when the time is right join good team?
@lepistane almost all software of significance is developed by a team, working in any team teaches you how to interact even if it's what not to do.
also every situation is different and not all practices are translatable to other teams so a 'good' team in one organisation can't always be transplanted to another org.
Personally, I've learned a lot more from my and my fellow team members mistakes over the years than I have the successes.
i'm getting a spec error saying that my namespace doesn't conform. i'm getting this error on 1.9.0-alpha16, but not on alpha13 where it compiles just fine. any thoughts?
(ns
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [cljs.core.async :refer [put! chan <! >! timeout close!]]
#?(:cljs [cljs-http.client :refer [post get delete]])
[imcljs.internal.utils :refer [scrub-url]]
[imcljs.internal.defaults :refer [url wrap-get-defaults wrap-request-defaults
wrap-post-defaults wrap-auth wrap-accept
wrap-delete-defaults]]))
So what are some common approaches to database caching? If I run a SQL query and then do a bunch of operations on it for example, It probably won’t change, and I usually won’t want to fetch fresh (unless I do). Memoize seems too permanent, (because I might want to refresh). Atom?
@fingertoe Perhaps https://github.com/clojure/core.cache or a more dedicated solution such as Memcached or Redis
also https://github.com/clojure/core.memoize (which uses core.cache internally)
Is there a reason to use the thread-first macro vs get-in for retrieving values in a nested map or vice-versa, e.g. (-> m :profile :name)
vs (get-in m [:profile :name])
? Is one considered more idiomatic?
only use -> if you need to use functions as part of lookup, if it’s only a series of keys always use get-in
use the least powerful tool
very helpful, thanks
I would say both are ok and are frequently used. personally, in this case I would probably use get-in
as it communicates more, but I would not complain if someone used ->
.
fwiw, i find -> much more useful during dev, because it makes it very easy to inject functions (like meta) that help me figure out why my code doesn't work.
Hi all, brand new to Clojure. LOVE the language but know nothing of the ecosystem. Where should I start for a REST api? Is there a simple Express or Sinatra like framework to use? Some particular library to look at? thx!
@fedreg do note that Ring is really just a common spec that most libraries follow, it defines handlers, middleware and request / response maps
@akiroz. Yup, gives me a good starting point. Exactly what I was looking for. Did not want something that wired everything up for me
@akiroz. Will take a look at that as well. Much to learn but wow what an expressive language
@mobileink I should probably say "ring-compatiable server"
never thought of it before, but this little bit of terminological confusion could be a prob for noobs. i know it took me a while to understand just what ring is/does.
more like a spec really, it defines how handlers / middleware should behave and what req / response maps look like. (the ring library also comes with a bunch of default middlewares and handlers)
yeah.... the term "Ring" by itself is super overloaded. It refers to the spec, the library and all the other libs compatible with the spec
isn’t ring a protocol or set of protocols?
or is it something slightly weirder?
Hello guys, could you help me, how can I implement this in Clojure? (HMAC(HMAC(HMAC(HMAC("AWS4" + "BAIIZQiU7ee4secrettokenkeyLZs3TNsRgTd","20170525"),"us-east-1"),"s3"),"aws4_request"))
@noisesmith: you can think of it (i think) as an intermediate protocol, between http and the app. so the app does not have to dirty its hands with http details.
here is the instructions http://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html
More of a data contract than a protocol. A ring server will call your registered handler with a request data structure that looks like this and expects a response data structure that looks like that.
@mobileink oh I meant like literally the ring library defines a clojure protocol
I’ll just check the source
@donaldball smells like a protocol to me. 😉
@mobileink I was talking about this - what each http server you can use via ring must implement https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/core/protocols.clj
Heh. I tend to think of protocols in clojure as defprotocol
s
@donaldball yup the protocols are in that file I just linked
i'm thinking more generally, i guess. you could write a ring-like protocol without defprotocol. that's implementation detail. cgi is a kind of protocol.
once upon a time the server-side protocols of ring would have been called an SPI - "Service Provider Interface". exactly like HW driver SPIs.
@mobileink to be clear, I was the one who dropped “protocol” into this convo, and it’s cool that you free associated and linked in the concept of a network protocol but I distinctly meant the kind of protocol that defprotocol creates
cool. i loves defprotocol. but it's implementation. you have to have a protocol already before you can start thinking about defprotocol.
then there's the dynamic bit. there are really at least 2 notions of protocol. defprotocol is really just like treating a class interface in oo is a kind of protocol - "signature" might be a better term. i tend to think of protocols as inherently involving interactivity.