News for hackers. Stuff that matters.

eMSF

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.
Re:A safe, non-owning C++ pointer class on Sunday September 28, 2025 @05:31PM (#45408234)
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.
Re:iPhone Air on Tuesday September 09, 2025 @07:56PM (#45191218)
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.

Re:A Rust Shaped Hole on Thursday July 17, 2025 @05:46AM (#44591496)
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.)

Re:The C23 edition of Modern C is now available for free on Tuesday October 15, 2024 @05:40PM (#41853403)
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?
from_chars_result closely matches the strtol line of functions we've had for decades. Not returning the end position would be weird here!
Re:Lesser known tricks, quirks and features of C on Friday September 27, 2024 @05:08AM (#41667932)
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.)

Re:Google pulls the plug on uBlock Origin on Thursday August 15, 2024 @03:45AM (#41253886)
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...
Re:Is C99 actually Turing-complete? (2016) on Thursday August 01, 2024 @03:12PM (#41132509)
It will eventually not matter, but I didn't suggest using a single file.
Re:Is C99 actually Turing-complete? (2016) on Thursday August 01, 2024 @02:58PM (#41132350)
Why does everything have to fit in the memory all of a sudden? Open files, there's your infinite tape.
Re:DALL-E 3 is now publicly available inside Bing on Sunday October 01, 2023 @11:44AM (#37726984)
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".
Re:Just how constexpr is C++20’s std:string? on Friday September 08, 2023 @08:36PM (#37441036)
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.
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.
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.

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.
Re:New C features in GCC 13 on Thursday May 04, 2023 @11:30AM (#35817002)
The type of the expression 'x' is int, not char (in C). The type of an expression consisting of a variable name is the type of the variable (as far as sizeof is concerned).
Re:The Difference Between European and American Butter on Saturday April 29, 2023 @02:59PM (#35755949)
The 2000 kcal reference (which I assume you're referring to) isn't for "an average man", but for an average person. For an average man, the reference value would be somewhere between 2.5k to 3k.
>They are demonstrably and objectively not “fine”

Aka "my opinions are the objective viewpoint".

>They are the primary destructive force in society

Hyperbolic nonsense.

Today's mobile society with cars is better than anything else that has ever existed.

That may have been the case sometime between the World Wars, but the only reason you'd do that these days is if you particularly enjoy visiting the shop.

Modern oils can easily last 20000 km (if you'd want, you could only change the oil every other time you change the filter) barring particularly harsh conditions or poor and obsolete engine design. Also, lots of driving (as in typically longer trips) means the oil lasts better.

Oil changes are a common nuisance only if you make them one.

Re:Finding Nice MD5s Using Rust on Sunday January 15, 2023 @07:30PM (#34395269)
A local community had a rather similar programming challenge years ago (although it was limited to digits-only/letters-only and pi-digits categories).

I revisited the challenge some years later, and managed to achieve a little over 200 MH/s per core on a 2013 CPU. I'd expect (or at least hope) for modern very high-end CPUs to reach somewhere between 5000-10000 MH/s when using all cores, using a similar decently optimized solution. (The thing you want to optimize is the hashing part.) A high-end GPU from 2016 should manage at least 10000 MH/s and more modern ones are likely to be several times faster.

Re:Winter & Cold Weather EV Range Loss in 7,000 Cars on Sunday December 18, 2022 @05:09PM (#34044138)
Fuel-type block heaters heat the cabin as well (they turn on ventilation once the coolant has warmed enough). Electric heaters are meant to be used with a cabin heater that uses the same external power source.
Re:London's Ultra Low Emission Zone to cover entire city on Sunday November 27, 2022 @04:29PM (#33767191)
You only have one life. If you want to spend it using public transport, going through places you aren't visiting and stopping at stops you are not leaving at, then go right ahead (by the way, these are the main reasons why using public transport is slower almost everywhere). I'd rather spend that time doing something I enjoy.
Re:Mildly Interesting Quirks of C on Sunday November 20, 2022 @09:54PM (#33688141)
Wonder no more: at least clang does, since around v3.5. https://godbolt.org/z/jEq5xbMna
Re:The stick shift might survive the electric revolution on Friday November 18, 2022 @08:59PM (#33665927)
From what I have seen, VAG DCT models tend to be invariably less efficient than their MT counterparts (and I don't know why ZF-8 would be more efficient than a DCT).
Re:Hard Reset Or, How Not to Drive Your Company Off a Cliff on Saturday November 12, 2022 @08:08PM (#33578916)
Agreed. I can't even tell if the circle is the worst thing, but it doesn't behave like a cursor as it moves off the screen while scrolling, but jumps back (with visual noise) when the mouse if moved even 1px. Anyway, this grabbed my focus and I did not finish reading the article.
Re:My Fanless OpenBSD Desktop (2021) on Friday October 28, 2022 @08:16AM (#33370440)
You'd gave to be quite lucky to buy a high-power GPU like that which, under load, wouldn't have coil whine significantly louder than quiet case fans. (GPU fans usually aren't that quiet even at lowest operating speeds but these days 0rpm modes on low loads are pretty much a standard feature.)
Re:My Fanless OpenBSD Desktop (2021) on Friday October 28, 2022 @08:02AM (#33370315)
PCs usually aren't completely silent under load anyway (at least none that I've owned). No fan is silent at nominal voltage (and unmodulated) but when slowed down to a low enough RPM they can easily be less audible than GPU coils, many monitors, powered on speakers, room lighting, ... (and "more silent" than a powerful PC's static parts under load).
I can't believe physical exhaustion is not at least as important a part in this. Personally, I skip a night's sleep every now and then to readjust my sleeping patterns, and I've never experienced anything strange after something like 32-36 hours without sleep (but note: no significant physical exertion involved).

It doesn't even feel that bad once you get past the slump in the 20-24 h region.

Not as much as you'd think. While someone may always have wind or sun, at times that someone is unfeasibly far from Northern Europe. (Low wind conditions in all of Nordics, and to some extent even all over Europe are quite possible.)

PV produces absolutely nothing when electricity is most used and absolutely necessary (midwinter).

Hydro capacity in Finland is at its maximum potential and even now cannot make up for times when wind is producing close to nothing.

Also, all these workarounds cost money -- some of them, lots of it. For TVO, Olkiluoto 3 costs roughly 5B euros for 1.6GW of nuclear.

It only seems bonkers to you because you're so wildly off the mark. Finland currently has over 4GW of installed wind power capacity, but there have been not just hours but entire days where wind power production has been less than one hundredth of that -- last Thursday's problems were aggravated by such a situation. 9GW of installed capacity will absolutely not guarantee 1GW at all times -- not even close.

Older »