clojure-uk

A place for people in the UK, near the UK, visiting the UK, planning to visit the UK or just vaguely interested to randomly chat about things (often vi and emacs, occasionally clojure). More general the #ldnclj
jiriknesl 2020-08-14T04:02:37.457600Z

Morning

seancorfield 2020-08-14T04:03:10.457900Z

Sheesh, you're an early bird! πŸ™‚

jiriknesl 2020-08-14T04:03:46.458700Z

Normally I wake up 4:25am. But ATM I am on holidays in Greece so we already have 7am πŸ™‚

seancorfield 2020-08-14T04:04:01.459Z

(my alarm goes off at 8:45 am!)

seancorfield 2020-08-14T04:04:38.459400Z

(my alarm goes off at 8:45 am!)

jiriknesl 2020-08-14T04:05:42.460400Z

I guess you go to bed very late.

jiriknesl 2020-08-14T04:05:59.460800Z

I am absolutely dead 10:30pm every day

seancorfield 2020-08-14T04:39:00.461200Z

11 pm is an early night for me. Midnight is my preferred bed time.

seancorfield 2020-08-14T04:39:58.462100Z

Even with an 8:45 am alarm, I'm dragging my carcass out of bed and I'm useless until I've had a big, strong mug of freshly-ground dark roast coffee!

❀️ 1
jiriknesl 2020-08-14T06:18:19.463200Z

That’s why you can do so long development sessions. When I wake up 4:25am, usually at 4:26am I am already practicing italian words in Anki. I burn a lot of energy long before I start doing anything creative.

1
djm 2020-08-14T06:19:48.463700Z

πŸ‘‹

seancorfield 2020-08-14T06:21:55.464800Z

I'll be honest: I find writing code relaxing. If I wasn't a software developer by trade, I'd still write code for fun. I think it's why I've been doing OSS development for nearly 30 years now.

πŸ‘ 3
πŸ‘Œ 3
dharrigan 2020-08-14T06:43:32.465Z

Good Morning!

alexlynham 2020-08-14T08:00:31.465200Z

morning

alexlynham 2020-08-14T08:02:31.465300Z

i'm an extreme night owl, i think my natural body clock is to sleep at 1:30-2am

alexlynham 2020-08-14T08:03:58.465400Z

cycles of wakefulness are roughly 90 mins though iirc so i find there's usually a very thin window at about 10-10:30pm where my energy dips and i can sleep if i've not had caffiene in the pm, but it's uncanny... if i don't get to sleep fast, i jolt awake & i'm up til 1:30 haha

dominicm 2020-08-14T08:20:18.465600Z

Morning

dominicm 2020-08-14T08:21:42.466900Z

Long after I've been automated out of a job by no code tools and WordPress, I'll be using voice dictation to program unix utilities for fun.

2020-08-14T08:30:21.467200Z

https://www.theregister.com/2020/08/14/mozilla_google_search/ does this mean they will be rehiring?

Jakob Durstberger 2020-08-14T08:51:59.468100Z

Happy Friday! πŸ™‚ Dang, I can’t deal with being up late at all. I sleep from 22:00 - 5:30. I really prefer the mornings

dharrigan 2020-08-14T08:54:27.468900Z

With a 3 year old kid, I have no choice πŸ™‚ Today it was 4:10. Yesterday was 4:30, day before was 4:51. At this rate, he'll be getting up before he goes to bed.

Conor 2020-08-14T10:06:15.469100Z

Do they still show 'Me Too' on CBeebies really early in the morning? I remember watching that several times

dharrigan 2020-08-14T10:36:22.469300Z

only starts from 6am

dharrigan 2020-08-14T10:37:15.470400Z

and it's Something Special at that time, followed by the Twirly Woos, then Teletubbies, then Timmy, then Bing, then Hey Duggee, then Go Getters, then Peter Rabbit, then Octanauts...

dharrigan 2020-08-14T10:37:20.470600Z

I know the schedule well

πŸ˜‚ 1
2020-08-14T11:34:21.471100Z

I've not seen Riverseafingal on CBeebies for ages

2020-08-14T11:34:45.471400Z

its all Molly and Mack nowadays

2020-08-14T11:34:58.471700Z

