Recent submissions

Comment · 2 months ago
Depends on how the CacheEntry is stored, it's probably stored in a slice of &[CacheEntry] which precludes storing the record data alongside it as the size of each entry must be fixed.
Comment · 2 months ago
Well, if you're already using qsort_r, what's the point of using nested functions, if you can have a context pointer with the target?

And if you're not using qsort_r, but reaching for _Thread_local, the target can be _Thread_local instead of dsq.

Comment · 4 months ago
killing a process which is using SQLite shouldn't corrupt the database, same as pulling the plug.
Comment · 4 months ago
When I first found out about bit fields in C, I was left wondering what the order of bits was in a byte, eventually I convinced myself it doesn't matter, since the byte is the smallest I/O unit, and lived with the fact that casting between bitfields and bytes was UB (or unspecified, I can't remember), and as such, was another thing I wasn't suppossed to do when writing C.

All this to say that Zig just keeps cleaning up and giving well-defined semantics to warts I learned to live with in C.

Comment · 4 months ago
(1) fails for negative numbers

(2) fails for (x % 32 in [1, 2]) due to UB

(3) fails for x == 2

(4) crashes for x == 0

(5) is the same polynomial, only factorized

(6) always returns 0

(7) is the same polynomail reordered

But this works for any value of x:

  x<2==2-x
or for something shorter:

  x<3&x>0
but that's not bery obfuscated
Comment · 6 months ago
Comment · 8 months ago
Comment · 8 months ago
Comment · 8 months ago
But the definition of economically active differs between the two: Finland includes people from ages 15-89, while in Spain you need to be 16 or older. And judging from what I read the rise in unemployment in Finland is attributed to more people entering the workforce.
Comment · 8 months ago
If you look at the solar radiation spectrum chart in the section "Why isn’t the sky violet?", you can see that sunlight is not evenly distributed along the visible spectrum--it emit more blue than red, and at sea level it's closer to evenly distributed. So the light that reaches the clouds is still mostly white light.
Comment · 8 months ago
Global aliases are a zsh feature and not avaliable in bash. So if you want:

  openssl ,v
to expand to...

  openssl --version
readline seems like the way to go.

Then again most of the examples OP gave are usually available as short options, and aliasing ,s to sudo is certainly possible. So the only one which makes sense to me is ,,=$. But it's probably not worth the trouble to my muscle memory.

Comment · 9 months ago
and risk having them interpret it as a declaration of war?
Comment · 9 months ago
Comment · 9 months ago
Comment · 10 months ago
> The books were translated years ago anyway.

Translated books lack the nuance or tone of the originals, which you would be missing out of, and most of the time you don't even realise.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton