Fork me on GitHub
#clojure-uk
<
2019-01-24
>
thomas08:01:04

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.

mccraigmccraig08:01:20

java layer - why would you do that to yourself @thomas? trollface

thomas08:01:04

I know... I took http-kit as a starting point and all the low level bit mangling is done in java.

thomas08:01:14

maybe it is because I like pain 😉

Ben Hammond09:01:00

really not any more hassle than a volatile/atom/agent

thomas09:01:33

yes, I was thinking about using that

alexlynham09:01:59

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?

alexlynham09:01:49

(map (fn-that-returns-a-hash) [:key-one :key-two :key-three]) ^ executes fn-that-returns-a-hash once

alexlynham09:01:21

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

alexlynham09:01:22

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

alexlynham10:01:48

I feel like this is a thing @rickmoynihan would know about...

Rachel Westmacott10:01:05

well you’re doing different things

Rachel Westmacott10:01:43

(map #(fn-that-returns-a-hash) [:key-one :key-two :key-three]) would execute fn-that-returns-a-hash three times

Rachel Westmacott10:01:03

it has nothing to do with referencing an element from the collection

Rachel Westmacott10:01:23

and everything to do with what you pass to map

Rachel Westmacott10:01:15

(map (f) ...) calls f once and passes the result of f to map

Rachel Westmacott10:01:49

(map #(f) ...) passes an anonymous function to map and it gets called once per item you map over

alexlynham11:01:38

hmm, I think I need to rethink my example.

alexlynham11:01:37

no, actually you're right, it's as simple as that

alexlynham11:01:44

I'm looking for magic that isn't there

alexlynham11:01:19

it's that without the anon fn call it's not a predicate, it's just the result of a function call

danm11:01:55

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])

alexlynham12:01:24

aye yeah, the example somebody had asked me about was more complex and involved closed-over i/o, hence me having to sense-check 🙂

danm13:01:11

👍:skin-tone-2:

danm11:01:18

(note the lack of brackets on fn-that-returns-a-hash)

danm11:01:42

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

3Jane12:01:59

I wanted to, but forgot to check when in 2019 it is, bit late to plan now 😞

danm12:01:58

Boo :( Aah well

3Jane12:01:46

Brussels though >_>

3Jane12:01:29

Not a destination like Paris, should still have rooms, right?

otfrom13:01:22

this was an interesting talk: https://vimeo.com/74354480

thomas13:01:57

more to watch...

danm13:01:14

@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 😉

3Jane13:01:45

Ooh that sounds exactly like a talk I want to watch now

3Jane13:01:31

@carr0t I’m gonna poke at Airbnb and airline searches, see what falls out and let you know tomorrow!

5
3Jane13:01:50

Thank you for the reminder, otherwise it’d have gone past my nose :D

Conor13:01:54

I don't need to go to FOSDEM @carr0t, I can just read the trip report on n-gate

danm14:01:29

Has anyone ever set up a ~/.lein/profiles.clj where you have a certificate-protected repo where the certificate is password protected?

folcon14:01:09

If you’re still stuck on this I can lookup my own config, I had to get this working for datomic I believe…

danm14:01:56

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

thomas14:01:55

I used to... but can't quite remember.... have a look at the leiningen template file... that should have everything in it.

danm14:01:14

The what now? 😉

danm14:01:39

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

danm14:01:46

Possibly I am just failing at Google...

danm14:01:28

I'm possibly using certificates wrong. Docs seem to suggest it's for validating the server certificate

danm14:01:36

I need to pass in the client certificate

danm14:01:13

And it has a list of env vars at the bottom, marvellous!

thomas14:01:18

maybe have a look at how maven would do that... as lein uses maven under the covers (I suspect)

danm14:01:35

Dammit, still not working. I swear this worked a few days ago

danm14:01:38

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

5
dominicm15:01:54

That's exactly what happens

3Jane18:01:46

I’m gonna have to miss today’s meetup, feeling not too well -.-

😞 5
dominicm18:01:25

Which meet up?

3Jane18:01:31

papers we love

3Jane18:01:43

there’s a fair overlap between that and clojure community I think 😄

dominicm18:01:17

I'm running a meet up tonight 😁

3Jane18:01:32

ahh 😄 in MK?

dominicm18:01:16

https://www.meetup.com/FuncMK/ I shouldn't take any of the glory really

dominicm21:01:36

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

seancorfield23:01:23

“- clj supports Windows pretty well for our purposes (if you follow the edge guide)” — could you elaborate @dominicm?

dominicm23:01:09

@seancorfield your tips were useful, and GitBash follows largely the same. Your caveats hold, but beginners aren't using editor integration.

seancorfield23:01:39

Ah, I hadn’t bothered to try it in GitBash…

seancorfield23:01:11

(since most of the stuff I need for dev needs more than GitBash offers I suspect)