Data & Spreadsheets
Cleaning, checking and querying a file before you trust what it tells you.
Luhn is a checksum for catching typos. It says a string of digits is internally consistent — not that an account exists, and not that anyone owns it.
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.
One skewed set can have an average of 17.78 and an average of 5 at the same time, both correct. Here is how to tell which one you have been handed.
Two group averages of 80 and 50 do not make 65 if the groups are different sizes. Here is the worked example where the two methods disagree by nine points.
It is roughly the typical distance from the mean. Here is how to compute one by hand, why there are two divisors, and why the number means nothing on its own.