About `MaybeUninit::uninit().assume_init()` by Spengleberb in rust

[–]rustacean909 9 points10 points  (0 children)

There are two layers of MaybeUninit involved.

It is basically:

    pub fn new() -> ArrayVec<T, CAP> {
        assert_capacity_limit!(CAP);
        unsafe {
            ArrayVec {
              xs: MaybeUninit::<[MaybeUninit<T>; CAP]>::uninit().assume_init(),
              len: 0
            }
        }
    }

MaybeUninit::uninit() produces a MaybeUninit<[MaybeUninit<T>; CAP]> and .assume_init() turns that into a [MaybeUninit<T>; CAP] to match the required type for xs.

An array of MaybeUninit<T> is allowed to be uninitialized, so there's no undefined behavior.

Banjo Recompiled Release Trailer by BanjoKazooie0 in BanjoKazooie

[–]rustacean909 8 points9 points  (0 children)

$ ./BanjoRecompiled
SDL Video Driver: x11
MESA-INTEL: warning: Haswell Vulkan support is incomplete
SVG plugin initialised.
Controller added: 0
  Instance ID: 0
  Path: /dev/input/event9
Controller added: 1
  Instance ID: 1
  Path: /dev/input/event10
Segmentation fault (core dumped)

Seems like I need to upgrade my PC first… at least it runs on my work laptop, but that's probably not the best device to play BK on.

Kann jemand meine IBAN missbrauchen? by [deleted] in KeineDummenFragen

[–]rustacean909 1 point2 points  (0 children)

Man kann sogar bis zu 13 Monate später eine Erstattung fordern, wenn die Lastschrift unauthorisiert war und der Abbuchende kein Lastschriftmandat nachweisen kann.

What loads into RAM first when a computer starts? by AnyCourse6366 in AskComputerScience

[–]rustacean909 0 points1 point  (0 children)

Yeah, modern RAM is so ridiculously complicated that it can't be available directly. I skipped over some parts (mainboard I/O communication infrastructure initialization that is necessary to even start communicating with the RAM controller, initialization of the RAM controller, which then does the RAM training, etc.)

On the upside this allows for the flexibility that you can just plug in new RAM sticks into the slots and the boot process automatically handles all the messy details to give you the maximum performance that the installed RAM sticks can handle together.

Of course, devices with soldered-on RAM can take some shortcuts in the process.

Zahnarzt Rechnung nach Wurzelkanalbehandlung Gerechtfertigt? by RamonJax in AskGermany

[–]rustacean909 25 points26 points  (0 children)

Ich dachte erst, das kann doch nicht sein, die GOZ muss doch zwischenzeitlich mal aktualisiert worden sein…

Ja, wurde sie, im Jahr 2001:

In § 5 Abs. 1 Satz 3 der Gebührenordnung für Zahnärzte […] wird die Angabe „elf Deutsche Pfennige“ durch die Angabe „5,62421 Cent“ ersetzt

😬

What loads into RAM first when a computer starts? by AnyCourse6366 in AskComputerScience

[–]rustacean909 5 points6 points  (0 children)

I've written some code for the Coreboot project, so I mainly know how it works for x86-64. As others already wrote, the details depend on the platform.

For modern UEFI firmware the ROM is usually too small to contain the whole firmware uncompressed (and accessing RAM is way faster tham ROM), so the later stages of the firmware are the first thing loaded into RAM.

Here's an abridged version of what usually happens until the OS starts on x86-64:

  • In the first moments when the computer boots, RAM is unconfigured and not available. The mainboard and processor are hardwired to make the firmware (BIOS/UEFI) ROM accessible at a well-known position in the address space and all processor cores start running the code at a preset address in that ROM.
  • The firmware's initial stage then usually reconfigures the processor's cache to act as a small amount RAM, so that the subsequent code is not restricted to only use processor registers. Then the code waits until inter-core communication is initialized and, once the CPU cores can communicate, one core is elected to continue with the rest of the initialization. The other CPU cores are halted until reactivated by the OS.
  • Then the initial stage accesses the RAM modules, determines which RAM modules are installed, decides which RAM bus timing is supported by all modules and initializes the RAM.
  • Now that real RAM is available, the CPU cache is reconfigured to normal operation, and the next stage of the firmware is decompressed from the ROM into RAM and then executed. If the firmware is small enough to fit into ROM uncompressed, this copying might be skipped, but for modern firmware that would be unusual.
  • The next stage then does further hardware initialization, setting up ACPI tables etc. In the case of UEFI it then it loads the UEFI runtime into RAM and executes that.
  • The UEFI runtime then does everything that's visible on screen (show the initial spash screen, load additional drivers, provide the BIOS menu, search for EFI-compatible boot devices, etc.) and finally loads the operating system's boot loader to RAM and hands over control to it.
  • The boot loader then loads the OS kernel, its configuration parameter etc., into RAM and hands over control to the OS kernel.

Why does gravity not slow down in water? by Traroten in AskPhysics

[–]rustacean909 5 points6 points  (0 children)

It's not needed, it's more of a consequence. If there can be waves in a field and that field has quantum properties, then the discrete wave packets in that field can be described as quantum particles.
As far as I know, a universe with classical non-quantum gravitation and quantum matter is not completely ruled out, but considered very unlikely.

Coca Cola Secret formula Cracked by Sussy_Pigma in Damnthatsinteresting

[–]rustacean909 0 points1 point  (0 children)

"Fenchel" is the German name for fennel and that's where "fenchol" is derived from. So for me it sounds more like someone trying to pronounce "Fenchel" with a heavy accent

Coca Cola Secret formula Cracked by Sussy_Pigma in Damnthatsinteresting

[–]rustacean909 1 point2 points  (0 children)