and alot of Katie Morag

2020-08-14T11:36:04.472100Z

and the utterly insipid Topsy and Tim ugh

Conor 2020-08-14T11:41:01.472500Z

Topsy and Tim's mother is clearly popping pills to cope with them

πŸ˜‚ 1
2020-08-14T11:55:47.473100Z

Hey Duggee:ok_hand:

πŸ‘ 1
2020-08-14T12:03:30.473300Z

Morn'

minimal 2020-08-14T13:08:30.473900Z

Tinpo in 10 minutes

dharrigan 2020-08-14T14:10:58.474500Z

tbh, my favourites atm are Sarah and Duck - very trippy and JoJo and Gran Gran πŸ™‚

maleghast 2020-08-14T15:07:29.004300Z

Hey y'all I am having a Clojure-Fu and Google-Fu failure... I have a BIG lazy seq that is a seq of maps. I want to turn it into a text file representing EDN or JSON (not bothered which). How can I do this without blowing the stack - I am worried that if I turn the whole seek "real" and then into a string in order to spit it, I will have a problem. I am sure that there must be an appropriate way to stream the seq out to a textfile, but I am struggling to get Google to understand me and it keeps showing me examples for smaller data structures where the questioner cares about line breaks and so forth - I don't, I just want to persist the data in such a way as I can read it back in...

maleghast 2020-08-18T16:26:24.041200Z

Thanks all, I got it working by doing a reduce over the lazy-seq and it's supremely performant, so I am dead chuffed

maleghast 2020-08-18T16:27:21.041400Z

like this:

(reduce
     (fn [out v]
       (spit
        out
        v
        :append true)
       out)
     (io/file
      (io/resource "output/output.edn"))
     hotels-with-ids)

maleghast 2020-08-14T15:07:51.004800Z

(Can any of you tell that I have not done any real programming for "a while"?)

mccraigmccraig 2020-08-14T15:11:34.005700Z

reduce the seq onto the output-stream

☝️ 1
seancorfield 2020-08-14T15:12:30.005900Z

Output [, then each element, followed by ,, then output ], you mean?

maleghast 2020-08-14T15:25:39.006300Z

@mccraigmccraig - that sounds like what I am looking for, thx

mccraigmccraig 2020-08-14T15:27:40.006500Z

EDN is slightly easier than JSON too 'cos no separators required, but then there's JSON-lines too

maleghast 2020-08-14T15:28:08.006700Z

@mccraigmccraig EDN works for me... If you had to find an example what would you Google for..?

mccraigmccraig 2020-08-14T15:31:15.006900Z

not much of an answer, but i probably wouldn't - i tend to prefer playing in a repl to googling for potted solutions

maleghast 2020-08-14T15:36:24.007100Z

That's fair - I don't want to simply lift and shift the code, I just find that I grok things more easily if I can see how it's been done πŸ™‚

maleghast 2020-08-14T15:36:53.007300Z

Playing in the REPL is fine when I know even roughly what I am doing...

maleghast 2020-08-14T15:37:20.007500Z

....but when I have literally no clue I just find it intimidating and I don't know where to start

mccraigmccraig 2020-08-14T15:37:32.007700Z

this shows the idea

mccraigmccraig 2020-08-14T15:37:37.007900Z

(reduce (fn [out v] (.write out (prn-str v)) out) *out* [1 2 3])

maleghast 2020-08-14T15:38:54.008100Z

Ok, thanks I will start from there, this makes more sense to me.

mccraigmccraig 2020-08-14T15:40:05.008300Z

πŸ‘

maleghast 2020-08-14T15:40:06.008500Z

thank you

seancorfield 2020-08-14T16:00:14.008700Z

We do a similar trick producing a huge JSON doc as a dump of all member-related data in the database (when they do a GDPR request).

mccraigmccraig 2020-08-14T16:34:08.008900Z

yep, we do something similar to dump cassandra tables to CSV ... although we use a manifold stream rather than a lazy-seq

dominicm 2020-08-14T17:51:41.009100Z

Most of the JSON generators can do this without anything funky. Just point them at a file.

dominicm 2020-08-14T17:52:02.009300Z

Or a writer, etc