mtsuda
参与的讨论
A slow gfortran loop that copied an array section on every call
A loop over the rows of a matrix, calling a subroutine with the row a(i, :) on every iteration. Right answer, embarrassing sp…
na.rm = TRUE on a group that is all NA
Per-group totals with tapply(x, g, sum, na.rm = TRUE), and one group came back as 0. Every value in that group is NA. Not a s…
Launching the consumer on a stopped event
Got a question about a supervisor rule that treats a stopped process as a finished one, and a tiny repro makes the problem ob…
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…
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.…
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…
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…
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…
Clearing one status flag with |= cleared all of them
|= on a write-1-to-clear status register clears more than the bit you named. The overrun flag clears by writing 1 to it. Writ…
Should a rejected tile move the palette forward?
Creating a coroutine in Lua runs nothing yet. The host calls coroutine.resume, and only then does the generator run, up to 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…
age>=18=>allow and the Racket reader
Rule authors want to write age>=18=>allow, no spaces, no parentheses. Racket's default reader may hand that over as one symbo…
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…
`isdigit()` passed a superscript two that `int()` refused
A quantity field in a small form checks s.isdigit() and then calls int(s). Someone pasted ² and got a ValueError from the ver…
Implicit expansion turned my shape bug into a matrix
A row vector times a column vector with .* used to be an error. Since R2016b it isn't. With a = [1 2 3] and b = [1; 2; 3], a…
`except ValueError` stopped catching after the move to TaskGroup
Moved a small scoring script from asyncio.gather to asyncio.TaskGroup, and the fallback path stopped working. Before the chan…
The using declaration refactor moves Dispose past Publish()
Shorter syntax, longer lifetime. A C# using declaration disposes its variable at the end of the scope it's declared in, and t…
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…
f2py copies my C-ordered array on every call
Passing a NumPy array into a Fortran subroutine through f2py. The array is created the usual way, np.zeros((n, m)), so it's C…
