Fork me on GitHub
#clojure-europe
<
2022-09-19
>
robert-stuttaford05:09:53

morning math nerds 😄

😁 2
Ben Sless06:09:59

Sounds like you want to shake us for lunch money

reefersleep07:09:19

watch out, robbie’s coming

robert-stuttaford05:09:09

(wow do i suddenly feel like a noob around y'all)

robert-stuttaford05:09:47

i just barely managed to pass highschool maths lol. clearly not something i needed for my programming career 😅

reefersleep07:09:28

I was shitty in school, and I’m doing fine without it in my career as well. I find it much easier to learn now, and interesting, since it’s out of my own volition.

simongray08:09:27

The kind of mathematics needed for programming isn’t really like highschool maths IMO… I don’t think it matters much.

simongray08:09:50

Unless you’re doing 3D stuff

lemontea15:09:14

math education is one of those controversial area - the only consensus is that the status quo isn’t working, but everyone has their idea for how to fix it. Not fun.

lemontea15:09:20

from an individual pov, math is like music - you need to hear different genre and find out which one fits your taste - “something for everyone” kinda scenario

slipset05:09:48

FWIW. During an interview process many years ago, they gave me a test to sort of map out my abilities. I was expecting, as a programmer to score well in logic, but as it happened, my strength was in neither math nor logic, but in natural languages.

pez05:09:47

I have no idea about your math skills, but I would have expected you to score high in logic and natural languages.

slipset06:09:43

Thank you!

robert-stuttaford06:09:38

i often wonder what the relationship between programming skill and an interest in words and wordplay is

robert-stuttaford06:09:00

i'm sure there must be something to it

robert-stuttaford06:09:09

something about how rules can be creatively applied, and enjoying finding novel and interesting ways to do so

Ben Sless06:09:44

I'm of the opinion all programmers should take a creative writing course

☝️ 1
pez06:09:46

That would be fun!

Ben Sless06:09:36

More than fun. What is programming, if not the expression of our ideas about a problem in writing?

☝️ 1
simongray07:09:48

I like both natural languages and programming, but NLP is also the domain I work in, so maybe I’m not the best example.

simongray07:09:09

One thing I’ve discovered is that most programmers also seem to know how to play an instrument.

pez07:09:33

I've also noticed that with instruments/music. I'm not one of them, though. 😃

simongray07:09:38

@pez well, get on it then!

pez07:09:35

This is my way to avoid the stereotype.

1
simongray07:09:57

@UK0810AQ2 I enjoyed Zach Tellman’s Elements of Clojure since it goes into naming things and seems to analyse code structure in general as a language/tool of communication.

robert-stuttaford07:09:05

loved EoC's naming chapter!

robert-stuttaford07:09:25

i'm sure you could learn to play a mean triangle @pez 😂

slipset06:09:04

Christine Gorman gave this talk at Javazone https://vimeo.com/748032161 where she talks about needed skills for programmers. I think it also brings up the need to untangle programming.The programming we do (her and myself) is, as she states, much more towards organizing, than what I'd imagine compiler writing and graphics would be, which I imagine are more mathy, for some definition of mathy.

slipset06:09:19

I also happened to commit a talk at Javazone https://vimeo.com/748031312

👍 2
slipset06:09:43

(humblebrag)

Gabriel Kovacs06:09:43

@slipset great talk! Do you know why only 0.5% of the candidates do/pass the assignment? I am also curios how complex is the given assignment. And lastly I would really like to hear the PostgreSQL vs. MongoDB talk 🙂. I assumed that maps and MongoDB are a match made in heaven 🙂

slipset07:09:13

Thank you! As for why we have only 0.5% pass rate, I have some hypothesis: 1. We have a messy frontend, so we need strong programmers, so our tech interview might be hard. 2. The inverse of the python paradox, ie there are a lot of Javascript “programmers” out there 3. We also ask for a home assignment, I believe that filters out quite a few as well. I have some opinions on why that is as well. 4. I think we as a company (and as an industry) tend to lump all aspects of frontend programming into one pile. With our codebase, it really makes sense to talk about the frontend of the frontend, and the backend of the frontend, where there are two very different skill-sets required. I can’t make a div centered if my life depended on it, but I can do meaningful work on the non-visible parts of the code.

slipset07:09:21

And WRT to maps and MongoDB, they’re a match made in heaven, just until the exact moment they’re not 🙂

😄 1
pez07:09:53

Morning! Today I woke up with the urge to try implement awk semantics in a Clojure library. Resisting, because I just don't have the time right now.

😄 2
Ben Sless07:09:52

hah, I had a bad idea yesterday and couldn't resist it

(defmacro |
  [& ks]
  `(s/alt ~@(interleave (map (comp keyword name) ks) ks)))

(defmacro or*
  [& ks]
  `(s/or ~@(interleave (map (comp keyword name) ks) ks)))

(defmacro &&
  [& forms]
  `(s/cat ~@(for [form forms
                  :let [t (cond
                            (keyword? form) (keyword (name form))

                            (or (coll? form)
                                (symbol? form))
                            (if-let [t (->> form
                                            meta
                                            keys
                                            (filter (fn [k] (= (namespace k) (str *ns*))))
                                            first)]
                              (keyword (name t))
                              :_)

                            :else :_)]
                  x [t form]]
              x)))

(defmacro &&* [& forms] `(s/spec (&& ~@forms)))
Usage:
(s/def ::query (&& ::find-spec ::return-map? ::with-clause? ::inputs? ::where-clauses?))
(s/def ::find-spec (&& #{:find} ^::find (| ::find-rel ::find-coll ::find-tuple ::find-scalar)))
(s/def ::return-map (| ::return-keys ::return-syms ::return-strs))

💪 1
metal 1
robert-stuttaford07:09:43

bad ideas are fun haha

pez08:09:28

Not sure how bad that idea is. My spec skills are non-existent. I'm pretty sure a library providing awk semantics would be a good idea though. 😃 Some problems are awk shaped.

lemontea15:09:23

forgot where I saw it, but it seems some ppl have further extended the already powerful awk to something totally op

lemontea15:09:09

(cue “now you have two problems” joke 😱)

pez15:09:22

I think Clojure + awk-ish semantics can get pretty OP for certain applications.

simongray08:09:24

I always wonder when is the best time to evolve my codebase into being more abstract. Sometimes you want certain parts to stay “dumb” to be able to move fast in other areas, but at some point one needs to evolve those dumb parts into smarter parts. Case in point: last week I had to implement multi-language support in the frontend. I had thought it would take ~2 days (“it’s just another set of translations + a button for switching languages, no big deal”), but it ended up taking a week. Labels tend to creep up in many different parts of the application, e.g. some are married directly to frontend components while others live inside backend data. Some constitute direct value usage, e.g. [entity :document/condition "transcribed"], where the attribute could be used directly before, but now need to be translated. These different types of language then need to be handled slightly differently. It turns out to be much more complex than one would expect to reach a fully translated interface, even if reaching 80% takes like a day.

robert-stuttaford08:09:32

classic tradeoff 🙂 faster ui dev =/= faster i18n dictionary management

robert-stuttaford08:09:49

we have 30 languages. it's a yuge timesuck

robert-stuttaford09:09:28

stuff like accessibility and responsive design also sits in this 'after the logic is how we want it' space

simongray09:09:34

yup. Although when it comes to accessibility, just sticking to built-in HTML elements rather than DYI div soup solves like 80% of those concerns AoT 🙂

simongray08:09:37

… and implementing multi-language support late in the process probably results in more hacks than doing it early.

slipset09:09:01

Here’s some code that mu colleague wrote. He called it “trivial”. I could never write it (disregarding it’s in javascript 🙂 https://github.com/chriskr/svg-wheel/blob/main/script.ts

simongray10:09:08

Very cool. I wish to some day become as capable with SVG.

borkdude09:09:10

Is this for choosing who goes first on a daily standup?

1
pez09:09:03

I think that SVG is pretty sweet code. Hiccup would make it even sweeter.

pez09:09:41

❤️ bezier curves ❤️ ^ @reefersleep😄

❤️ 1
simongray09:09:51

my local canteen just converted into a vegan place. Not a full-on vegan myself, but I love it!

🍆 1
simongray09:09:53

so much easier to eat your greens when someone else knows how to prepare them well

borkdude09:09:02

@simongray How do the meat eaters feel about that? ;)

simongray09:09:25

This is in the humanities campus of the University of Copenhagen, so I think the majority might honestly be vegetarians 😛

simongray09:09:22

I doubt anyone will be complaining anyway, the vegan canteen was already established as one of the three canteens here and was arguably the best quality one. Now they replaced all three with the vegan menu, I think to save costs.

borkdude09:09:25

We have such initiatives here as well. I personally find it lovely and I think meat eaters can have their bacon at breakfast or steak at dinner still ;)

simongray09:09:03

yes, the public sector/large organisations can play a big part in a gradual transition to more plant-based eating.

borkdude09:09:18

And I think there's also the "vegan by default, meat/dairy by request" way of doing things in some places

borkdude09:09:33

Like: do you really want milk from a mammal that was not your mother? OK... fine

simongray09:09:31

I don’t think the snark is helpful, though I agree in principle 😉

borkdude09:09:48

The snark is my interpretation of how it may come across to some people, not how they officially say it ;-). In other places you still have to pay extra for non-dairy milk

borkdude10:09:22

I was at a conference in Malmö once in 2014 and wondered if I would get any vegan options at breakfast in the hotel. When I got there, they had like 4 different types of non-dairy milk replacements or so... they were way ahead.

borkdude10:09:05

Now you see those brands in supermarkets over here

borkdude10:09:47

I recently went to a restaurant which was vegan by default and you could order meat or fish on the side if you wanted to (no snarks). It was really high quality too

simongray10:09:36

Yeah, Sweden is way ahead, and parts of Germany too. These days Copenhagen is quite good, though.

borkdude10:09:44

I gave those talks ^ in 2014 and the reagent one is still just as accurate today. It's truly a miracle how stable its design has been (compared to React itself...)

borkdude10:09:00

Back then it was about Om vs Reagent vs Quiescent vs .... - it wasn't yet clear that reagent would win, but it was by far my favorite because I could understand it ;)

borkdude10:09:46

I gave the talk to a mixed (general) dev audience and I remember getting blank stares from some JS devs. Then I learned that presenting at a Clojure conference is much more fun to me ;)

