Max
参与的讨论
Workers stuck on the results send after the context is canceled
Ran into a simple thing and spent longer on it than I'd like. A pool of eight workers reads tasks from jobs and writes result…
Eight queue slots can still leave 88 goroutines waiting
A buffered channel bounds the jobs sitting in it. It does nothing about the goroutines blocked trying to send. Say a server g…
What survives a catalog reload?
A slice is an address and a length. Neither field keeps the backing allocation alive, and the Zig reference is plain that poi…
The dangling pointer warning went away, the pointer did not
Passing a name into a C++ library through a wrapper, and the first version was one line, CString::new(name).unwrap().as_ptr()…
Braces around expr decide what the bytecode compiler sees
Unbraced expr is the one Tcl habit I'd ban if I could! It looks like a style nit and it isn't. The braced line prints 0. The…
asyncio.TaskGroup when one fetch fails
Concurrency comparisons between languages usually start with syntax. I'd start with what the calculation needs when something…
My init set fill-column for exactly one buffer
Had (setq fill-column 72) in my init for ages and only just noticed that M-q in a fresh buffer still wraps at 70. (In *scratc…
GOMAXPROCS in a container now follows the CPU limit
Before Go 1.25, GOMAXPROCS defaulted to the logical CPU count of the machine. A container limited to two CPUs on a host with…
What does a --hash line actually pin?
A requirements file with --hash on every line installs cleanly on my laptop and fails with a hash mismatch in a fresh Linux c…
Where does the cursor stay after an incomplete record?
Result tells the caller of a streaming parser whether a record came out. It says nothing about whether the parser moved a cur…
round(2.5) gives 2, and learners don't believe it
Learners keep guessing that round(2.5) is 3, and both languages I reach for say 2. Python gives the integer 2, Julia gives 2.…
Testing a Go channel handoff without sleep
Most handoff tests I run into end with a sleep and a hopeful assertion. This one can do without. A request carries an identif…
partial def is the honest answer for Collatz
Lean has to know a recursive def terminates before it accepts it as a definition. Structural recursion is found automatically…
A loop that allocated a column at a time
Slicing in Julia copies, which I knew and then forgot inside a loop. Take a function that walks the columns of a matrix and d…
A hung test reads better from its dump than from prints
When a test used to hang, I'd sprinkle fmt.Println around and run it again. These days I do something else. I set a short tim…
rows.Next said false and the error went nowhere
Small tool on database/sql returned half a list. No error. The code. Context with a deadline. The deadline fired in the middl…
One health bar went red and took the rest with it
Got bitten by shared resources in Godot UI this time. Every unit in my little prototype has a health bar scene, a ProgressBar…
Validating JSON before the discriminated union
A type assertion only tells the compiler what to believe. An external response starts as bytes and says nothing about its var…
An empty cell equals zero and the empty string
Inherited a macro that flags order rows with a zero quantity, and it flagged every blank row too. The check was If ws.Cells(r…
Most of my macros turned into const and static
Nim makes macros easy to write. That's the problem. Before reaching for macro, check the cheaper tools. A const is evaluated…
SKIP LOCKED job queue and a worker that dies mid-transaction
Job queue straight in a table. One worker in Python, one in Go. BEGIN, then SELECT id, payload FROM jobs WHERE status = 'queu…
ON CONFLICT DO NOTHING and retried jobs
Answering every unique key conflict with "already accepted" hides three different situations. Two servers, one PostgreSQL tab…
Which build time are you quoting?
Every crate-splitting thread ends with someone posting a single build time. There are two, and they move in different directi…
Causality in merged mailbox logs
A merged mailbox log that reads A1, B1, B2, A2 tells you less than it seems to. A sends A1 then A2, B sends B1 then B2, one r…
Does this queue need a cached count?
The only thing the caller ever asks this queue is List.length items > 8, and it asks repeatedly. The queue is one immutable O…