This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-24
Channels
- # announcements (4)
- # beginners (37)
- # boot (13)
- # boot-dev (3)
- # calva (122)
- # cider (16)
- # clara (13)
- # cljs-dev (3)
- # cljsrn (8)
- # clojure (311)
- # clojure-denver (1)
- # clojure-dev (14)
- # clojure-europe (7)
- # clojure-italy (36)
- # clojure-nl (3)
- # clojure-spec (11)
- # clojure-uk (77)
- # clojurescript (91)
- # core-async (10)
- # cursive (9)
- # data-science (5)
- # datomic (46)
- # devcards (2)
- # emacs (6)
- # figwheel-main (15)
- # fulcro (51)
- # jobs (3)
- # kaocha (10)
- # nrepl (6)
- # off-topic (53)
- # om (1)
- # onyx (2)
- # pathom (5)
- # reagent (50)
- # reitit (26)
- # shadow-cljs (153)
- # spacemacs (17)
- # specter (5)
- # speculative (1)
- # test-check (19)
- # tools-deps (15)
- # yada (3)
måning
morning
and thank you for the tip @mccraigmccraig , but I am thinking about updating the counters in the java layer, as I have all the details there that are needed. No need to count them all again in the Clojure layer of the broker.
java layer - why would you do that to yourself @thomas?
I know... I took http-kit as a starting point and all the low level bit mangling is done in java.
https://docs.oracle.com/javase/8/docs/api/index.html?java/util/concurrent/atomic/AtomicLong.html will always be your friend (and mine)
really not any more hassle than a volatile/atom/agent
hey, potentially dumb question - where in the docs is there mention of the fact that a predicate fn in e.g. a map will only be eval'd multiple times if an element from the coll is referenced?
(map (fn-that-returns-a-hash) [:key-one :key-two :key-three])
^ executes fn-that-returns-a-hash
once
whereas
(map #(fn-that-returns-a-hash %) [:key-one :key-two :key-three])
would call the fn 3 times, even if the bound reference isn't used
as soon as I saw this, I thought "oh I've seen/read about this before" but I can't find the thing I had in mind
I feel like this is a thing @rickmoynihan would know about...
well you’re doing different things
(map #(fn-that-returns-a-hash) [:key-one :key-two :key-three])
would execute fn-that-returns-a-hash
three times
it has nothing to do with referencing an element from the collection
and everything to do with what you pass to map
(map (f) ...)
calls f
once and passes the result of f to map
(map #(f) ...)
passes an anonymous function to map
and it gets called once per item you map over
hmm, I think I need to rethink my example.
no, actually you're right, it's as simple as that
I'm looking for magic that isn't there
it's that without the anon fn call it's not a predicate, it's just the result of a function call
If you want to avoid the pointless anon function (in cases where the only arg to fn-that-returns-a-hash
is the value from the vector), you can just do (map fn-that-returns-a-hash [:key-one :key-two :key-three])
aye yeah, the example somebody had asked me about was more complex and involved closed-over i/o, hence me having to sense-check 🙂
Off-topic, is anyone from here going to FOSDEM this year? If so, it'd be good to try and meet up and put faces to names
this was an interesting talk: https://vimeo.com/74354480
@lady3janepl I would have thought so, and the conference itself is of course free. Give me a shout if you do end up going 🙂 I am apparently the only person from my section in Manchester going, everyone else from the beeb is out of London, so I'm not even going to know folks from my own company 😉
@carr0t I’m gonna poke at Airbnb and airline searches, see what falls out and let you know tomorrow!
Has anyone ever set up a ~/.lein/profiles.clj
where you have a certificate-protected repo where the certificate is password protected?
If you’re still stuck on this I can lookup my own config, I had to get this working for datomic I believe…
I found something online that suggested it should just contain {:user {:certificates ["/path/to/cert/me.pem"]}}
, where the pem is the passwordless version, but that failed to read correctly, so I tried the p12 which is what I reference in MAVEN_OPTIONS etc, but I also provide the password to MAVEN_OPTIONS, and I can't find docs on how to do that for profiles.clj
I used to... but can't quite remember.... have a look at the leiningen template file... that should have everything in it.
I have spent 30 mins googling around trying to find some kind of documentation or template that shows all the options you can specify, and come up a blank
I'm possibly using certificates
wrong. Docs seem to suggest it's for validating the server certificate
maybe have a look at how maven would do that... as lein uses maven under the covers (I suspect)
I wonder if I just by chance always had the bits I needed in the maven cache, so lein in IntelliJ never actually tried to connect
https://www.meetup.com/FuncMK/ I shouldn't take any of the glory really
Learnings: - people with no clojure knowledge do really well picking up clojure - difficulty is not discouraging - the repl is great - people do things in the order written, so that's important - clj supports Windows pretty well for our purposes (if you follow the edge guide) - old versions of git bash segfault with clj (have fun debugging that one on the fly) - I need to learn some more pedagogy and get creative in ramping up the challenges
“- clj supports Windows pretty well for our purposes (if you follow the edge guide)” — could you elaborate @dominicm?
@seancorfield your tips were useful, and GitBash follows largely the same. Your caveats hold, but beginners aren't using editor integration.
Ah, I hadn’t bothered to try it in GitBash…
(since most of the stuff I need for dev needs more than GitBash offers I suspect)