slipset10:09:41

As a carnivore, I appreciate that I should eat more vegetables, and in principle I wouldn’t mind going vegetarian/vegan. But. I need to have food that I like and I need to feel that I got a full meal. So I’d really love vegetarian/vegan recipes for the carnivore. And. There is no substitute for 4%fat milk in coffee. Period.

borkdude10:09:12

You sound like an OOP programmer that wants to try Clojure, but not really ;)

borkdude10:09:12

When moving from OOP to Clojure you find that you will have to give up on some things. You will only do that if you truly see the benefits

borkdude10:09:46

And if you see those, then finding good recipes is an almost trivial problem (the internet)

borkdude10:09:33

Here at home, we have a weekly schedule of things we cook, so we don't have to think about it anymore. We just buy the groceries from a pre-printed shopping list. If we do want to make something else, we always can, but we can fall back on the automated thing

slipset10:09:30

This might very well be true 🙂 But still. It’s stopping me from going vegetarian. I like meat too much.

borkdude10:09:55

You can flex your way into it of course, if you want

borkdude10:09:04

It's not an 100% thing for most people

slipset10:09:06

I might also need help in the sense that someone could tell me that if you try this thing for some months, you’ll start feeling full even if you only eat veggies.

borkdude10:09:17

I feel like I might be going too far when I give nutritional advice, so I will only give my experience and others may have different experiences, that is fine. My experience is that I don't feel full if you only eat vegetables. A human needs a certain amount of calories and calories don't come from tomatoes and lettuce. You need starches, legumes, nuts/seeds (as condiment) etc for calories to feel satiated. So making a rice and bean-based dish with vegetables may feel you more satiated. You also need to eat more volume than you were used to on a meat-based diet since plant foods are lower in calorie density. We usually have two plates of food instead of just one.

