Can't install Twine on PyPy due to nh3 "Rust" problem

Quick fix, just run these commands if Twine refuses to install on PyPy on Windows due to a weird error about the nh3 package needing the non-PyPI dependency, Rust: REM on Windows pip install -v "readme-renderer < 42.0" & REM https://github.com/pypa/twine/issues/1015 pip install twine # on Mac and Linux pip install -v "readme-renderer < 42.0" # https://github.com/pypa/twine/issues/1015 pip install twine This won't pollute your registry or any other folders …

[DRAFT] Finite fields for mortal comprehension

So you've got the “natural numbers”, $\mathbb{N}=\left\{0, 1, 2, \dots\right\}$. Or the “counting numbers”, or whatever you want to call them. Addition works, and multiplication works. But subtraction is broken, because there isn't any natural number equal to $2-3$. We might think about fixing subtraction, and one way of doing this is by moving to the integers, which allows negative numbers: $\mathbb{Z}=\left\{\dots, -2, -1, 0, 1, 2, \dots\right\}$. But …

Firefox: play videos on Rocky Linux / Red Hat 9

Red Hat / Rocky Linux doesn't include patent-encumbered video codecs out of the box, so sudo dnf install \ "https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E '%rhel').noarch.rpm" \ "https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E '%rhel').noarch.rpm" \ && \ sudo dnf install ffmpeg I didn't even need to restart Firefox afterwards; it just all seemed to start working immediately

Rocky Linux 9 & HP Elitebook 8470p: Wi-Fi problems reconciled

Annoyingly, the Rocky 9 installer ISO didn't come with the Wi-Fi drivers for my HP Elitebook 8470p. The laptop seems to have a “Intel Corporation Centrino Ultimate-N 6300 (rev 3e)” PCIe Wi-Fi adapter, which worked fine out-of-the-box on Ubuntu and every other distro I tried on it, but not this one. I diagnosed this via dmesg: [ 108.888963] Intel(R) Wireless WiFi driver for Linux [ 108.889046] iwlwifi 0000:25:00.0: enabling …

[DRAFT] Transcript: Babylon Bee congress testimony March 28 2023

(Personally, I think TBB is dead wrong here, and their opinion is actually dangerous. I’m unconvinced that UGC-centric websites should or even CAN be regulated like a utility. Dillon’s redactive quoting of §230 in the closing remark belies bad faith. I’m leaving this post tagged as “draft” because I haven't properly expressed my thoughts here, but I am archiving Dillon’s statement in full because I had a seriously hard …

[DRAFT] Bijection between strings and positive integers

It’s probably the case that all math is trivial. So the statement that “[some particular mathematical result] is trivial” would, then, be trivially true — and useless! It might be better to say that “all math is trivial — if you have the intuition for it”. And this problem was not at all trivial (for me) to figure out, however inevitable and even obvious it looks (to me) in …

Bijection between sets and multisets

To take a multiset and reversibly transform it into a set of the same cardinality … start with the multiset's smallest element, add 0 to it; then go to the next element (which might be a duplicate), and add 1 to it (which will guarantee it's no longer a duplicate); then go to the next element (which might still be a duplicate of the first), and add 2 to it (which will guarantee it's no longer a duplicate of the first or second elements), and so on. After this transformation is applied, you'll have a set with no duplicates, from a k−1-elements-larger universe, that can easily be transformed back by just subtracting instead of adding!

Python has no(?) multiset

I saw an online resource that claimed “The collections.Counter class in the Python standard library implements a multiset (or bag) type that allows elements in the set to have more than one occurrence.” However, (and despite the fact that he is quoting comments in the CPython source code,) this is misleading. While the collections.Counter class does allow you to have more than 1 occurrence of elements in a set, …

the real frozendict was the standard library we neglected along the way

If you need a quick immutable representation of dictionaries, but can't be bothered with a 3rd-party library, why not try frozenset(dict_items)? It is immutable. It is in the standard library. It is unordered, so you're guaranteed that frozenset([('a', 1), ('b', 2)]) == frozenset([('b', 2), ('a', 1)]). And it is the case that, for dictionaries with all immutable values (which is implied by the problem statement anyway), dict(frozenset(d.items())) == d. …

IA5string definition

From ITU-T Rec. X.680 (02/21): C.5.7 IA5String [is] mapped into UniversalString by mapping each character into the UniversalString character that has the identical (32-bit) value in the BER encoding of UniversalString as the (8-bit) value of the BER encoding of IA5String[.] 41.6 The characters which can appear in the UniversalString type are any of the characters allowed by ISO/IEC 10646 [aka Unicode]. 43.8 For IA5String, [the] entire character set …