Posts tagged “Development”
85 posts Subscribe by RSS
85 posts
PostgreSQL transaction ID wraparound: why VACUUM freezes rows and how to read age(datfrozenxid)
What happens when PostgreSQL's 32-bit transaction ID wraps: freezing, relfrozenxid/datfrozenxid, anti-wraparound autovacuum, warnings, write refusal and recovery, per the PostgreSQL 18 docs.
Jump consistent hash: picking a shard number without a lookup table, and what it assumes
Growing from 10 to 12 shards, hash mod n moves 5/6 of the keys; only 1/6 has to move. Lamping and Veach's code, why it works, and what adding or removing buckets does.
Where does a Python generator's return value go? StopIteration.value and PEP 479
A generator's return value never shows up in a for loop; it rides on StopIteration.value. How yield from gets it, why StopIteration in a generator becomes RuntimeError, and what close() returns.
What Referrer-Policy puts in Referer: the full URL, the origin, or nothing
Referrer-Policy decides what goes in Referer when a page loads an image or follows a link. The eight values, what is always stripped, where the policy is set, redirects and the Origin header.
What PostgreSQL data checksums catch, and what they don't
PostgreSQL data checksums detect corrupted pages on read. Covers when checks run, enabling them offline with pg_checksums, pg_stat_database counters, and what amcheck and backups still cover.
Why small TCP writes stall: Nagle's algorithm, delayed ACKs and TCP_NODELAY
Split a request into two small writes and the second piece can wait for the peer's ACK. What RFC 896, 1122 and 9293 say about Nagle's algorithm and delayed ACKs, and what TCP_NODELAY changes.
Union-find path compression and weighting: which implementation the α(n) bound belongs to
How size weighting, path compression and path halving change a union-find parent array, and which bound, worst-case Θ(log n) or O(m α(n)) per sequence, algs4 gives each implementation.
The KMP failure function: where the pattern goes after a mismatch
How KMP string search picks the pattern position to compare after a mismatch: the f and next tables, how to build them, and why the search is linear, from the 1977 paper and Princeton's code.
The Linux kernel rbtree: a red-black tree with embedded nodes and no stored comparator
Linux's red-black tree never stores a comparator. Embedded nodes, your own search loop, helpers taking per-call compare functions, colour bits, cached and augmented trees, lockless lookup in v6.17.
What REA can do, what it can do only under conditions, and what it does not support
A capability matrix for REA from its docs at a pinned commit: built-in static paths, paths that need a provider or change state, unsupported targets, and how to read Evidence and its unknowns.
Getting started with REA safely: a first exercise, a team checklist and a 30/60/90-day path
What to know first, a low-risk first investigation on the official Notes fixture, a checklist for teams, proposed success gates and a 30/60/90-day pilot with conditions for stopping.
What recent REA write-ups actually tested: runs, demos, news and opinion
Eight third-party pieces on REA, sorted by who ran what: two independent runs, two author-claimed demos, three news or opinion pieces and one discussion thread, and what each one can support.
REA's strengths and their costs, and five scenarios for the next 12 to 24 months
Each REA strength comes with a cost from the same design. Six pairs, who gains, and five conditional scenarios with counter-scenarios and signals to watch. Analysis, not a forecast.
REA (Reverse Engineer Anything): how it connects agents to analysis tools, what to learn, what to watch
What REA is and isn't, the agent-assisted investigation loop, the background worth having and a learning route, and the safety and rights boundaries, based on the project's official docs.
The Retry-After header: what it means on 429, 503, 413 and 3xx, and how clients should read it
Retry-After per RFC 9110 and RFC 6585: its two value formats, what it means with each status code, turning an HTTP-date or a seconds value into a wait, and handling invalid or huge values.
write() succeeded. Is the data on disk? Short writes, late errors and fsync on Linux
A successful write() does not mean the data is on disk. Handling short writes, Linux 4.13+ writeback error reporting, what fsync and fdatasync cover, and when the directory needs fsync too.
Skip lists: how coin-flip levels give O(log n) expected search
Why does adding random-level pointers to a sorted linked list make search O(log n) expected? Pugh's algorithms, what 'expected' covers, and what Java's ConcurrentSkipListMap docs promise.
What HSTS stops and what it doesn't: max-age, includeSubDomains, preload
What a browser does after receiving Strict-Transport-Security, per RFC 6797: the first-visit gap, the upside and risk of includeSubDomains, staged max-age, and why preload is no longer recommended.
Reading Linux Transparent Huge Pages settings: enabled, per-size controls, madvise and khugepaged
THP has a top-level enabled file and per-size hugepages-<size>kB/enabled files. It covers inherit, MADV_HUGEPAGE/MADV_NOHUGEPAGE and khugepaged, and how to check real use in /proc and sysfs.
Picking k random items from a stream of unknown length: reservoir sampling (Algorithm R)
Reservoir sampling picks k random items in one pass over data of unknown size. Why each item enters with probability k/i, proofs of k/n and uniform k-subsets, and a common off-by-one.
When a PostgreSQL UPDATE needs no new index entries: HOT updates and fillfactor
PostgreSQL HOT (heap-only tuple) updates avoid new index entries when no indexed column changes and the page has room. Covers both rules, fillfactor, and pg_stat_user_tables counters.
Why JavaScript sort() Puts 100 Before 9: Default String Order and the Comparator Contract
[10, 9, 1, 100].sort() returns [1, 10, 100, 9]. The default string comparison, the comparator contract, in-place mutation, undefined and holes, and toSorted(), per ECMA-262.
When is a hash table not O(1)? Collisions, O(n²) inserts and hash flooding
dict and HashMap are O(1) in expectation. Why n keys with one hash value need at least n(n−1)/2 comparisons. Python hash randomization and PYTHONHASHSEED, Rust's SipHash, Java's Comparable fallback.
Why a JWT verifier shouldn't trust alg: none, RS256→HS256 confusion and algorithm pinning
A JWT's alg header is chosen by the token's sender. Why alg none and RS256→HS256 confusion work, what RFC 8725 requires (one algorithm per key), and the iss, aud, exp, typ checks that follow.
Why L=[] as a Python default argument keeps growing: defaults are built once, at def time
Call def f(a, L=[]) three times and the list keeps growing. What the Python docs say about when defaults are evaluated, __defaults__, the None pattern and dataclass default_factory.
Using a PostgreSQL table as a job queue: FOR UPDATE SKIP LOCKED and when the lock is released
How FOR UPDATE SKIP LOCKED lets several workers share jobs in one PostgreSQL table, per the official docs: lock lifetime, LIMIT and OFFSET, ORDER BY, and locking clauses inside WITH.
When does Python rebuild a .pyc? Timestamp vs hash-based invalidation
By default CPython trusts a .pyc if the source's mtime and size match. When that misses edits, how checked-hash and unchecked-hash pycs differ, and how to use compileall (Python 3.14.8 docs).
Why your SQLite -wal file keeps growing: checkpoints and read transactions that never end
Why an SQLite -wal file keeps growing: the 1000-page auto-checkpoint, open read transactions that stall checkpoints, PASSIVE/FULL/RESTART/TRUNCATE, and journal_size_limit, per the official docs.
Added a DNS record but it still says the name doesn't exist? NXDOMAIN, NODATA and negative caching
Why resolvers can keep saying "no such name" after you add a record: NXDOMAIN vs NODATA, the negative TTL from the SOA, the NXDOMAIN cut, and the 5-minute cap on failure caching.
aria-label or aria-labelledby: which accessible name wins?
Browsers compute an accessible name in a defined order. See how aria-labelledby, aria-label, label, and placeholder rank, with common mistakes checked against W3C documents.
Why a Bloom filter is only ever sure about "no"
Why a Bloom filter answers only "definitely not" or "possibly", the conditions behind its no-false-negative guarantee, the false positive formula, and why deleting bits breaks it.
When does a CORS preflight happen? The conditions that send OPTIONS first
When fetch() sends OPTIONS first, per the WHATWG Fetch Standard: safelisted methods and headers, why application/json and Authorization trigger a preflight, and the 5-second Max-Age default.
Why sort(() => Math.random() - 0.5) is not a fair shuffle, and what Fisher–Yates does instead
A random comparator doesn't shuffle evenly, and the ECMAScript spec says why. How Fisher–Yates makes every permutation equally likely, and the random-number pitfalls it still depends on.
git push --force-with-lease can still overwrite a teammate's commit: background fetch and --force-if-includes
What --force-with-lease compares when you force-push after a rebase, why a background fetch defeats it, and how --force-if-includes (Git 2.30) or an explicit expected value fixes that.
Getting commits back after git reset --hard with reflog
The reflog records where branches and HEAD pointed in your local repo. Find a lost commit, restore it as a branch, and learn the default 90/30-day expiry and when recovery fails.
Safe and idempotent HTTP methods: why retrying POST is risky and PUT isn't
What RFC 9110 means by safe and idempotent methods, which ones a client may resend after a dropped connection, why POST and PATCH need care, and how If-Match makes an update conditional.
Why NaN === NaN is false: how ===, Object.is and includes compare values in JavaScript
In JavaScript, NaN === NaN is false but [NaN].includes(NaN) is true. The ECMA-262 rules for how ===, Object.is, and includes, Map and Set treat NaN and -0, with code.
Is a load average of 4.0 high? What Linux load average counts and what 1, 5 and 15 minutes mean
Linux load average isn't CPU usage. It's a decaying average of runnable (R) and uninterruptible (D) tasks. How the kernel computes it, how to read it against CPU count, and how PSI differs.
Why encodeURIComponent throws URIError on a cut emoji: lone surrogates
Cut an emoji in half: encodeURIComponent throws URIError, TextEncoder writes EF BF BD. Lone UTF-16 surrogates and isWellFormed()/toWellFormed(), per ECMA-262 and Unicode 17.0.
Why two SELECTs in one transaction can disagree: PostgreSQL READ COMMITTED and snapshots
Under PostgreSQL's default READ COMMITTED level, two SELECTs in one transaction can see different data. Learn how statement snapshots, row rechecks, and transaction retries work.
real, user and sys in time output: wall-clock time vs CPU time
What real, user and sys in time output count according to POSIX, why user + sys can exceed real, and how the shell's time differs from /usr/bin/time on Linux.
How an authenticator app's 6-digit code is made: TOTP step by step
How your authenticator app's code matches the server without asking it, traced through the RFC test values: time steps, HMAC, dynamic truncation, server checks, and the phishing gap.
Why toLowerCase() Breaks Case-Insensitive Comparison: Unicode Case Folding
'straße' and 'STRASSE' differ after toLowerCase(). Case conversion vs case folding, the Turkish i, simple folding in regex /iu, and normalization, per Unicode 17.0 and ECMAScript 2026.
Linux free shows almost no free memory? Read available first
A small free column does not mean Linux is out of memory. How free derives buff/cache, available and used from /proc/meminfo, and why routinely dropping caches can hurt performance.
Why TIME-WAIT sockets pile up: TCP's 2×MSL, Linux's 60 seconds, and what tcp_fin_timeout doesn't change
Why the side that closes a TCP connection first sits in TIME-WAIT, RFC 9293's 2×MSL versus Linux's fixed 60 seconds, what tcp_fin_timeout actually controls, and tcp_tw_reuse's default.
Broken Unicode download names: filename vs filename* in Content-Disposition
How to send a Unicode download name with Content-Disposition: an ASCII filename fallback, a UTF-8 filename* value, percent-encoded bytes, precedence, and safe handling under RFC 6266 and RFC 8187.
How big should a touch target be: 24px, 44px, or 48dp?
WCAG 2.2 sets 24×24 CSS px at Level AA and 44×44 at AAA. Here is how those rules differ from Android's 48dp guidance.
Finding the commit that broke a test with git bisect run: exit codes 0, 125 and 127
How git bisect binary-searches for the first bad commit, and how git bisect run reads exit codes: 0 is good, 1–124 and 126–127 are bad, 125 skips, anything else aborts. From Git's docs.
HTTP Range requests, 206 and 416: how resuming a download works
How Range, Content-Range and If-Range work with 206 Partial Content and 416 Range Not Satisfiable, per RFC 9110, and why a server may ignore Range and send 200.
When does quicksort hit O(n²)? How standard sorts avoid the worst case
Sorted input, median-of-3 killers and adversarial comparators can push quicksort to quadratic time. This article explains introsort’s depth limit and what C++, Rust, Go and Java actually guarantee.
Why NOT IN returns no rows: SQL NULL and three-valued logic
One NULL in a subquery makes NOT IN return zero rows. Why, per the PostgreSQL, MySQL and SQLite docs: three-valued logic, how WHERE keeps rows, and fixing it with NOT EXISTS.
Why Dijkstra's algorithm fails with negative edge weights
The greedy assumption that a negative edge breaks, a three-edge counterexample, and when Bellman–Ford or a DAG shortest-path algorithm fits instead.
CSV and RFC 4180: commas, quotes and line breaks inside fields
Why a comma or newline inside a value breaks CSV columns, per RFC 4180, the IANA text/csv registration, the W3C tabular data Recommendation and Python/Go docs, and what RFC 4180 leaves open.
Two dots or three in Git: what A..B and A...B mean in log and diff
Which commits git log selects for A..B and A...B, which two points git diff compares for each, and which one pull request diffs use, from Git's own docs and a reproduced example.
401 vs 403: missing authentication or a refused request
How HTTP 401 Unauthorized and 403 Forbidden differ under RFC 9110 and the OAuth 2.0 Bearer Token spec: WWW-Authenticate, retry rules, and hiding a resource with 404.
What is 2147483647 + 1? Integer overflow in Java, Go, Rust, C and Python
In Java int, Go int32 and Rust i32, 2147483647 + 1 overflows: Java and Go wrap to a negative, Rust panics or wraps by Cargo profile, C's INT_MAX + 1 is undefined, Python gives 2147483648.
What chmod 755 and 644 mean: permission digits, rwx, and x on directories
What chmod 755 means, based on POSIX: how octal digits map to rwx, which permission class applies, directory permissions, umask, and recursive chmod.
A heap is not a sorted list: priority queue order and the 0-based index formulas
Why doesn't a printed heapq list or PriorityQueue look sorted? The heap invariant, 0-based parent/child formulas, costs versus a sorted list, and equal priorities.
^1.2.3 vs ~1.2.3 in package.json: npm version ranges and the 0.x trap
By default, ^1.2.3 accepts stable releases from 1.2.3 up to but not including 2.0.0; ~1.2.3 accepts 1.2.3 up to but not including 1.3.0. SemVer vs npm, 0.x, prereleases and lockfiles.
Is 1.0.0-rc.1 lower than 1.0.0? SemVer pre-release precedence and caret ranges
Why 1.0.0-rc.1 is lower than 1.0.0, and why ^1.2.3 does not select 1.5.0-beta.1, based on SemVer 2.0.0, node-semver and Cargo.
Why ZIP file names break: CP437 and the UTF-8 flag
Why a file named 한글.txt comes out of a ZIP as ╟╤▒█.txt: the CP437 default in PKWARE's APPNOTE, general purpose bit 11, the Info-ZIP 0x7075 field, and how Python and .NET read names.
Deleted a file but the disk space didn't come back? unlink and open files
Deleting a large file with rm doesn't always free space in df. The POSIX rules on link counts and open files, why du and df disagree, and how to find the cause and get space back on Linux.
no-cache vs no-store: which Cache-Control directive stops storage
no-cache doesn't mean "don't cache". Using RFC 9111, this post compares no-cache, no-store, max-age=0 and Pragma, and shows where behavior varies across CDNs and browsers.
Why -7 % 3 gives different answers in different languages
-7 % 3 is 2 in Python but -1 in JavaScript, Java, C and Go. Truncated, floored and Euclidean division explained, and how to get a non-negative remainder.
The UTF-8 BOM (EF BB BF): why three invisible bytes break some parsers and not others
Why EF BB BF at the start of a UTF-8 file is skipped by browsers but rejected by JSON.parse, following the rules in Unicode, RFC 3629, RFC 8259 (JSON) and the WHATWG Encoding and HTML standards.
X-Frame-Options vs CSP frame-ancestors: which clickjacking header wins when you send both
How the two headers that stop your pages being framed differ, per CSP Level 3 and the HTML Standard: which one wins when both are sent, why ALLOW-FROM is ignored, and why a meta tag won't work.
Binary search insertion points: what bisect, lower_bound and binarySearch return
What Python bisect, C++ lower_bound and Java Arrays.binarySearch return for missing and duplicate keys, and what each assumes about its input, per the official docs and the C++ standard.
Why every PNG starts with 89 50 4E 47: the signature and chunk layout
Why every PNG begins with 89 50 4E 47 0D 0A 1A 0A, how a chunk is laid out, what letter case in chunk names means, and the order of critical chunks.
What does @@ -1,7 +1,8 @@ mean? Reading a unified diff
How to read @@ in diff -u and git diff: start lines, line counts, empty ranges, the default three lines of context, and the function context Git adds, based on POSIX and official Git docs.
Why appending to a dynamic array is O(1): capacity, growth and amortized time
Append sometimes copies the whole array, yet it counts as O(1). Capacity, amortized cost, what the Java, C++, Rust and Go docs promise, and reserving space.
Git line endings: .gitattributes text and eol vs core.autocrlf
What to check when git diff shows ^M, based on Git's own documentation: what core.autocrlf and the text and eol attributes each decide, and how to fix files already committed with CRLF.
301, 302, 307 or 308? Permanent vs temporary redirects, and why POST turns into GET
The differences between HTTP redirects 301, 302, 303, 307 and 308, from RFC 9110 and the WHATWG Fetch standard: when POST becomes GET, and how caches and search engines treat each code.
What Base64 is and why we use it: how the encoding works
How Base64 turns 3 bytes into 4 characters, why the output is about 33% larger, what the trailing = means, URL-safe Base64, and handling non-ASCII text, based on RFC 4648.
What does the /24 in 192.168.0.0/24 mean? CIDR and subnets
What the /24 after an IP address means, how it relates to the subnet mask, how to work out the network and broadcast addresses and usable hosts, and the private IPv4 ranges.
Why pale gray text fails: working out WCAG color contrast
Why pale gray text on white fails accessibility checks: the WCAG 2 luminance and contrast formulas, the 4.5:1, 3:1 and 7:1 thresholds, and dark mode, with real hex values.
From domain name to IP address: how a DNS lookup works
What happens between typing a name and getting an IP address: stub and recursive resolvers, authoritative servers, caches, A and AAAA records and TTL, explained from the RFCs.
Why 0.1 + 0.2 isn't 0.3: how floating-point numbers work
Why JavaScript, Python and Java print 0.30000000000000004 for 0.1 + 0.2, explained with the IEEE 754 double format, and how to compare, round and handle money safely.
What a hash function does: SHA-256, checksums and password storage
Why SHA-256 is always 64 hex digits, why one changed letter changes everything, how hashing differs from encryption and encoding, checking downloads, and why fast hashes are wrong for passwords.
The JSON.parse error points one step past the mistake: common JSON errors
Trailing commas, single quotes, comments and NaN that JSON parsers reject, big integers and duplicate keys that change silently, and how to read an error position, based on RFC 8259.
Why bücher.example turns into xn--bcher-kva: IDNs and Punycode
Why a domain with accents or non-Latin script shows up as xn--… in DNS settings and certificates, how Punycode spells it in ASCII, the mapping rules before it, and homograph phishing.
What is a stable sort? Keeping ties in their original order
What stable sorting means, why it matters when you sort by more than one key, and what the standard sorts in Python, JavaScript, Java and C++ actually guarantee.
Why character counts disagree: bytes, code points and what you see
Why Word, a web form, an SMS and JavaScript's .length give different counts for the same text: UTF-8 bytes, UTF-16 code units, code points and grapheme clusters, and which one to use.
What time is 1790550000? Unix time, milliseconds and the 2038 problem
What a Unix timestamp counts, 10 digits versus 13, why a timestamp has no time zone, leap seconds, the year 2038 problem, and how to store times in a database.
Why URLs fill up with %C3%A9: percent-encoding explained
Why non-English characters in a link turn into %C3%A9 or %E3%81%82, how encodeURI, encodeURIComponent and URLSearchParams differ, %20 versus +, and the double-encoding bug behind %2520.
UUID v4 or v7? The 128-bit layout and the real collision odds
Where the version and variant bits sit in a UUID, what v4's collision risk actually is, and why time-ordered v7 is kinder to database indexes, based on RFC 9562.
No posts match. Try another word.