reefersleep06:09:49

Calories is one thing. What about the particular nutrients that you get from each food type? I'm not particularly well versed in nutrition 😅 But my girlfriend knows more about it, and she says that there are some things - idk if it's minerals, vitamins or whatever - that you'll be missing out on if you cut out meat from your diet, and don't add supplements or make an effort to find veggie foods that contain them.

reefersleep06:09:45

Regarding feeling full, I'm convinced that (for me, at least) proteins have a big role to play. I can eat whatever food and feel full as long as it has proteins. My father-in-law's protein-free vegetarian meals taste great, and I can keep eating them, because I'm never full. Afterwards, I feel like having another meal. Perhaps that's a habitual thing, though.

borkdude06:09:46

@reefersleep That's a good question. The reverse is actually true. If you switch from a standard Western diet to a whole foods plant based diet, you'll get way more minerals and vitamins. Plant foods, calorie for calorie, contain more vitamins and minerals, than meat and dairy. You just gotta watch out that you're not eating the majority of your calories from junk foods (empty calories). If you're doing a whole foods plant based diet, and eat enough calories, you'll get enough micronutrients. As for protein: I'd say, read about why some athletes have switched to a vegan diet. They're getting enough protein. The Western diet contains too much protein which can cause diseases. If you want an easy introduction into the above, there is a documentary about this called Forks Over Knives: https://www.forksoverknives.com/the-film/ They also have recipes.