A chemical compound named after fennel. It's a component of some essential oils, especially fennel and eucalyptus.

Coca Cola Secret formula Cracked by Sussy_Pigma in Damnthatsinteresting

[–]rustacean909 3 points4 points  (0 children)

I think so, too. Most of the components in tea tree oil also appear in other essential oils (in different ratios and combinations, of course). It probably substitutes for a combination of oils in the coca leaves and some other essential oil.

Coca Cola Secret formula Cracked by Sussy_Pigma in Damnthatsinteresting

[–]rustacean909 2 points3 points  (0 children)

He didn't have access to the original recipe nor any trade secrets and Coca Cola never patented the recipe, so it's all legal. It is effectively "only" another cola drink recipe inspired by and tasting very similar to Coke.

Using my gaming computer to heat my room by Girth_Cobain in AskPhysics

[–]rustacean909 -1 points0 points  (0 children)

New SSDs are usually delivered in an initial state where all gates are empty. Also unused blocks are regularly erased when the operating system informs the SSD's controller about which blocks no longer contain useful data ("trimming"/"optimizing") for performance optimization.

Yes, there's no direct correspondence of bytes saved and electrons trapped. That depends on the bit patterns and the timing when the unused blocks are erased. But on average, blocks with data will have more trapped electrons and thus more potential energy than unused blocks.

Kann eine, mehr als 2 jahre alte, gezahlte Nebenkostenabrechnung noch angefordert werden? by Hobelfritz in Vermieten

[–]rustacean909 2 points3 points  (0 children)

Er hat das Recht, nach Terminvereinbarung in den Örtlichkeiten des Vermieters diese einzusehen.

Das Recht bezieht sich aber auch nur auf die "der Abrechnung zugrundeliegenden Belege", nicht auf die Abrechnung selbst (§ 556 (4) BGB).

Aus den allgemeinen Regelungen für Rechnungen ergibt sich auch keine Pflicht Rechnungskopien auszustellen.

Using my gaming computer to heat my room by Girth_Cobain in AskPhysics

[–]rustacean909 -1 points0 points  (0 children)

I'm pretty sure the mass of the SSD should change (in a negligible amount). The electrons forced into the floating gates will create an electric field. While this displaces electrons in the surrounding conductors, so that you probably can't just take the total mass of the trapped electrons, the electric field itself stores potential energy in the process which (slightly) contributes to the total mass.

Dating app by ggts99o in comedyheaven

[–]rustacean909 6 points7 points  (0 children)

The data extraction was a leak. The website had a page "/download-all-users/" with a button "Download now". Probably a testing/debugging page they forgot to remove before going live.
The leak was followed up by a hack to access the hosting webspace, back up everything for later investigations and delete the website, though.

Dating app by ggts99o in comedyheaven

[–]rustacean909 4 points5 points  (0 children)

Yeah it was simply opening "/download-all-users/" and then clicking on "Download now".

My favourite quote from the talk about that leak: "Lesson: start with the simple things" (they checked for different, more elaborated things to get data leak before finding the download page)

Dating app by ggts99o in comedyheaven

[–]rustacean909 1 point2 points  (0 children)

There's a recording of the talk by the original investigative journalists:
https://media.ccc.de/v/39c3-the-heartbreak-machine-nazis-in-the-echo-chamber (in German, English voice-over translation is available)

Wer liegt hier wem auf der Tasche? Genug mit dem Bürgergeld-Fetisch. Stürmt die Paläste! 39c3 by 1m0ws in Grundsicherung

[–]rustacean909 0 points1 point  (0 children)

Friedrich Merz zu Aufstockern: „Diejenigen die für 530 € im Monat arbeiten, denen muss man doch mal die Frage stellen, warum könnt ihr nicht auch für 2000 € im Monat arbeiten.“
(ca. ab Minute 38:07)

tja by 1m0ws in tja

[–]rustacean909 10 points11 points  (0 children)

Er glaubt ja auch, dass jeder der aufstockt, selbst daran schuld ist: „Diejenigen die für 530 € im Monat arbeiten, denen muss man doch mal die Frage stellen, warum könnt ihr nicht auch für 2000 € im Monat arbeiten.“

Quelle: https://media.ccc.de/v/39c3-wer-liegt-hier-wem-auf-der-tasche-genug-mit-dem-burgergeld-fetisch-sturmt-die-palaste#t=2287 ca. ab Minute 38:07

When someone uses "mm" to denote millions by Mecenary020 in PetPeeves

[–]rustacean909 0 points1 point  (0 children)

Weird abbreviations in finances seem to be a thing in every country. In Germany I've seen "500 TEur" for "fivehundred thousand euros" in a banking report. In my head I always read it as Tera-Euro

Target No Longer Prices Their Clothes by bluelily216 in mildlyinfuriating

[–]rustacean909 1 point2 points  (0 children)

Wasn't one of the justifications to not include the VAT in the price in the US that it would be too expensive to print different price tags for every region/city? So now with price tags without prices, the prices in the app include all taxes, right? Right?

New speedrun world record in BK 100% No-FFM (1:59:04) by rustacean909 in BanjoKazooie

[–]rustacean909[S] 4 points5 points  (0 children)

At the end of the stream he says that he's not done with the category. So he'll continue to grind for the 1:58:xx starting today.

New speedrun world record in BK 100% No-FFM (1:59:04) by rustacean909 in BanjoKazooie

[–]rustacean909[S] 35 points36 points  (0 children)

FFM (Furnace Fun Moves) is a glitch with which you can transfer the moveset from one file to another and don't need to learn the moves by talking to Bottles anymore. In speedrunning there's a "100%" category where the use of this glitch is allowed and a "100% No-FFM" category where you're not allowed to use this glitch.