Fork me on GitHub
#clojure-uk
<
2019-12-04
>
dharrigan06:12:36

Morning Everyone!

yogidevbear06:12:38

You can always easily identify the people with young children 😂 Morning o/

dharrigan06:12:09

My good start of the day is that the latest slack client has reverted that horrible rich text editor, you can enable previous editing, using markup, now!

dharrigan06:12:11

preferences...`advanced`...ensure that format texts with markup is ticked.

seancorfield07:12:04

Fabulous! Pity you have to set that for every single workspace you use in Slack tho'...

dharrigan07:12:40

indeed, but luckily it carries forward to each slack instance, i.e., if you have a work machine and a laptop with slack on them both

dharrigan07:12:57

I always wondered why there isn't a "meta" preferences that applies globally. I sometimes think that Slack exploded in popularity and the original intent was lost and having multiple workspaces with a global preferences didn't really make the cut originally.

seancorfield07:12:46

Yeah, they have all sorts of weird cross-workspace features but they don't really help you if you have multiple independent workspaces...

dharrigan07:12:41

Right - bbl - kid is demanding to be fed - how selfish! 😉

seancorfield07:12:05

Anyone been watching Castle Rock (Hulu)? Does it eventually make sense?

dominicm08:12:32

The new interface encouraged me to use ripcord again

ben.hammond09:12:25

reClojure inspired me to take a proper look at shadow-cljs I appreciate that the npm integration is a Really Good Thing - I'm not sure what else it does better than Figwheel though. What are the other reasons to choose shadowcljs?

mccraigmccraig09:12:30

the analysis of each namespace's contribution to eventual js bundle size and the modularization support are the killer features for me

alex.lynham13:12:57

the node/npm interop genuinely is way better too though, can’t overstate how useful that is if you’ve got any JS experience you wanna build on

djtango09:12:04

Hello nice and on topic question. Anyone know a very good gastropub type restaurant for a cosy christmas dinner anywhere along the line between London to Milton Keynes

djtango09:12:01

Was hoping some of our resident Milton Keynes members might know.. :p

dominicm09:12:50

When you say between London to Milton Keynes, what do you mean exactly? :)

djtango17:12:16

anywhere which isn't too far of a detour on the drive back home from Milton Keynes

jack.crawley9209:12:31

The Red Lion in Hemel Hempstead

jack.crawley9209:12:59

Takes a bit of a drive though, it isn't near the station

jack.crawley9209:12:07

But the food is outstanding

jack.crawley9209:12:43

There's another branch in Berkhamsted within walk of the station (maybe 10 minutes?), still pretty solid but not quite as good IME.

jack.crawley9209:12:46

The Berkhamsted branch is The King's Arms, the chain is Oakman Inns

maleghast10:12:18

@dominicm - What's "ripcord"?

dominicm10:12:28

https://cancel.fm/ripcord/ alternative slack and discord client that's written naively, no Web browser technology inside. Very snappy.

dominicm10:12:38

One of the better clients I've used.

jack.crawley9210:12:46

Was looking for an alternative

dominicm10:12:51

There's a few rough edges, but on the whole I really like it.

jack.crawley9210:12:33

Given the domain that sounds alright. Main thing is taking less than a small game's worth of resources per client

ben.hammond10:12:48

ooh can it save me some CPU

ben.hammond10:12:53

how long before it saves me $20 of 'leccy

dominicm10:12:20

Haha, hadn't considered that

jack.crawley9210:12:11

If it takes less RAM that also means you have to pay less RAM rent

conor.p.farrell15:12:06

Good shout re: Ripcord, it has given me half my monitor back now that I don't need Slack and Discord windows

dominicm15:12:44

How much ram rent do you save?

jack.crawley9215:12:02

Depends where my laptop is. It's more expensive in London.

maleghast10:12:49

@seancorfield - Is that the Inspired by Stephen King show..? I have been really wanting to watch that...

seancorfield17:12:51

Yes it is all based in Castle Rock, Maine and many of the characters are derived from Stephen King stories. It's really good -- best Hulu original I've watched so far -- but it's confusing as hell with jumps all over the timeline and several alternative and often imagined story lines!

maleghast11:12:14

Hey y'all, I am hoping that I am doing something dumb, but... I have this code:

