The Straight-Line Distance Almost Never Matches the Grid
From (2, 3) to (8, 7) is 7.21 in a straight line and 10 along the streets. The gap is 39 %, and it is the largest at exactly 45°.
Daniel Okonkwo · 3 min leestijd
30 gidsen over dev
Reguliere expressies, cron, hashes, coderingen — de kleine tools waar een werkdag vol van is. Elke gids leest de syntaxis hardop voor en toont dan het geval dat de versie breekt die iedereen kopieert.
Gerangschikt naar hoeveel pagina’s van deze site ernaar verwijzen, niet naar bezoek.
From (2, 3) to (8, 7) is 7.21 in a straight line and 10 along the streets. The gap is 39 %, and it is the largest at exactly 45°.
Daniel Okonkwo · 3 min leestijd
The midpoint of (2, 3) and (8, 7) is (5, 5) — average each coordinate separately. On a map, on a road network or across a time zone, that point is often the wrong place to meet.
Daniel Okonkwo · 3 min leestijd
Eight numbers give a range of 116. Remove the highest and the lowest and it falls to 45 — a 61 % drop caused by deleting a quarter of the data.
Daniel Okonkwo · 3 min leestijd
The matrix (4, 6; 3, 8) has a determinant of 14, so it scales every area by fourteen. The matrix (2, 4; 1, 2) has a determinant of 0 — it flattens the plane onto a line.
Daniel Okonkwo · 3 min leestijd
The vector (3, 4, 12) has a magnitude of exactly 13. When you only need to know which of two points is nearer, the square root is a step you can leave out entirely.
Daniel Okonkwo · 3 min leestijd
In the standard astable circuit the output is high longer than it is low, always. With 10 kΩ and 47 kΩ the duty cycle is 54.8 %, and 50 % is a limit you approach but never reach.
Daniel Okonkwo · 4 min leestijd
A 100 mH relay coil at 2 A holds 200 millijoules. Open the switch and that energy has one microsecond to find somewhere to go — usually across the contacts.
Daniel Okonkwo · 3 min leestijd
A 100 Ω, 50 mH, 10 µF series circuit shows 319 Ω at 50 Hz and 315 Ω at 1 kHz. Between them, at 225 Hz, it collapses to exactly 100 Ω.
Daniel Okonkwo · 3 min leestijd
17 mod 5 is 2 everywhere. −17 mod 5 is −2 in JavaScript, C and Java, and 3 in Python, Ruby and a spreadsheet. Both are right, and the difference is a real bug.
Daniel Okonkwo · 3 min leestijd
A conversion rate is the share of visitors who take a desired action. Here is the simple formula, typical benchmarks, and how to read the number without fooling yourself.
Daniel Okonkwo · 4 min leestijd
Estimate upload time with one formula: file size in bits divided by your upload speed. Learn why upload is usually slower than download and how overhead affects the result.
Daniel Okonkwo · 4 min leestijd
Big O describes how an algorithm's work grows as input grows. Here is what O(1), O(n), O(n squared), and O(log n) mean and why the difference matters.
Daniel Okonkwo · 4 min leestijd
Unicode assigns every character a code point; UTF-8 encodes those code points in one to four bytes. Here is how it works and why it beat the alternatives.
Daniel Okonkwo · 4 min leestijd
What password entropy really measures, why length beats complexity, and how bits of entropy translate into a realistic crack time.
Daniel Okonkwo · 4 min leestijd
Een Unix-timestamp telt de seconden sinds 1 januari 1970 UTC. Waarom computers hem gebruiken, hoe je hem omzet, en het jaar-2038-probleem.
Daniel Okonkwo · 2 min leestijd
PPI and DPI both measure density per inch, but one is about screens and the other about print. Learn how to compute pixel density and what Retina really means.
Daniel Okonkwo · 5 min leestijd
What 1080p, 1440p, and 4K really mean. Learn how resolution counts pixels, why total pixels grow so fast, and how aspect ratio ties width to height.
Daniel Okonkwo · 4 min leestijd
Bitrate is how many bits of data a video or audio stream uses each second. Learn how it sets quality and file size, and the difference between constant and variable bitrate.
Daniel Okonkwo · 4 min leestijd
Estimate any video's file size before you export. Learn the bitrate-times-duration formula, why you divide by 8, and how resolution and frame rate change the result.
Daniel Okonkwo · 5 min leestijd
Estimate how many photos, songs, or hours of video fit on a card by dividing its capacity by the average file size.
Daniel Okonkwo · 4 min leestijd
See how many gigabytes per hour SD, HD, and 4K video use, and how to check a monthly streaming habit against a data cap.
Daniel Okonkwo · 4 min leestijd
Work out the internet speed your home needs by adding up Mbps per video stream, video call, and gamer, with clear examples.
Daniel Okonkwo · 4 min leestijd
Understand how a subnet mask splits an IP address into network and host parts, what /24 means, and how to count usable hosts.
Daniel Okonkwo · 4 min leestijd
Learn how binary place values work and convert binary to decimal and hexadecimal by hand, with clear worked examples.
Daniel Okonkwo · 4 min leestijd
Schat de downloadtijd uit de bestandsgrootte en de snelheid van je verbinding. Lees de formule grootte ÷ snelheid, de cruciale omrekening van bits naar bytes (deel door 8) en waarom echte downloads langzamer gaan dan de rekensom voorspelt.
Daniel Okonkwo · 4 min leestijd
Het Caesarcijfer verschuift elke letter met een vast aantal plaatsen. Lees hoe die verschuiving werkt, waarom ROT13 een bijzonder geval is, hoe je met de hand codeert en decodeert, en waarom het cijfer vandaag geen echte beveiliging biedt.
Daniel Okonkwo · 4 min leestijd
De meeste volwassenen lezen proza met ongeveer 200-250 woorden per minuut. Lees wat een normale leessnelheid is, hoe je de jouwe in een minuut meet en waarom begrip zwaarder weegt dan pure snelheid.
Daniel Okonkwo · 4 min leestijd
Een URL-slug is het leesbare deel met koppeltekens van een webadres dat een pagina benoemt. Lees waarom slugs in kleine letters staan, hoe ze de SEO helpen en hoe je er een uit een titel genereert.
Daniel Okonkwo · 3 min leestijd
camelCase, snake_case, PascalCase en kebab-case uitgelegd: hoe ze eruitzien, waar ze de conventie zijn en hoe je er consequent één kiest.
Daniel Okonkwo · 3 min leestijd
Een praktische gids om een JSON-array van objecten om te zetten naar een net CSV-bestand, met uitleg over het platmaken van geneste velden en de lastige randgevallen.
Daniel Okonkwo · 4 min leestijd
Cookies
We gebruiken Google Analytics om te zien waar bezoeken vandaan komen. Het plaatst twee cookies op je apparaat, en er wordt niets opgeslagen voordat je akkoord gaat. Weigeren verandert niets anders op de site. Wat we meten