news
Programming Leftovers
-
Rlang ☛ Test & Roll: Why Smaller A/B Tests Can Make More Money
A classic A/B setup has two stages:
1. Test stage: expose n1 users to treatment A and n2 users to treatment B.
2. Roll stage: deploy the winner to the remaining N - n1 - n2 users.Bigger tests improve certainty, but they also create opportunity cost: more users in test means more users potentially seeing the weaker treatment before rollout.
-
Alperen Keles ☛ What is a property?
When talking about Property-Based Testing, we typically talk in very abstract terms. There are properties, which define the correctness; there are generators, which define the domain; the PBT framework gives us APIs for writing property-based tests that combine the properties with the generators to find bugs. It's all very nice and simple.
A (surprisingly) large chunk of my time goes into exploring different PBT frameworks, many times porting an existing PBT workload to use a new one instead of the other. This requires me to build abstractions on what a PBT framework is, which should have been very easy if the simple definition I gave in the first paragraph captured what PBT is. Unfortunately it doesn't, so let's see what the issue is. A property is a universally quantified computation that must hold for all possible inputs. The simplest model of a property in a programming language is a function that returns a boolean, such as the one below: [...]
-
[Old] Lewis Campbell ☛ Basic Type System Terminology
Static typing means types are checked statically. Static type systems use the programs source code as a static asset to perform type checking, without executing said code. Typically - but not always - the environment will prevent code that fails these static checks from running.
Dynamic typing means types are checked on demand, at execution or run time. Each value in the language has a type value associated with it that exists at runtime.
Note that dynamically typed is wholly distinct from un-typed, which is a term used to describe the complete absence of type checking, either statically or dynamically.
-
Jamie Tanna ☛ How to build a `git diff` driver
Something I've been meaning to write about since November 2024 is how to create an external command for diffing between files with git diff.
I found that while I was implementing renovate-packagedata-diff that there seemed to be a lack of documentation around how to do it, so it would be worthwhile me blogging about it.
-
Eno Such ☛ Brocards for vulnerability triage
I spend some of my hobby time doing vulnerability triage on open source projects. As part of that, I see (and filter through) a lot of nonsense.
Nonsense is not unique to vulnerability triage: lawyers deal with it too. To cope with it in the legal world, they use brocards — concise aphorisms that capture the essence of a legal principle. Any given brocard is not universally true2, but provides a standard by which a claim can quickly be evaluated for legitimacy.
Vulnerability triage has its own brocards, but I couldn’t find a comprehensive list of them anywhere. This is my attempt to compile such a list.
-
Perl / Raku
-
Eli Billauer ☛ Perl one-liner for adding newlines to HTML
So this simple one-liner does the job: [...]
-
-
Python
-
Ned Batchelder ☛ Linklint
Linklint is a Sphinx extension that suppresses these two kinds of links during the build process. It examines the doctree (the abstract syntax tree of the documentation) and finds and modifies references matching our criteria for excessiveness. It’s running now in the CPython documentation, where it suppressed 3612 links. Nice.
-
-
Java/Golang
-
Redowan Delowar ☛ Error translation in Go services
In a layered Go service, it’s easy to accidentally leak storage errors like sql.ErrNoRows all the way up to the handler, or worse, to the client. This post shows how to catch those at the service boundary, translate them into domain errors, and keep internal details from reaching places they shouldn’t.
-
-
Standards/Consortia
-
Matthias Zöchling ☛ Unicode Variation Selectors
While I knew that Unicode has Variation Selectors (VS), I had no idea that CSS has a font-variant-emoji property. So it was time to connect the dots.
-