The Tools
How the tools work, why they refuse to guess, and what runs on your device.
The first digit of an HTTP status tells you whose problem it is. The pairs that get confused — 401 against 403, 301 against 302 — are where the debugging time goes.
A diff is supposed to find the smallest set of changes between two texts. Line endings, trailing spaces and one inserted line are the three things that bury the real one.
The same string needs three different treatments in a path, a query value and a form body. Here is one string escaped all three ways, with the reasoning.
Why the four characters that break markup have to be escaped before user text reaches a page, and why escaping for text and for an attribute are not the same job.
A query string is text with conventions, not a data structure. Here is what ?a=1&a=2 means, why frameworks disagree, and why splitting before decoding is the one order that works.
What padding is for, what a decoder will and will not accept, and why decoded content is still untrusted input that has to be escaped for wherever it lands.
A diagonal measurement tells you almost nothing about how much surface you get, because the answer depends on the shape as well as the length. The formula, worked through at one fixed diagonal.
Pixels per inch comes from Pythagoras on the pixel grid, and it is exact arithmetic. What it cannot do on its own is describe what reaches a viewer, because that depends on distance.
A pseudo-random generator given the same starting value produces the same numbers forever. That is a feature and a limitation, and knowing which is which decides what you can use it for.
One die is even across all six faces. Two dice are a triangle peaking at 7, and 7 comes up six times as often as 2. Here is every outcome, counted.
Two machines that have never spoken can each invent an identifier and be confident they do not clash. The confidence comes from arithmetic, and the honest word is negligible — not zero.
The obvious way to shuffle a list is subtly wrong, and you can prove it by counting. Here are all 27 outcomes for a three-name list, and what the correct version changes.