response @(http/post
                   api-url
                   {:headers {ECMWF-API-Key-Header ECMWF-API-Key
                              ECMWF-From-Header ECMWF-API-Key-From}
                    :body json-data-request
                    :content-type :json
                    :accept :json})]
(inside a (let ...) )

maleghast11:12:09

when I run (type response) I get aleph.http.core.NettyResponse like I expect, but if I try to pick it apart all I get is errors... Eventually I (println response) and I just get a number. A couple of days ago this code was working... 😞

maleghast11:12:26

Anyone got any idea(s) as to how I am being stupid?

cfeckardt11:12:43

what’s this?

cfeckardt11:12:46

{ECMWF-API-Key-Header ECMWF-API-Key
 ECMWF-From-Header ECMWF-API-Key-From}

maleghast11:12:15

They are def-ed higher up - credentials for the API I am hitting.

cfeckardt11:12:27

yeah the vars just looked odd to me

maleghast11:12:59

It is worth mentioning that the API in question is successfully queueing my request(s), I am just not able to interrogate the response in the way that I was...

cfeckardt11:12:24

(p/def-derived-map NettyResponse [^HttpResponse rsp complete body]
  :status (-> rsp .status .code)
  :aleph/keep-alive? (HttpUtil/isKeepAlive rsp)
  :headers (-> rsp .headers headers->map)
  :aleph/complete complete
  :body body)

cfeckardt11:12:48

looks like it’s a derived-map

cfeckardt11:12:46

so it’s just calling the underlying HttpResponse object

cfeckardt11:12:55

do any of those keys work?

maleghast11:12:40

nope - and yet responses I get from http/get do have those keys

cfeckardt11:12:33

not even :status ?

maleghast11:12:40

Nope I get nil

maleghast11:12:04

I am starting to wonder if the API is actually sending a bad response / is broken.

maleghast11:12:18

going to check in an API client...

cfeckardt11:12:23

what is the value of :key-set##?

cfeckardt11:12:31

that’s the raw underlying object

maleghast11:12:31

I think I know what is going on...

maleghast11:12:16

I am attempting to force the delivery of the defferred by using @ and doing it inside a (let...)

maleghast11:12:00

If I run the (http/operations in my REPL they get delivered, albeit slowly (150-200 ms)

maleghast11:12:14

When I test the whole function(s) when the http requests are being made and I am trying to bind them to a local var in a (let ...) then for some reason they are transformed into a number...

cfeckardt11:12:03

are you not allowed to do that?

cfeckardt11:12:10

I thought it’d just block until delivery?

cfeckardt11:12:35

;; A future's calculation is started here and it runs in another thread
user=> (def f (future (Thread/sleep 10000) (println "done") 100))
#'user/f
;;if you wait 10 seconds before dereferencing it you'll see "done"

;; When you dereference it you will block until the result is available.
user=> @f
done
100

maleghast11:12:21

So did I, but it does seem to be doing something weird. As I say, the actual http/ calls work in my REPL and indeed the REPL blocks until they are delivered.

cfeckardt11:12:31

Clojure 1.10.1
user=> (def f (future (Thread/sleep 10000) (println "done") 100))
#'user/f
user=> (let [g @f] (println f)
done

maleghast11:12:08

@cfeckardt - It's not a plain future, it's a manifold deferred (aleph uses manifold under the hood), and this is where I am wondering if there is a difference...

maleghast11:12:33

I am going to try just a "toy" version in my REPL with a Manifold Deferred and see what happens...

maleghast11:12:56

(I still think that I am just doing something dumb and I can't see the wood for the trees)

mccraigmccraig11:12:49

@maleghast derefing a manifold deferred is fine from a sync code context... don't do it from inside deferred/chains though (you can cause deadlocks)

maleghast12:12:26

Yep, I got to the bottom of it... I am going to slink off into the corner and ask you all to pretend I never posted any of this ^^

maleghast12:12:05

Suffice it to say that I was just being a dumbass - sorry for the distraction...

cfeckardt13:12:32

what was it?

seancorfield17:12:49

Yeah, don't leave us in suspense -- what was the issue?🙃

dominicm17:12:16

it's killing me

mccraigmccraig12:12:26

we're all dumbasses pretty much all the time aren't we ? or am i just projecting ?

jasonbell12:12:16

I think so, and it’s a good place to be, means we’re all learning more at the same time.