Fork me on GitHub
#clojure-uk
<
2020-05-01
>
seancorfield05:05:03

I have to go back to work today. I've enjoyed taking two days off in the middle of the week.

dharrigan05:05:59

Haven't had a day off yet - considering it 'tho. But with a young kid, and with lock-in, with no-where to go...what do? what do?

seancorfield05:05:05

At least it's Friday -- soon be beer'o'clock!

dharrigan05:05:41

Work is my only respite atm πŸ™‚

seancorfield05:05:50

I did the front and back lawns yesterdays, a bunch of reading, shopping, litter boxes, trash & recycling... Got a lot done over the last two days! We also finished season 2 of Star Trek TOS and we're six episodes into season 3 now πŸ™‚

dharrigan05:05:08

Excellent choices! πŸ™‚

seancorfield05:05:20

Plus, it was nice to kick back and have a beer at lunch πŸ™‚

dharrigan05:05:31

I've been relearning - slowly - very slowly - the guitar πŸ™‚

seancorfield05:05:08

I am hopeless with musical instruments -- very sad, since I love music. Learned trumpet at school (I was awful). Bought a synth to learn keyboards and eventually gave it away to a friend. Borrowed my dad's guitar for years and never could get a tune out of it...

seancorfield05:05:10

(the friend I gave the synth to could play anything ... so frustrating to watch but also very impressive!)

dharrigan05:05:41

I too have lofty aspirations....I too did trumpet at school and piano...and guitar....I'm not a rock star megagod.....yet

dharrigan05:05:57

I can barely strum a chord

seancorfield05:05:43

The most impressive bits of music I've ever played, are when I've programmed a computer πŸ™‚

dharrigan05:05:01

πŸ™‚ I recall trying to get the SID chip on my C64 to do something. I failed.

dharrigan05:05:24

I guess I'm destined to listen to music rather than make music

seancorfield05:05:56

That's how I ended up with a collection of 2,000 CDs πŸ™‚

dharrigan05:05:41

That's a lot of music. Ripped so you can listen on your 'puter?

seancorfield05:05:55

No... kind of unfortunate.

dharrigan05:05:13

Plenty of opportunity now πŸ™‚

seancorfield05:05:54

The CDs were left in England when I emigrated. I only took about 100 with me and I've brought maybe another 200 over since. The rest I gave away.

seancorfield05:05:26

I have about 70GB of music now via iTunes etc.

dharrigan05:05:43

I just use spotify thesedays

rhinocratic05:05:12

Morning. Another member of the league of ex-trumpeters here. I'm sure it's just coincidence that our neighbours moved away whilst I was learning. :face_with_rolling_eyes:

seancorfield05:05:39

My trumpet teacher was a mean b*st*rd 😞

rhinocratic05:05:53

Makes one wonder why such people choose to teach. 😞

dharrigan05:05:43

I don't remember much about my old trumpet teacher, I just wasn't that into it I suppose.

rhinocratic05:05:44

I doubt that I could learn to play an instrument now unless it was electronic and I could use headphones. As a child, one doesn't care about such matters.

dharrigan05:05:19

My piano teacher, 'tho, was a right d*ck.

seancorfield05:05:24

My father had the dedication to teach himself piano, guitar, and violin. He composed music too (I have two collections of his piano pieces).

seancorfield05:05:59

He taught himself a lot about computers too. I think he could have learned to program if he felt inclined. He never ever touched a computer until he was in his 70's.

dharrigan05:05:01

never stop learning! πŸ™‚

dharrigan05:05:32

I hope I keep that spirit too!

seancorfield05:05:00

Yeah, he was like that until his death, aged 91! Quite inspiring πŸ™‚

Jakob Durstberger06:05:06

Morning and happy Friday :) 🎸 :drum_with_drumsticks:

guy08:05:21

Morning!

folcon10:05:56

Morn’

dharrigan11:05:55

Would there be a better way of writing this?

dharrigan11:05:57

