browse/
24 results
computer-science/merge-sort-how-splitting-a-list-in-half-again-and-again-sorts-it-with.md
Merge sort: how splitting a list in half again and again sorts it with far less work
How do you sort 10,000 numbers without making millions of comparisons? Merge sort never sorts a big pile. It splits the list until every…
networks/nat-how-a-dozen-devices-share-one-internet-address.md
NAT: how a dozen devices share one internet address
Your home has one public internet address but a dozen devices. NAT is how your router lets them all share it and still get each reply to…
languages/javascript-s-event-loop-why-settimeout-0-runs-after-the-code-below-it.md
JavaScript's event loop: why setTimeout(…, 0) runs after the code below it
Why does `setTimeout(fn, 0)` run after the lines below it, and why does a promise callback beat it? JavaScript has one worker and two…
mobile/push-notifications-how-your-phone-buzzes-for-an-app-that-isn-t-running.md
Push notifications: how your phone buzzes for an app that isn't running
Your phone buzzes with a message from an app that isn't even running. How? Phones keep one shared connection to a push service (Apple's…
ai/gradient-descent-how-a-computer-learns-a-number-by-rolling-downhill.md
Gradient descent: how a computer learns a number by rolling downhill
How does a computer learn a number? It can't solve for it in one go. It tries a guess, measures how wrong it is, and nudges the guess…
web/the-dom-how-a-browser-turns-html-text-into-a-tree.md
The DOM: how a browser turns HTML text into a tree
A web page starts as plain text, yet a script can add a bullet to it while it is open. How? The browser never works on your text directly…
computer-science/breadth-first-search-how-a-maze-solver-finds-the-shortest-way-out.md
Breadth-first search: how a maze solver finds the shortest way out
How does a maze solver, or a map app, find the shortest route and not just any route? The answer is breadth-first search: explore every…
infrastructure/rolling-deploys-how-a-website-updates-without-going-offline.md
Rolling deploys: how a website updates without going offline
How does a busy website switch to a new version without going offline? Not by replacing everything at once. A rolling deploy updates one…
computer-science/binary-search-how-to-find-one-number-in-a-million-with-20-guesses.md
Binary search: how to find one number in a million with 20 guesses
Guessing a number between 1 and 1,000,000 sounds like it could take a million tries. With binary search it takes at most 20. Step through a…
mobile/app-lifecycle-why-your-phone-forgets-what-you-typed-when-you-switch-ap.md
App lifecycle: why your phone forgets what you typed when you switch apps
You switch apps for a minute, and when you come back the message you were typing is gone. Nothing was broken: the phone needed memory…
languages/go-slices-why-appending-to-a-copy-can-change-the-original.md
Go slices: why appending to a copy can change the original
Change a copy of a Go slice and sometimes the original changes too. The reason is that a slice is only a small window onto an array, with a…
networks/latency-vs-bandwidth-why-a-faster-plan-can-t-speed-up-a-small-page.md
Latency vs bandwidth: why a faster plan can't speed up a small page
You upgraded to a much faster internet plan, yet a small web page loads just as slowly. Why? Network speed is two different numbers…