Fork me on GitHub
#clojure-europe
<
2020-09-07
>
kardan04:09:17

Good morning

genRaiy08:09:10

if max returns "the greatest of the nums"

(max 42 43)
=> 43
is this a bug?

Vincent Cantin07:09:11

42 is the greatest of all. File a bug report.

slipset08:09:25

Not quite understanding if this is a joke or not, but on a related issue

user=> (Math/abs -7)
7
user=> (= (Math/abs -7) -7)
false
user=> Integer/MIN_VALUE
-2147483648
user=> (= (Math/abs Integer/MIN_VALUE) Integer/MIN_VALUE)
true
user=> WTF??
Syntax error compiling at (REPL:0:0).
Unable to resolve symbol: WTF?? in this context
user=>

otfrom08:09:48

@raymcdermott I presume you know where your towel is?

👽 6
genRaiy08:09:34

@slipset yes, it's a joke

genRaiy08:09:27

I like that (REPL:0:0)has wow! eyes

genRaiy08:09:23

Java docs for abs say "Note that if the argument is equal to the value of `Integer.MIN_VALUE`, the most negative representable `int` value, the result is that same value, which is negative."

genRaiy08:09:21

so not all Java programmers have great abs ... another joke there, cos abs is also a six pack (muscles not beer) thing

slipset08:09:10

This reminds me of another fun thing I discovered some time back

slipset08:09:47

So a comparator is basically a thing that returns positive, 0, negative

slipset08:09:24

So a trick one could use is that - is a nice comparator for numbers.

slipset08:09:25

Now, since - is a function in Clojure, and functions in Clojure implement the Comparator interface, you can (sort-by - [3 4 1 2])

slipset08:09:50

Which works great until you hit numbers that are greater than Integer/MAX_VALUE

ordnungswidrig09:09:46

@slipset what about Long/compare?

slipset09:09:40

The point was not really how to sort numbers, but the fact that the approach with - works for some numbers but not for all numbers (and you could argue that I should know that not all numbers are equal (in some sense) when it comes to programming)

genRaiy12:09:59

what is your point? 😝

genRaiy12:09:59

maybe it is this: edge cases abound

slipset13:09:13

What? I have to have a point?

😂 6
slipset13:09:14

I guess that yes, edge cases, and stuff that does the wrong thing instead of failing miserably.

genRaiy13:09:52

I much prefer stuff that does the right thing and fails miserably

🤯 3
borkdude16:09:55

I love it that this channel is really off topic since it's not called #off-topic :)

otfrom16:09:13

but then we'd be on topic

otfrom16:09:29

oh, I see what you did there

otfrom16:09:03

I hated trying to use some emacs things on windows

otfrom16:09:08

tho at least JDEE worked

otfrom16:09:24

tramp wouldn't tho for some reason to do w/a lack of pipes

borkdude16:09:26

@otfrom I've been experimenting with that too. I run emacs in WSL2

otfrom16:09:50

how has it been going?

otfrom16:09:57

do pipes work?

borkdude16:09:08

Everything works in WSL2, since it's real linux

borkdude16:09:44

I'll be giving a small presentation at wslconf.dev this week

👍 3
dominicm16:09:55

woah, crazy 😄

dominicm16:09:04

That there's a whole conf for WSL, that is.

otfrom16:09:11

has linux won? or is this just more embrace, extend, extinguish?

dominicm16:09:36

Conspiracy theory: Yeah, M$ are definitely aiming for extinguish right now.

otfrom16:09:37

I fear what github has done to remembering how we got the freedom to change the software we use

otfrom16:09:51

@dominicm they are certainly in the embrace phase

borkdude16:09:01

I think Canonical has won in that more people are using Ubuntu. I think Microsoft has won by winning over Mac people from expensive hardware to a dev setup that works equally well.

dominicm16:09:39

@otfrom You're right. 😄

dominicm16:09:52

They're trying to get Linux to transition from mailing lists to GitHub atm.

otfrom16:09:15

apparently emojified emails are the reason people won't step up to be maintainers

😂 3
otfrom16:09:24

not b/c Linus is a git

Ben Hammond16:09:40

there is value in expressing yourself clearly

Ben Hammond16:09:04

far too much time is wasted by people not telling you what they really think

Ben Hammond16:09:23

although he does seem to take this a bit too far

otfrom16:09:44

Linus has actually been abusive (more than abrasive) many times, and has at least admitted it.

otfrom16:09:54

It is possible to be honest and kind

dominicm16:09:10

Some of the rants are a little out of context. He's pretty articulate in his insults, but they were directed at people who should know better, people familiar with him.

dominicm16:09:55

I think many of them have been a bit of a boil over for him, after saying "no we won't do that" repeatedly to someone and yet still receiving patches. (I'm certain there's a counterexample to this - but it's my recollection from when I looked into it).

Ben Hammond16:09:05

there a a problem with writing that kind of thing down

Ben Hammond16:09:26

> Taken out of context is a feature of writing the written word

dominicm16:09:39

Finland is known for being public about things I guess, maybe it's a cultural thing.

Ben Hammond16:09:52

oh I thought he was Finnish

dominicm16:09:12

I think he is.

dominicm16:09:16

I don't know why I said that 😄

Ben Hammond16:09:31

known for its long dark nights

dominicm16:09:31

Hum, Finnish american.

dominicm16:09:50

Ah, I'm not totally crazy. He's a Swedo-Finnish https://en.wikipedia.org/wiki/Nils_Torvalds

dominicm16:09:16

I knew one of those from playing games online together, they considered themselves very swedish.

otfrom16:09:40

Linus has admitted he's had a problem in the past: https://lkml.org/lkml/2018/9/16/167

otfrom16:09:54

I can go digging for the people he's alienated from lkml

dominicm16:09:41

Sure, not denying that either. I just don't think there's any risk to new contributors.

dominicm16:09:04

If anything, there's more risk to them on GitHub with the poor patch practices encouraged by GitHub (long messages, no hard breaks, etc.)

otfrom16:09:09

I think github would be a bad idea

dominicm16:09:56

I thought it was because GitHub extinguished the distributed nature of Git, and then was confused that people didn't want to move over...

borkdude16:09:25

They now have a backup in the arctic, so what could go wrong?

dominicm16:09:19

after his rant, drew wrote an actually interesting article about distribution for linux dev: https://drewdevault.com/2020/09/02/Linux-development-is-profoundly-distributed.html

genRaiy18:09:25

I pay for sourcehut, don’t use it but I do pay for it