news
Programming Leftovers
-
Juha-Matti Santala ☛ Advent of Code tips for beginners - through an example
Advent of Code is right around the corner for the 12th year and it’s time to talk about it again. In short, Advent of Code is an annual Christmas calendar of daily programming puzzles. Each day, you get a puzzle and an input: to solve, you need to write code that solves the problem and submit a numeric result to the website to check if you got it right. Once you solve the first puzzle, a second one is revealed.
-
Codeberg ☛ #7 - Investigations and post-mortems
At around 12:05 CET our domain reappeared in the NameSilo interface and became technically active again. Only at 14:30 CET, we received a response from the abuse department of NameSilo, explaining the client hold with two abuse cases.
The first case was a project that was reported to us in 2022, for which we dispute the abuse case. The repository in question had already been archived without further activity since 2023.
The second abuse case indeed contained malware and belonged to an account created on November 16, but which had not been reported to Codeberg via our abuse email address or in any other way. Instead, it appears that the person reported the abuse directly to our domain registrar, who then acted without informing us.
-
Andrew Nesbitt ☛ This Week in Source Control: 25 November 2026
Codeberg posted a post-mortem of the 18 November domain suspension covered last week. NameSilo had placed codeberg.org on client hold over two abuse cases without contacting Codeberg. One was a 2022 report that Codeberg disputes, about a repository archived since 2023. The other was malware in an account created on 16 November, reported only to the registrar, not to Codeberg’s abuse address.
Codeberg removed both repositories and is evaluating offers from other registrars. It moved its nameservers from NameSilo to deSEC in July. A switch to its spare codeberg.eu domain would affect two-factor authentication and every existing Git remote, and Codeberg is working with Forgejo on multi-domain support.
-
Robert Smith ☛ A faster algorithm for extracting hexadecimal digits of π
This post introduces a new algorithm for extracting hexadecimal digits of \(\pi\) without computing the preceding digits. It beats the standard term-by-term evaluations of Bailey–Borwein–Plouffe (BBP), Bellard, and Huvent on operation count. Even against Huvent’s eight-term formula, the savings are about 61% fewer divisions and 38% fewer full modular exponentiations.
-
R / R-Script
-
Stats and R ☛ Permutation tests in R: let your data build its own null distribution
Every R user meets the same small anxiety early on. You have two groups, you want to know whether they really differ, and the t-test relies on a normal-model reference distribution for small-sample inference. With 200 observations per group, that approximation is often robust. With 10 plants, it deserves scrutiny: a normality test on 10 points has little power to rule out departures, and the central limit theorem is no automatic guarantee.
Permutation tests avoid a normal reference distribution, but they do not remove the need for assumptions. They were worked out in the 1930s, in the early days of modern statistics (Fisher’s The Design of Experiments appeared in 1935), and the idea is disarmingly simple: if the treatment did nothing, then the group labels are arbitrary, and shuffling them changes nothing that matters.
-
Survivor Stats DB: the companion site to {survivoR}
The {survivoR} package has been the go-to home for Survivor data in R. It has 5 versions, 76 seasons, 1,198 castaways, and 21 datasets covering everything from vote history to confessional counts. But to get at all that, you’ve needed to fire up R, load the package, and do the wrangling yourself.
But if you just want quick stats you can head to the Survivor Stats DB — the companion site to {survivoR}. When {survivoR} is updated, Survivor Stats DB is updated. It’s had a massive overhaul and there are now more stats and they’re easier to explore.
-
-
Python
-
Ned Batchelder ☛ Human sorting, hardened
But this one intrigued me: if a file name includes a numeric component with 4301 digits, then the human sorting function fails. Buh?
Before we get to the current problem, here’s the original “buggy” code, slightly simplified: [...]
-