Recent submissions

Comment · 9 months ago
Using a plug-in hybrid as an EV can and will wear out the drive battery over the lifetime of the car. It doesn't even matter if you don't intend to keep the car for very long as a rational market will price this in. The cost ($10k or more) goes a long way at the pump.
Comment · 1 year ago
Related to this, GNU's libstdc++ shared_ptr implementation actually opts not to use atomic arithmetic when it infers that the program is not using threads.
Comment · 1 year ago
Even with a 5" screen, it was bigger than for example iPhone 17 in every single dimension due to its hefty bezels (and not insignificantly so; iPhone 17 is closer in width to iPhone 13 Mini than a Dell Streak).

Screen diameter is in general a bit misleading figure for phones from different generations as "full screen" phones tend to have a taller aspect ratio and hence larger diameter even with same body dimensions.

Comment · 1 year ago
While it is true that only class types have member functions in C++, that does not mean that objects of other types demand the use of macros. C++ also supports non-member functions, and the standard library contains a fair amount of these; including `std::size` that can be used to "get" the length of an array.

(C++ arrays are different from arrays in many other programming languages, though not necessarily Rust, in that their type specifies their length, so in a way this is something you already "have" but certainly there are cases where it is convenient to "get" this information from an object.)

Comment · 2 years ago
How could you ever continue after the second statement without checking if you actually read an integer or not? How would you know what you can do with a?
Comment · 2 years ago
from_chars_result closely matches the strtol line of functions we've had for decades. Not returning the end position would be weird here!
Comment · 2 years ago
Well, obviously it doesn't have parentheses. It's not like this is the only instance where adding parentheses affects the end result.

You could write even more complex declarators (but don't have to), but that would not prove that some other syntax is inherently intuitive. Case in point, I cannot parse the Go syntax as I do not know Go.

In my experience pointers to arrays are rather uncommon and I'm not sure that I've ever written a function returning one, having even less of a need for a pointer to such. (Thus out of all these, only your first example is somewhat common in practice.)

Comment · 2 years ago
ABP was initially released almost a full decade before UBO was a thing (although I don't know if the Chrome version is related), so I wouldn't judge someone for just using it...
Comment · 2 years ago
It will eventually not matter, but I didn't suggest using a single file.
Comment · 2 years ago
Why does everything have to fit in the memory all of a sudden? Open files, there's your infinite tape.
Comment · 3 years ago
The Finnish caption is quite a bit worse than "all your base are belong to us" type of invalid grammar. Translating it back, even with best intentions (ignoring the naive attempt of translating "from" in place) it reads "Create images from AI generated words".
Comment · 3 years ago
A lot of folks write char const * (and T const& in C++), and the "rule of thumb" is to read the declaration right to left. In this case, pointer (to) const char. Works also with multiple consts or levels of indirection.
Comment · 3 years ago
Block heaters can be used to heat the engine coolant (and afterwards the cabin) with or without running the engine. I doubt any cars have special batteries for these (even a drive battery of a non-plugin hybrid is somewhat small to be useful); block heaters that don't require external electricity simply use the car's fuel in an auxiliary burner.
Comment · 3 years ago
While writing a fancy word counter I learnt that glibc iswspace (or the glibc locale data) actually does not consider non-breaking spaces as, well, spaces even when using a Unicode locale. This apparently conforms to ISO 30112. (For example MSVCRT does do so.)

I happened to notice this via a result mismatch as GNU wc does count NBSPs as word separators. Even though it uses iswspace, it also additionally checks for a hard coded set of Unicode non-breaking spaces.

(I have to say I'm a bit surprised at being at getting voted hidden here. I thought this was mostly related to the topic at hand. I would of course gladly be corrected if mistaken about the details.)

Comment · 3 years ago
This thread stinks of cabbage to high heaven. Can you actually fool even yourselves anymore? Russians have lost the war a long time ago, it's barely a nasty procession that's left.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton