It's unfortunate that the C++ version of the code assumes the type T is default-constructible (and that the default constructor is cheap). It also assumes that the type T is copy-constructible; at a glance I can't tell if the algorithm depends on making a copy in every place that it does make a copy. E.g. in the `heap_sort` helper we have
T k; // default-construct
if (i > 0) k = left[--i]; // copy-assign
This fairly obviously could be replaced with "copy-construct." Could it be replaced with "move-construct"? I don't know.
Again, in `partition_small`, we have
T swbuf[SMALLPART];
which default-constructs a bunch of Ts. I think we're just going to overwrite that memory in a moment anyway, so constructing all those Ts is a waste of cycles; but I'm not sure.
All of my "I don't knows" and "I'm not sures" are due to my own lack of digging into the code; I'm sure one could find out if one really looked.
None of that matters if you're just sorting `int` or the benchmarked `struct entry`. But it matters a great deal if you're taking the README literally and trying to sort "types with higher copy costs [...] (such as strings)".
...Ah, `heap_sort` is used only for trivially copyable types. So my complaint about not distinguishing copy from move is essentially unimportant (matters only in pathological cases that we shouldn't worry about).
But it's perfectly possible for a type to be "trivially copyable" without being "default-constructible." An example of such a type from the STL: `std::reference_wrapper<int>`.
Anyway, looks like a quick fix for this would be to just extend the list of traits on which blqsort is gated (currently `is_trivially_copyable` and `sizeof(T) <= 16`) by adding `is_trivially_default_constructible<T>::value` also.
The Wikipedia article on "meteor air burst" has an explanation that basically matches yours, although they do use the word "explosion" to describe it. Which makes sense to me: whatever one chooses to call it, it's a nearly instantaneous spontaneous disassembly that is very bright, very hot, and very loud.
The speed scale for disassembly is nowhere near the forward speed; you never get anywhere close to 45 degree debris divergence angle. It's also, again, not the disassembly that causes it to be bright, hot and loud. Wikipedians can also be wrong.
The meteors made only of iron alloy and/or silicate rocks do not explode, but they may fragment into many smaller bodies.
The meteors that contain great amounts of volatile substances (water, carbon compounds and sulfur compounds) may explode if the interior becomes hot enough to convert the volatiles into gases. When such a meteor rich in volatiles fragments, some of the fragments may explode, while others may reach the surface of the Earth intact.
Is it something about using Chrome? My wife's Gmail was showing the "Press / to help me write" prompt last week and we couldn't figure out (1) how to turn it off nor (2) why _I_ wasn't seeing any such prompt in _my_ Gmail, despite all our Gmail settings being the same as far as I could tell.
We both use Chrome (she on Windows, me on Mac), but I could totally believe that I've turned off some shiny AI feature _in Chrome_ that she hadn't.
Anyone care to confirm or disprove the hypothesis that there's some setting in Chrome itself that will disable this Gmail feature?
I saw the "Press /" using Thorium (a Chromium fork). Tried to use the element picker in uBlock to get rid of it. This failed, of course, because the thing to be blocked disappears as soon as the text input area loses focus, even after I deleted every event listener that I thought could have been relevant.
In a Firefox fork (Floorp) using another Google account but with the seemingly relevant part of Gmail configuration matching, I don't see "Press /" at all. Not sure why exactly, it's a somewhat interesting question but I already went poking through dev console to write a selector for it and I'm starting to get irritated at the idea of spending any more time on it, lol
An interesting idea I saw long ago in some book (I thought it was K&P's "Software Tools," or my second guess was K&R1, but neither of those panned out — a strong Mandela effect) was the clever idea of a whole-document spellchecker that works purely probabilistically, by histograms: you feed it a document, it tallies the trigraphs, and any trigraph that appears only rarely is flagged as a likely typo. This approach lets through unknown-but-realistic words like "antithematory" while flagging unrealistic words like "prisencolinensinainciusol" (because of its unlikely "ciu" and "ius" clusters) and "antthemaory" (because of "ntt" and "aor").
To make this approach work better, feed it a bunch of English text (or whatever language your document is in) before the document you really want to "spellcheck."
Essentially this isn't a spell "checker" so much as a spell "linter" — it looks for antipatterns statistically associated with bugs, and reports the patterns for further investigation.
If anyone knows where this trigraph-based "spellchecker" was first presented, I'd love to find out again.
> Likewise "Russia" is shown in Siberia, but everyone in Russia lives near the European borders thousands of km west.
Yes, and "Love's Labour's Lost" specifically pairs/ contrasts "Russians" with "Muscovites": the "Russia" of St Petersburg is pretty far west of "Moscow."
A lot of that is bias from the fact the whole map was vibed/hallucinated by an LLM instead of just sourced from (what I'm sure are many) concordances of Shakespeare's works.
For example, "The Tempest" famously mentions the "Bermoothes" (Bermuda), but that's not included in this LLM's output for some reason. Any decent subject-index of Shakespeare would include it.
Yes (I think). In this particular case I believe you could also say he was created duke (since he was the first Duke of Wellington); I think one would have to say that the second Duke of Wellington succeeded to the dukedom.
If we're listing modern games vaguely similar to this, we can't let the thread go without mentioning the fantastically entertaining (yet _mostly_ random) "Hot Streak" (2025)!
TBF, text adventures absolutely "sprinkle dopamine rewards all over the place." The random-reinforcement effect is a big part of their appeal — as a player, you never quite know if you've seen "all the good stuff" yet.
WOOD0350: Did you try using the bird on the dragon? PLAT0550: Did you try going back across the troll bridge after tricking the troll? HHGTTG: Did you CONSULT GUIDE ABOUT everything you found? Frog Fractions: Did you try SCORE? Did you try applying every verb to MYSELF?
All of my "I don't knows" and "I'm not sures" are due to my own lack of digging into the code; I'm sure one could find out if one really looked.
None of that matters if you're just sorting `int` or the benchmarked `struct entry`. But it matters a great deal if you're taking the README literally and trying to sort "types with higher copy costs [...] (such as strings)".
reply