reefersleep07:09:58

thanks 🙂 think I’ve got it in a watch list already!

reefersleep07:09:36

Ah, I remember a specific thing; omega 3 oil. We supplement that already because we hardly eat fish. I suppose vegetarians should be doing the same. From what I understand, it’s very important.

reefersleep07:09:15

I like the calorie for calorie thing, makes sense to me.

borkdude07:09:35

I take a vegan DHA supplement (DHA is one of the components of omega 3). You can get omega 3 from flax and chia seeds as well

borkdude07:09:57

DHA is also one of the things you get from fish, but fish get it from algae. The supplement is made from algae.

reefersleep07:09:07

skip the middle man 😄

borkdude07:09:40

There is also vitamin B12, this is main thing you need to supplement. Meat/fish contains B12 but plant foods generally do not. B12 isn't made by animals though, it's made by bacteria in the soil, which animals ingest. Our food is basically too clean nowadays to get B12 from the soil

borkdude07:09:24

It takes years to develop a B12 insufficiency because your body can store it, but it is something to be aware of long term. Some people have B12 insufficiency even while eating animal products

borkdude07:09:14

It's common to feed animals B12 in large scale "factories" because they aren't on the soil anymore either

borkdude07:09:36

So what I'm taking: B12 (three times a week), vitamin D (every day in winter) and DHA (three times a week), no other supplements

reefersleep07:09:06

I’m having omega 3 oil every morning, vitamin D every morning, and a mix of stuff morning and evening. Sounds like you’ve done your research 🙂 I haven’t! My girlfriend did, and I’m just benefitting from it 😄

reefersleep07:09:43

We probably have b12 in there, too.

borkdude07:09:32

I've been on a plant based diet for over a decade and I've done quite some reading in the beginning

🤓 1
💚 2
borkdude10:09:22

I just made a batch of rice in my InstantPot (electric pressure cooker) for lunch right now and I'll combine this with chickpeas and a salad on top.

borkdude10:09:48

There are various books from vegan athletes that might give you inspiration for satiating meals. Especially for athletes it's important to eat sufficient amount of calories.

borkdude11:09:57

@slipset http://nomeatathlete.com is one of them (just ignore all the supplement sale stuff)

borkdude11:09:07

The above might be too much focused on health. There are also some more mainstream things that just focus on taste. This is a great one: https://www.amazon.com/Veganomicon-10th-Anniversary-Ultimate-Cookbook/dp/0738218995/ref=as_li_qf_sp_asin_il_tl?tag=mind0a3-20

borkdude11:09:50

there are also some things like veganuary and "21 day vegan starter kit" you can google for that are focused on doing it for a while

borkdude11:09:40

