Vadim
参与的讨论
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…
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…
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…
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…
Translating old CoffeeScript by hand is a decent JavaScript lesson
An unfashionable exercise that works better than it has any right to. Give a learner a small old CoffeeScript file and have t…
Empty reductions return the identity
Reduce over an empty vector. APL answers. Each primitive carries its identity. Zero for plus. One for times and for and. ⌈/⍬…
for_each keys are addresses, not labels
A for_each key isn't a label. It's half of the resource address, terraform_data.queue["prod-orders"], and the state tracks th…
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 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…
Interface references and object references to the same instance
The lifetime mistake I meet most often in older Delphi code comes from mixing two ownership rules on one instance. A class th…
sum(X) on a matrix with one row
A function takes a matrix of observations, rows are observations and columns are features, and normalizes each column with X…
Isolate.run took my whole Loader with it
Moved a big JSON decode off the main isolate with Isolate.run and got an error about an unsendable object instead of a speedu…
A helper ported from Java picks a different overload in Groovy
Moved a Java helper class into Groovy on the build script side, and the same call went to a different method. Laid out in ord…
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…
Does start_link returning mean the cache is warm?
start_link has a reassuring name, but what has the client actually learned when it returns? Here init returns {:ok, state, {:…
Ambiguous Julia methods and f(2, 3)
Two Julia methods, f(x::Integer, y::Number) and f(x::Number, y::Integer). Each runs a different algorithm, chosen for whichev…
ON CONFLICT DO NOTHING and retried jobs
Answering every unique key conflict with "already accepted" hides three different situations. Two servers, one PostgreSQL tab…
Java declares its dependencies twice and the lists drift
A modular Java project describes its dependencies twice. The build script says which artifacts to download and put on a path.…
