At this point, I'm sure you're already familiar with the basic "hex grid" data structure: The q-axis is 0deg→︎; the r-axis is 120deg↙︎. ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌─┘ └─┬─┘ └─┬─┘ └─┬─┘ └─┬─┘ └─┬─ │ (0,0) │ (1,0) │ (2,0) │ (3,0) │ (4,0) │ ┌─┴─┐ ┌─┴─┐ ┌─┴─┐ ┌─┴─┐ ┌─┴─┐ ┌─┴─ ┌─┘ └─┬─┘ └─┬─┘ └─┬─┘ └─┬─┘ └─┬─┘ │ (0,1) │ (1,1) │ (2,1) │ (3,1) │ (4,1) │ ┌─┴─┐ …
tk.messagebox is ugly on Linux
Python's tkinter.messagebox module shows Windows native dialogs (win/tkWinDialog.c#L2950), and it shows Mac OS native dialogs (macosx/tkMacOSXDialog.c#L1399), but since Linux doesn't have any clearly defined "native" dialog system, Tkinter uses a fallback messagebox built out of Tkinter widgets (library/msgbox.tcl#L115). However, Python does not currently have any non-ugly "ttk" bindings for this (Lib/tkinter/messagebox.py#L61).
Outlook Web Access S/MIME user installation
Does not require Administrator privileges. set /p="Install this extension, then press Enter: https://microsoftedge.microsoft.com/addons/detail/gamjhjfeblghkihfjdpmbpajhlpmobbp" set /p="Download this file, then press Enter: https://res-dod.cdn.office.net/owasmime/20.21.804.1/SmimeOutlookWebChrome.msi?v=4.0800" msiexec /a %USERPROFILE%\Downloads\SmimeOutlookWebChrome.msi /qb TARGETDIR="%LOCALAPPDATA%\Microsoft\Edge" REG ADD HKCU\SOFTWARE\Microsoft\Edge\NativeMessagingHosts\com.microsoft.outlook.smime.chromenativeapp /ve /d "%LOCALAPPDATA%\Microsoft\Edge\SmimeOutlookWebChrome\native-app-host-manifest.json" set /p="Restart Edge, then press Enter."
Using "pip" behind a corporate firewall
Pip behind a corporate firewall The tldr is: Pip 23.3 or newer "just works" after you add a simple snippet to your config file. ; %AppData%\pip\pip.ini ; "${XDG_HOME-$HOME/.config}/pip/pip.ini" [global] use-feature = truststore However, said snippet will break older versions of pip. In particular, pip < 23.3, >= 22.2 will break, complaining that you need to install the "truststore" package before you can install any packages—a perfect "catch 22". As …
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 …
Rocky Linux / RHEL 9: playing DVDs on VLC
After all these years, it looks like Red Hat is still a bit scared to distribute THE NEEDFUL to play a DVD Video. After merely scooping a libdvdcss RPM from this cool guy's repository (the CentOS 8 RPM installed without issue on Rocky Linux 9), VLC instantly gained the ability to play DVDs. I could not find any other obvious source of the library for this operating system.
Rocky Linux 9 & HP Elitebook 8470p: GPU problems irreconciled
Rocky Linux 9 had poor graphical performance on my HP EliteBook 8470p laptop. On investigation, it was using the "llvmpipe" Mesa backend, because it lacked ati_drv.so (from “xf86-video-ati”,) for the AMD Radeon HD 7570M GPU; backporting[?] that package from Rocky Linux 8 then rebooting left Steam not finding r600_dri.so (though it seems to have fixed hardware acceleration for Firefox/etc.); scooping up that library from the Rocky Linux Stream 8 …
[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 …