Enjoy Newsletter #117.

Should you normalize RGB values by 255 or 256?

Pekka Väänänen dissects a deceptively small question that sparks endless debate in image processing: when converting 8-bit RGB color values to floating point, should you divide by 255, or add half a step and divide by 256? The familiar img / 255.0 maps 0 to 0.0 and 255 to 1.0, preserving exact black and exact white, which is convenient for almost all downstream shader and image code. The alternative (img + 0.5) / 256.0 places each sample at the midpoint of a quantization bucket—cleaner from a signal-quantization standpoint and yielding slightly lower theoretical reconstruction error, but only when you control both the encoding and decoding sides of the pipeline.

The author’s pragmatic verdict: for images coming from the outside world, divide by 255. The usual arguments against 255—that the two endpoint buckets are half-width, that floats don’t represent thirds or fifths of 255 exact to the last bit, or that a tiny sliver of precision is wasted—are negligible in practice. Conversely, dividing by 256 on images that were quantized under the standard 255 convention introduces bias and hardcodes an 8-bit assumption into your code. The real bug to fear is mixing one convention’s encoder with the other’s decoder. Only consider dividing by 256 inside a closed system where you control the entire read/write pipeline, don’t need 0 to map to 0.0, and every component agrees on the exact same convention.

Jira is Turing-Complete

Nicolas Seriot turns a classic office joke about Jira into a formal proof: Jira Automation can simulate a Minsky register machine, a computational model known to be Turing-complete. In the author’s construction, each register is represented by the count of linked issues of a specific type (such as Bug and Task); the instruction pointer is the current status of an Epic; the program table is the set of automation rules; and each clock cycle is a status transition triggered by an automation rule. Using only operations that create, delete, and check linked issues, Jira can express INC, DEC, and conditional branching.

The minimal example is addition: transferring the count of Bugs in register A into Tasks in register B using statuses like TODO, DEV, and PROD. While A still has a Bug, a rule deletes one Bug and transitions to a state that increments B; once A hits zero, it transitions to the halt state. Seriot also uses an issue-type conversion action—which effectively fuses a decrement and an increment into a single step—to compress a Fibonacci program down to three statuses across three registers. The program runs until it hits Jira Cloud’s automation chain-depth limit and requires an operator to re-trigger it. Quota limits like that don’t invalidate the proof, since every physical computer is finite too. The takeaway isn’t that you should write software in Jira, but that complex workflow automations genuinely are programs—complete with state, memory, branches, and loops.

USB for Software Developers: An introduction to writing userspace USB drivers

WerWolv writes an approachable introduction to USB for software developers who want to talk to hardware devices without diving into electrical signaling or writing kernel modules. The running example is an Android phone in bootloader mode, since the Fastboot protocol is simple, well documented, and typically doesn’t have an OS kernel driver claiming the interface automatically. The guide starts with lsusb to inspect the VID, PID, device class, and bound drivers, before moving to libusb to discover and open the device directly from userspace.

The most valuable part is how the author connects each USB concept directly to working code. During enumeration, the host uses control endpoint 0x00 to send standard requests like GET_STATUS and GET_DESCRIPTOR, reading descriptors to learn what configurations, interfaces, and endpoints the device exposes. Endpoints can be thought of like communication ports, except USB is strictly host-driven—a device never sends data unprompted. The post explains the four transfer types (Control, Bulk, Interrupt, Isochronous) and notes that IN and OUT directions are always defined from the host’s perspective. Finally, the sample program sends a Fastboot getvar:version command over a Bulk OUT endpoint and reads back OKAY0.4 from the Bulk IN endpoint. The takeaway: for a device with a documented protocol, writing a userspace driver with libusb feels much closer to socket programming than intimidating kernel development.

Everything you need to know about Sourcemaps

Neciu Dan examines sourcemaps from both angles: as an indispensable debugging tool and as a source-code exposure risk. After bundling, browsers execute concatenated, minified, and mangled code, making an error like bundle.min.js:1:48211 nearly useless. A sourcemap is a JSON file mapping positions in the minified output back to the original file, line, column, and identifier names so stack traces become readable again. Yet those very fields—sources, names, mappings, and especially sourcesContent—can expose directory structures, module names, comments, internal API endpoints, and even the entire original source code if .map files are left publicly accessible.

The core lesson is that minification is not a security boundary. When a production bundle points to a sourcemap via sourceMappingURL or the SourceMap HTTP header, anyone with DevTools or curl can download it if the server permits access. The author cites real-world incidents—including Apple’s web App Store in 2025 and version 2.1.88 of the @anthropic-ai/claude-code npm package shipping with a nearly 60 MB cli.js.map file—to show that leaks are usually simple build or packaging misconfigurations rather than sophisticated attacks. Mitigations include disabling sourcemaps in production when unneeded, uploading sourcemaps privately to Sentry (noting that “hidden” sourcemaps only omit the reference comment without blocking direct URL access), blocking .map requests at the web server or CDN, stripping .map files from build artifacts and npm tarballs, and adding CI/CD checks (such as inspecting npm pack output) to catch accidental sourcemap publishing.

Extended Statistics in Postgres