(if (some #(= "source" %) fields)
    (conj (remove #(= "source" %) fields) "source-id" "source-type")
    fields))

dharrigan11:05:14

feels a bit "bitty"

Ben Hammond11:05:37

β€’ so if it had a '"source"` then you need two extra strings

dharrigan11:05:46

yes, with source removed

Ben Hammond11:05:27

(mapcat #(if (= "source %) ["source-id" "source-type"] [%]) fields)
kinda thing?

dharrigan11:05:48

let me test that out in da repl!

dharrigan11:05:21

yup, that works

dominicm11:05:00

Seems like a set is the data structure you really need.

dharrigan11:05:15

set would work fine too

dharrigan11:05:41

I need to understand why mapcat works now πŸ˜‰

Ben Hammond11:05:55

or a {"source" ["source-id" "source-type"] if you want to get all data-as-code-y

dharrigan11:05:32

so mapcat will apply the function and if it comes across "source", then of course the if (true) will fire, otherwise, it'll return the element

dharrigan11:05:57

in effect "replacing" the "source"

Ben Hammond11:05:03

well it will create lots of useless single element vectors as it goes

Ben Hammond11:05:10

which may become a problem

Ben Hammond11:05:48

those should be fairly cheap though

dharrigan11:05:08

I think i'll be okay

dharrigan11:05:17

this code isn't exercised much

dharrigan11:05:24

and the dataset is very small

alexlynham11:05:18

this ES6 destructuring has saved my bacon today

alexlynham11:05:45

was beefing cos something would be a one-liner in clj and then was like there is nested destructuring in JS wooop

rickmoynihan11:05:09

As @dominicm says you’ll get more clarity if fields is a set:

(if (fields "source")
  (-> fields
      (disj "source")
      (conj "source-id" "source-type"))
  fields)

dharrigan13:05:54

Thank you! All good information πŸ™‚

dharrigan13:05:16

What do people do to mark function as deprecated, add meta data?

rickmoynihan09:05:46

Yes, it’s widely supported as clojure has done this for a long time… see e.g. clojure.core/replicate

Ben Hammond13:05:45

what about morale?

mccraigmccraig13:05:30

well at least they haven't gone in to liquidation, there is still hope for the future

Ben Hammond13:05:01

Hmm a caramel-wafer-drink sounds quite nice though

dharrigan13:05:15

I can destroy tunnocks wafers

dharrigan13:05:37

and their snowballs

mccraigmccraig13:05:26

well now you've done it and started me thinking about treats

Ben Hammond13:05:56

oooh what's in the cupboard?

Ben Hammond13:05:15

plain chocolate kitkats?

Ben Hammond13:05:27

jelly snakes?

Ben Hammond14:05:19

waiting for jelly covids to become a thing

Ben Hammond14:05:32

its almost the ideal shape

mccraigmccraig14:05:50

sadly nothing instant... but we do have the wherewithal to make some of these https://sallysbakingaddiction.com/no-bake-chocolate-peanut-butter-bars/

Ben Hammond14:05:45

what is a Graham's cracker anyway?

Ben Hammond14:05:52

is it like a rich-tea biscuit?

mccraigmccraig14:05:48

something like that... we have some plain digestives which will probably do

mccraigmccraig14:05:33

i'm a big fan of reese's peanut butter cups

Ben Hammond14:05:45

sounds nice will you put up pictures when you've made them

Conor14:05:11

I believe the UK equivalent to a Graham cracker is a digestive biscuit, yes

Conor14:05:19

I used to be a member of the Tunnock's wafer society at St Andrews, the Scots have a proper appreciation of these things

jasonbell14:05:08

It’s a real pain that the Caramel Wafers without the chocolate (and no, coconut does not make me happy) were discontinued.

Ben Hammond15:05:31

sorry to lower the tone:

I'm trying to diagnose a `java.lang.UnsatisfiedLinkError: example.dll: Can't find dependent libraries
error on Windows What is your favourity way to get a Windows JVM to tell you what dlls it has been able to load? (my first choice would have been SystemInternals Process Explorer; but apparently I'm not allowed to use it on site(!))

Ben Hammond15:05:59

what else could I use? I was sorta hoping java/bin/jmap might help, but I don't seem to be able to work itt

dominicm15:05:14

something, something, I use arch btw

Ben Hammond15:05:47

its probably the 64bit jvm barfing on some 32bit dlls

Ben Hammond15:05:14

but discovering whic, in the absence of process explorer, is awkward

Ben Hammond15:05:36

a ctrl-break heap dump usually haas this sort of thing doesn't it

Ben Hammond16:05:11

tasklist /m /fi "PID eq 7572"

Ben Hammond16:05:15

I think is telling me what I need to know