Skip to content
Field notes · 25

Blog

/015 min read

Most 'Title Case' Buttons Are Wrong: What Chicago and AP Actually Require

Chicago writes Gone with the Wind, AP writes Gone With the Wind. Four title-case styles, and the regex that splits XMLHttpRequest correctly.

texttitle-caseunicodetokenizer
Read more
/024 min read

A Capital S in ls -l Means Your setuid Bit Is Doing Nothing

chmod 4655 shows -rwSr-xr-x. The capital S means setuid is set but inert because the owner lacks execute. How S/T case works, plus symbolic modes like u+x,go-w.

devlinuxpermissionschmod
Read more
/035 min read

4% to 5% Is +1 Point and +25% at the Same Time — the Percentage Trap Most Calculators Ship

A rate moving from 4% to 5% rose 1 percentage point and 25% in relative terms. Points vs percent change, loss recovery, reverse discounts, and markup vs margin.

financepercentagepercentage-pointmargin
Read more
/047 min read

Most CVD Simulators Skip sRGB Gamma. That Makes Red Two Stops Too Dark.

Skip the sRGB gamma decode and Brettel 1997 protanopia turns #FF0000 into #4F4F4F instead of #828282. How to run Brettel, Viénot and Machado in linear light.

accessibilitycolorvisionsrgb
Read more
/056 min read

Rolling a d100 in JavaScript: Modulo Bias, Math.random, and Rejection Sampling

Mapping 2^32 values onto a d100 biases some faces by about 2e-10. The bias is calculable but no χ² test can see it; the roller removes it for correctness.

randomdicettrpgcsprng
Read more
/066 min read

Your Subnet Calculator Says /31 Has 0 Usable Hosts. RFC 3021 Says 2.

/31 has 2 usable hosts (RFC 3021), /32 has 1, IPv6 has no broadcast, and IPv6 point-to-point uses /127. Four subnet calculator errors, checked against the RFCs.

devnetworkingcidripv4
Read more
/075 min read

Naegele's Rule Was Published in 1812. Your Due-Date Calculator Still Uses It Alone.

Naegele's rule adds 280 days to the LMP. ACOG Committee Opinion 700 uses the ultrasound date when they differ by more than 5 to 21 days, by gestational age.

lifepregnancyacogobstetrics
Read more
/085 min read

BMI 25 Is the Wrong Cutoff for Asian Adults: The WHO Asia-Pacific Numbers Most Calculators Skip

WHO's 2004 Asia-Pacific cutoffs put overweight at BMI 23 and obesity at 27.5. A 1.70 m / 66.5 kg adult at BMI 23.0 is normal globally and overweight under them.

lifehealthbmiwho
Read more
/094 min read

WebAIM Says This Gray Passes WCAG; APCA Says It Doesn't

#767676 on white passes WCAG 2 AA at 4.54:1 but scores APCA Lc 71.6, below the 75 needed for 16 px body text. Why WCAG 2 and APCA disagree.

imagea11ywcagapca
Read more
/106 min read

One Emoji, Eight Characters: What Word Counters Get Wrong About Length

'👨‍👩‍👧'.length is 8, Array.from gives 5, a grapheme count gives 1. The three layers of character in JavaScript, and why word counters need Intl.Segmenter.

unicodegraphemeemojijavascript
Read more
/116 min read

Compute the Holiday, Ship the Calendar: When Data Beats Code in a Date Engine

US federal holidays come from 11 rule lines, UK Easter from an algorithm, China from a 2020–2030 table. Why one date engine uses three strategies.

datecalendarholidayslunar
Read more
/124 min read

The Real-Return Shortcut Most Calculators Use Is Off by 461 bps in Emerging-Market Inflation

The exact Fisher real return is (1+i)/(1+π) − 1. The common shortcut i − π is fine at G7 inflation but overstates by 461.5 bps at 50% nominal and 30% inflation.

financeinflationfishercpi
Read more
/137 min read

K-means Belongs in CIELAB, Not RGB: Picking Five Colors From an Image That Look Right

K-means on RGB pixels returns muddy browns; in CIELAB it returns the colors a designer would pick. Why, plus code: a 256-entry LUT and a 3×3 matrix.

colork-meanscielabimage processing
Read more
/144 min read

Powerball's '4 + Powerball' Tier Is 1 in 913,129 — and Most Napkin Calculations Are Off by 64×

Powerball's 4 white + Powerball tier is 1 in 913,129. How the hypergeometric formula gets there, and why dropping C(64,1) makes the odds 64× too rare.

randomlotteryprobabilityhypergeometric
Read more
/155 min read

SHA-3 and Keccak Are Not the Same Hash: A Tour of One Padding Byte

SHA3-256 and Keccak-256 share a permutation but pad with different bytes, 0x06 vs 0x01. That byte is why Ethereum's keccak256 never matches Node's sha3-256.

cryptographysha3keccakethereum
Read more
/164 min read

Form Mode Is Two-Way: Why So Many URL Encoders Break on a Literal +

WHATWG form encoding maps space to + and + to %2B. Encoders that skip the second rule corrupt any literal plus, such as C++ or a phone country code.

devurlpunycodeencoding
Read more
/177 min read

Six Edge Cases Most CSV-to-JSON Converters Get Wrong

From RFC 4180 quote escapes to type inference corrupting IDs, here are the CSV ↔ JSON conversion pitfalls you only notice once they hit production.

csvjsonndjsonrfc 4180
Read more
/186 min read

Mortgage Math: Why Equal Payment Costs You More (And When It's Still the Right Choice)

The PMT formula, equal-payment vs equal-principal repayment, and how prepayment and biweekly schedules change total interest, with code and worked numbers.

mortgageamortizationfinanceloan
Read more
/196 min read

Strip, Don't Re-encode: How to Actually Remove EXIF Without Touching a Pixel

Re-saving a photo to strip metadata re-compresses every pixel. Walking JPEG markers and PNG chunks does not. A byte-level tour of EXIF and GPS removal.

exifmetadataphoto privacyjpeg
Read more
/205 min read

How to Read and Write Cron Expressions (5-Field POSIX)

Learn how to read, write, and debug 5-field POSIX cron expressions with a visual builder, plain-English explanations, and a live preview of the next runs.

cronschedulerdevopsdeveloper
Read more
/214 min read

How JWT Works: Header, Payload and Signature

Learn how JWTs work, how to decode them in the browser, and the common pitfalls developers hit when handling tokens client-side.

jwtsecuritywebauth
Read more
/225 min read

How Long Should a Password Be? Entropy and Passphrases

How to generate strong passwords and passphrases under 2026 guidance: length over complexity, entropy math, EFF wordlists, and common mistakes that weaken them.

securitypasswordrandomweb
Read more
/234 min read

JavaScript Regex Flags and Capture Groups Explained

Build, debug, and learn regular expressions in the browser. We cover JS RegExp syntax, flags, capture groups, and the most common pitfalls.

regexjavascriptdeveloperweb
Read more
/246 min read

UUID v4 vs v7 vs v1: Which Version to Use

When to use UUID v4, v7, or v1, and why v7 is the right default for new database tables. Bit layouts, practical recipes, and common pitfalls.

uuidrandomdatabaseweb
Read more
/254 min read

Understanding Randomness in Web Development

Math.random() versus crypto.getRandomValues(): how each generator works, which one to use for tokens, passwords and raffles, and how to shuffle without modulo bias.

javascriptrandomsecurityweb development
Read more