Hans Ulrich Niedermann

@ndim@bawue.social
32 Followers
285 Following
45 Posts
Miscellaneous things in English and German.
websitehttps://n-dimensional.de/
githubhttps://github.com/ndim/
Digitale Souveränität bedeutet Kontrolle über eigene Daten, Infrastruktur und Systeme. Solange Europa auf #US-Clouds und chinesische Hardware angewiesen ist, bleibt das eine Illusion – und ein Sicherheitsrisiko. #DigitaleSouveränität #Europa

I'm looking for a good book that treats high-dimensional geometry. I am in particular looking for something on the geometry of high-dimensional polytopes.

Any recommendations? Please retoot for reach.

Cyberattack hits Ukrainian state railway, disrupting online ticket sales

Ukrzaliznytsia, Ukraine's state-owned railway operator, said a large-scale cyberattack had disrupted online ticket sales, but not train schedules.

Pi day is propoganda for MM/DD/YYYY sickos

Here is a template. If you follow this template for your binary file format's magic number, you will be doing it better than a depressingly large number of senior software engineers.

First eight bytes of the file:

0xDC 0xDF X X x x (0x01 0x00 | 0x00 0x01)

0xDC 0xDF are bytes with the high bit set. Together with the next two bytes, they form a four-byte sequence that cannot appear in any valid ASCII, UTF-8, Corrected UTF-8, or UTF-16 (regardless of endianness) text document. This is not a perfectly bulletproof declaration that the file does not contain text, but it should be strong enough except maybe for formats like PDF that can't decide if they're structured text or binary.

X X x x: Four ASCII alphanumeric characters naming your file format. Make them clearly related to your recommended file name extension. I'm giving you four characters because we're running out of three-letter acronyms. If you don't need four characters, pad at the end with 0x1A (aka ^Z).

The first two of these (the uppercase Xes) must not have their high bits set, lest the "this is not text" declaration be weakened. For the other two (lowercase xes), use of ASCII alphanumerics is just a strong recommendation.

0x01 0x00 or 0x00 0x01: This is to be understood as a 16-bit unsigned integer in your choice of little- or big-endian order. It serves three functions. In descending order of importance:

  • It includes a zero byte, reinforcing the declaration that this is not a text file.

  • It demonstrates which byte ordering will be used throughout the file. It does not matter which order you choose, but you need to consciously choose either big- or little-endian and then use that byte order consistently throughout the file. Yes, I have seen cases where people didn't do that.

  • It's an escape hatch. If one day you discover that you need to alter the structure of the rest of the file in a totally incompatible way, and yet it is still meaningfully the same format, so you don't want to change the name characters, you can change the 0x01 to 0x02. We both hope that day will never come, but we both know it might.

  • Programming horror stories:

    Today I was working on some code that was doing hash-set operations in Python. Fairly normal stuff, unpickling, collecting and merging sets of keys to get the unique ones. The keys in this case are three-tuples of floats. I know, I know, hashing on floats is a bad idea (and I told them so myself) but we are where we are.

    It was taking many hours to build the set of unique keys. The dataset is large but it's not that large, so I attached GDB to it and had a look around, poked at the CPython set code, made some educated guesses and eventually had my code print out the individual keys and their hashes.

    It turns out that (nan, None, None) was a super common key in this data. So of course each one of those tuples would hash to the same value, but since nan != nan, they would not count as the same object, creating endless hash collisions as Python built up a million identical-but-not tuples and had to check each and every one for equality every time another one was inserted into the set.

    Who knew that it's possible to boot straight into UEFI setup by just running "systemctl reboot --firmware-setup"? 🤯

    It makes all those times I was mashing F12, as soon as the computer started booting, utterly pointless — especially after getting Linux installed.

    Well, at least I know about it now.

    #Linux #SysAdmin #Hardware

    Früher war das Internet eine beliebte Möglichkeit, um temporär der harten Realität entfliehen zu können.

    Heute ist die Realität eine beliebte Möglichkeit, um temporär dem Internet entfliehen zu können.

    I appreciate how things like testing, security, observability, or operations are all expected to get better if they are considered earlier (and more continuously) into the development cycle.

    There's however an obvious tension in that "doing all the things all the time as early as possible" also doesn't work, but I don't necessarily hear much about figuring out how to find a well-balanced operating point for these concerns.