Valerie Parham-Thompson explains how extended statistics help the Postgres query planner make far more accurate row estimates when columns are correlated in ways default statistics cannot see. The planner relies on internal catalog tables like pg_class and pg_stats to estimate row counts, distinct values, histograms, and most common values, but those statistics are collected per column and implicitly assume filter conditions are independent. For instance, zip='91605' almost entirely implies state='CA', yet by default the planner multiplies the two selectivities as if they were independent variables, severely underestimating row counts and picking a poor execution plan.

The post walks through all three kinds of extended statistics. The dependencies type captures functional dependencies between columns, such as a ZIP code largely determining the state; after running CREATE STATISTICS ... (dependencies) and ANALYZE, the planner’s row estimate jumps much closer to reality. The mcv (most-common values) type tracks frequent value combinations across multiple columns, helping multi-column WHERE filters like category plus subcategory. The ndistinct type helps the planner estimate group counts for multi-column GROUP BY clauses instead of naively multiplying each column’s distinct count. The practical takeaway: when you know your schema has correlated columns, teach the planner with extended statistics instead of reflexively reaching for another index.

Finding a needle in a 4 GB haystack: from 0.75 GB/s to 49 GB/s in Go

Assel Meher uses a deliberately trivial problem to dissect file reading and scanning performance in Go: finding a single non-zero int64 near the end of a 4 GiB file filled almost entirely with zeros. With no parsing or complex algorithms in the way, the benchmarks expose the true cost of each layer: the Go runtime, standard library, syscalls, page cache, memory bandwidth, mmap, pread, multithreading, and SIMD. The baseline—calling os.ReadFile and ranging byte by byte—hits just ~0.75 GB/s because it allocates and copies 4 GiB before inspecting one byte at a time; bufio.ReadByte fares no better due to per-byte function call overhead.

The first major leap comes from eliminating per-byte work: reading in 1 MiB chunks and scanning as uint64 words immediately crosses 13 GB/s. mmap doesn’t automatically win because, while it avoids copying into userspace buffers, touching every page triggers over a million minor page faults. Parallelism helps further, and parallel pread handily beats parallel mmap—which plateaus around 28 GB/s due to page-fault lock contention—because sequential block copies are cheaper than massive concurrent page faults. Adding SIMD via AVX2 or Go 1.26’s simd/archsimd package makes the inner scan loop nearly free, at which point memory bandwidth, read strategy, and concurrency become the real bottlenecks. On a Ryzen 5 9600X under WSL2 with a warm page cache, parallel pread plus SIMD reaches ~49 GB/s; going any faster requires reading less data or buying faster hardware.

HTTP caching, a refresher

Dan Cătălin Burzo revisits RFC 9111 to organize the essential concepts of modern HTTP caching. He reminds readers that “the cache” isn’t just the browser’s private cache, but also shared caches like proxies, CDNs, and Varnish sitting between clients and origin servers. At the center is the Cache-Control header: directives like max-age, s-maxage, no-cache, no-store, private, public, must-revalidate, stale-while-revalidate, and stale-if-error govern not only whether a response may be stored, but also how long it stays “fresh” (based on age versus max-age, s-maxage, Expires, or heuristics from Last-Modified), when it must be revalidated with the origin, and whether a shared cache is allowed to store responses to requests carrying an Authorization header.

Burzo also clarifies several common points of confusion. A stale response isn’t necessarily discarded: a cache can send a conditional request using If-None-Match (with an ETag) or If-Modified-Since (with Last-Modified) to receive a 304 Not Modified without re-downloading the body. The Vary header splits the cache key across request headers like Accept-Language, which can tank hit rates if header values are too diverse, while No-Vary-Search solves the inverse problem by ignoring query parameters that don’t affect response content. The final section compares normal reloads against hard reloads in browsers, explains the role of immutable, and warns that misusing public, s-maxage, or must-revalidate can trick shared caches into storing authenticated responses—so reach for private whenever a response belongs strictly to one user.

How to Use ss as a Replacement for netstat to View IPv4 Sockets

Nawaz Dhandala introduces ss as the modern replacement for the deprecated netstat utility when inspecting sockets on Linux. Because ss queries socket state directly from the kernel via netlink rather than parsing /proc files, it is significantly faster, especially on busy servers handling thousands of connections. Focusing on IPv4 with the -4 flag, the post walks through everyday command patterns: listing all TCP, UDP, and raw sockets, viewing active TCP connections, checking listening ports, displaying process names and PIDs (when run with privileges), filtering by state such as state established, filtering by port with expressions like dport = :443, filtering by address like src 192.168.1.100, and viewing summary statistics with ss -s. The flags -t, -u, -l, -n, and -p map cleanly to TCP, UDP, listening sockets, numeric output, and process info.

The handiest section is a side-by-side translation table from netstat to ss: muscle-memory commands like netstat -an, netstat -tnp, and netstat -tlnp translate directly to ss -an, ss -tnp, and ss -tlnp. For day-to-day troubleshooting, ss -4tulnp is the most compact command to see all listening IPv4 TCP and UDP sockets along with their owning processes, while ss -4tn state established is ideal for inspecting active IPv4 TCP connections. It serves as a concise, practical cheat sheet for Linux operations.


This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.