My wife is very different from me. I'm more an all or nothing guy so I'm doing it 100% from day 1 (once I decided I wanted to do it). It took my wife several years to adapt. She suggested once to me to start with a vegetarian (not even vegan) meal once a week. I just took it a step further than her ;)

borkdude11:09:24

I respect that people are different and even if you just try and it's not for you, that's totally fine.

lread14:09:45

I tried going vegan a couple of decades ago. I was also bicycling a ton. And I kept losing weight. Got too skinny. So I added a bit of poultry to my diet. Like you @U04V15CAJ, I’m an all or nothing guy, 0 or 1. So you can imagine what happened. I could try again but this time I could first study what I actually should be eating!

borkdude14:09:36

yeah, it's a common beginner's mistake to just eat too little. you gotta be aware of the calorie content of food a little bit more

borkdude14:09:30

if you're overweight (like I was) it's actually a good feature, I have no trouble with keeping on weight naturally ;)

lread14:09:42

I was a lean mean bicycling machine. But now I’m a bit tubby. I tell my wife I have “flabs of steel”.

😅 2
lread14:09:29

Goooood Mooorning-ing-ing-ing-ing

borkdude14:09:02

Good morning to ya

robert-stuttaford15:09:20

i mean it's always morning somewhere right 😄

lemontea15:09:10

morning… whoah, so many messages - back-pressure turned on…

pez16:09:39

I've just spent an hour to get a jekyll site that I maintain to build on my machine. Now and then that happens. And every time I get reminded that I hate Ruby and should port the site over to Hugo.

seancorfield23:09:08

I sympathize! My blog used to be Octopress which is basically Jekyll and it would just randomly break and I never got the hang of bludgeoning Ruby's env/project stuff into submission so I converted it all over to Cryogen and I've been very happy with that.

🙏 1
lemontea18:09:51

ya my blog site (using github pages back then) is also in jekyll with a custom build on my local machine only… the right thing for me to do is to convert it to any modern SSG, and move the build to CI/CD. But I’m out of time, plain markdown files in a github repo will do in a pinch 😂

pez16:09:19

Ruby the language is fine. It's this bundle/gem hell that I hate.

borkdude16:09:33

I feel the urge to react to this (https://twitter.com/housecor/status/1571845648651001859) but maybe better not. Resist the Twitter algorithm

slipset18:09:35

I guess I should just roll another joint and join the discussion: Dude, it’s like your data is traveling too far, or something. Try some cohesion…

borkdude18:09:29

Dude, the further your data travels, the less type information you need to know about it...

robert-stuttaford05:09:46

i'd say that tweet is bait given his profile 🙂

borkdude16:09:16

@pez Dude, I've been there. https://blog.michielborkent.nl/migrating-octopress-to-babashka.html The project that came out of this is called https://github.com/borkdude/quickblog, feel free to use that, or Hugo ;).

borkdude16:09:54

Was it nokogiri or something like that? I don't have fond memories of getting that gem to work. Luckily I don't have to touch any ruby anywhere anymore

pez16:09:39

The particular site is simple enough I could probably get away with those 200 lines of babashka. 😃. I'll consider it. I have only myself to suit for never migrating away.

borkdude16:09:21

it's now more than 200 lines: https://github.com/borkdude/quickblog feel free to join #quickblog if you have any questions

pez16:09:34

This time it was something with ffi and M1. I ended up installing a new ruby and use that one instead of the Mac bundled one.

lemontea18:09:58

as a matter of principles, I almost always prefer a two-step process to setting up any programming language on a machine (cloud or local) - install a “language/platform version manager”, then use that manager to install a specific version

lemontea18:09:56

e.g. nvm or n -> node + npm, sdkman -> java

borkdude16:09:43

oh right, something like that happened with me on Node + m1 + sqlite too. I had to do npm config set python python3 to make it work... it beats my why this was necessary... :(

👀 1
seancorfield23:09:08

I sympathize! My blog used to be Octopress which is basically Jekyll and it would just randomly break and I never got the hang of bludgeoning Ruby's env/project stuff into submission so I converted it all over to Cryogen and I've been very happy with that.

🙏 1