browse/

156 results
computer-science/coin-change-why-grabbing-the-biggest-coin-first-can-fail-and-how-a-tab.md Coin change: why grabbing the biggest coin first can fail, and how a table fixes it A cashier owes 6 cents and has coins worth 1, 3 and 4. Grabbing the biggest coin first uses three coins, but two 3s do it in two. This… 4 min read · 2 Nov tools/file-permissions-what-rwxr-xr-x-means-and-why-a-script-says-permission.md File permissions: what rwxr-xr-x means, and why a script says Permission denied You run your first script and the terminal says Permission denied. Nothing is wrong with your code: every file and folder carries read… 6 min read · 2 Nov networks/cdns-why-a-far-away-server-feels-slow-and-how-copies-near-you-fix-it.md CDNs: why a far-away server feels slow, and how copies near you fix it Why does a website load instantly for you and slowly for someone on the other side of the world? The server is the same; the distance is… 6 min read · 1 Nov databases/pagination-why-next-page-shows-a-post-twice-and-how-a-bookmark-fixes-i.md Pagination: why 'next page' shows a post twice, and how a bookmark fixes it Why does "next page" sometimes show the same post twice, and why does page 90,000 load slowly? Both come from paging with LIMIT and OFFSET… 5 min read · 1 Nov computers/deadlock-how-two-programs-can-wait-for-each-other-forever.md Deadlock: how two programs can wait for each other forever Two threads each hold one lock and wait for the other's. Neither can move, and the program just freezes without an error. This is a… 5 min read · 1 Nov web/viewport-and-media-queries-why-a-page-looks-tiny-on-a-phone-and-how-it.md Viewport and media queries: why a page looks tiny on a phone, and how it rearranges itself Why does a page look like a tiny copy of the desktop version on a phone, and how does the same page rearrange itself for a small screen?… 4 min read · 1 Nov languages/ruby-blocks-how-a-method-borrows-a-piece-of-your-code-and-runs-it-with.md Ruby blocks: how a method borrows a piece of your code and runs it with yield Ruby code is full of curly-brace chunks like `list.each { |x| ... }`. Who runs that chunk, and when? This article follows a block from the… 4 min read · 31 Oct mobile/tap-scroll-or-long-press-how-a-phone-decides-what-your-finger-meant.md Tap, scroll or long press: how a phone decides what your finger meant A touchscreen only reports a finger going down, moving, and coming up. So how does your phone tell a tap from a scroll from a long press?… 5 min read · 31 Oct ai/accuracy-why-a-spam-filter-that-is-99-right-can-still-catch-nothing.md Accuracy: why a spam filter that is 99% right can still catch nothing A spam filter that never flags anything can score 99% accuracy when only 1 email in 100 is spam. So what should you measure instead? This… 6 min read · 31 Oct security/csrf-why-a-request-carrying-your-cookie-isn-t-proof-that-you-sent-it.md CSRF: why a request carrying your cookie isn't proof that you sent it Log in to your bank in one tab, open a stranger's page in another, and a hidden form can make your browser send money. The attacker never… 6 min read · 31 Oct software-design/composition-vs-inheritance-why-a-toy-duck-shouldn-t-learn-to-fly.md Composition vs inheritance: why a toy duck shouldn't learn to fly A rubber duck that learns to fly is a classic sign that inheritance, the "is a" way of sharing code, has been stretched too far. Every… 5 min read · 30 Oct infrastructure/rate-limiting-how-a-token-bucket-stops-one-caller-from-using-up-the-wh.md Rate limiting: how a token bucket stops one caller from using up the whole server How do websites stop one noisy caller from using up all the server's time? Many use a token bucket: a bucket that holds a few tokens and… 5 min read · 30 Oct