Random snippets of all sorts of code, mixed with a selection of help and advice.
Is this floating-point thermistor beta equation robust?
7 February 2026 @ 8:45 pm
I'll try to be judicious in how much context I include here. I will lead with my primary question and then fill out more context.
Question
Is there a different form of my equation that will be more numerically robust, especially against risks like catastrophic cancellation?
Context
I wrote an implementation of the beta equation
from semiconductor physics. The implementation should use single precision, is in C, and targets a small Arm Cortex-M4F core with an FPU that supports FPv4-SP:
The Cortex-M4F FPU implements the FPv4-SP floating-point extension.
The FPU fully supports single-precision add, subtract, mult
from semiconductor physics. The implementation should use single precision, is in C, and targets a small Arm Cortex-M4F core with an FPU that supports FPv4-SP:
The Cortex-M4F FPU implements the FPv4-SP floating-point extension.
The FPU fully supports single-precision add, subtract, multMerging the headers then concatenate the records of a huge number of text files
7 February 2026 @ 8:40 pm
I would like to fuse a huge number of big (~10GiB) text files in VCF format. The operation requires to parse all the headers in order to generate and output a new, merged, one and then concatenate all the records while keeping the input files order; I was planning to do it with awk but stumbled with a few problems.
The first problem is that I can't concatenate the records after reading the headers; here's a simple example illustrating it:
#!/bin/bash
awk '
BEGIN {
getline a < ARGV[1];
getline b < ARGV[2];
print "#", a;
print "#", b;
}
1
' <(printf '%s\n' A a1 a2) <(printf '%s\n' B b1 b2 b3)
#A
#B
awk: warning: close of fd 62 (`/dev/fd/62') failed (Bad file descriptor)
awk: warning: close of fd 63 (`/dev/fd/63') failed (Bad file descriptor)
T
"from torch_geometric.data import Data" throwing an error
7 February 2026 @ 8:25 pm
If I run a py module with only these imports (no additional code) it works fine and the output is Process finished with exit code 0:
import torch.utils.data
from torch.utils.data.dataloader import default_collate
But if I add this third import:
import torch.utils.data
from torch.utils.data.dataloader import default_collate
from torch_geometric.data import Data
The output is:
Process finished with exit code 139 (interrupted by signal 11:SIGSEGV)
I haven't the slightest idea of what is happening. If I do a pip list these are the packages installed in the venv:
Package Version
------------------------ ----------------
aiohappyeyeballs 2.6.1
aiohttp 3.13.3
aiosignal 1.4.0
attrs 25.4.0
autograd 1.8.0
autograd-gamma 0.5.0
certifi 2026.1.4
cha
How can I match attributes with a value of A, B, or C in a single uBlock Origin filter?
7 February 2026 @ 8:23 pm
I am trying to create a filter in uBlock Origin that blocks elements where an attribute value is equal to one of several different values. (A, B, or C).
For example, let's say I want to block span elements where the author attribute was an exact match for "alice", "bob", or "carol". I could write separate rules for each author name:
example.com##span[author="alice"]
example.com##span[author="bob"]
example.com##span[author="carol"]
However, this becomes difficult to maintain when working with more complex filter rules or matching against a large list of values. (For example, blocking posts from 170 subreddits or
How can I draw a square with a linear gradient fill inside a TPaintBox in Delphi FMX?
7 February 2026 @ 8:03 pm
I'm trying to draw a simple square with a gradient fill using a TPaintBox in Delphi FMX. I can draw shapes and solid colors without any issues, but I can't figure out how to apply a gradient inside the square during the OnPaint event.
Here’s the basic structure of what I have so far:
procedure TForm1.PaintBox1Paint(Sender: TObject; Canvas: TCanvas);
begin
Canvas.BeginScene;
try
// I need to draw square here with gradient fill
finally
Canvas.EndScene;
end;
end;
I’m not sure how to correctly configure and apply them to a rectangle drawn manually on a TPaintBox.
What is the correct way to draw a square with a gradient fill inside a TPaintBox?
Are soft object pointers guaranteed to async resolve if they are given a correct path to a correct object?
7 February 2026 @ 6:21 pm
By correct object I mean something that would otherwise be created when resolving a normal pointer.
Suppose I async load a soft pointer and store it in an object pointer at completion (to create a hard reference), are there realistic scenarios where that TObjectPtr is invalid?
Local variables aren't displaying in Codelite
7 February 2026 @ 6:00 pm
I have installed the latest version of Codelite which is 18.0 and I have the latest version of MinGW on my system. When, however, I use this IDE in my projects and I want to debug the projects, the window that's supposed to display local variables is empty:
How can I fix this?
How can I fix this?VS Code suddenly slow to open, how to fix?
7 February 2026 @ 5:36 pm
Suddenly, my VS Code (version 1.109) has started taking 8-10 seconds to open. Earlier, it used to open instantly. My laptop is fast and other apps open quickly, but VS Code is slow. How can I resolve this?
MimeKit Memory access violations after repeated runs
7 February 2026 @ 5:14 pm
I have a VB.NET (.NET Framework 4..6.2) application that runs as a Scheduled Task (Windows Server) every 5 minutes. On each run it checks a database and, if anything is there, fetches a collection of class objects, clsMailQ, the properties of which include the necessary information for creating emails: .sTo - the email address of the recipient, sSubject = the subject line, etc etc. All pretty obvious.
It runs fine... for a few hours, then crashes, with Task Scheduler returning the error 0xC0000005 which appears to denote a memory access violation.
This is a new application, with MimeKit installed through Visual Studio and Nuge4.14.0.0t, and the MimeKit dll tells me it's version 4.14.0.0
Below is the basic code (I've stripped this down to the essential bits - ie removed error catching etc) -. I'd be grateful in anyone can tell me what I can do to avoid the memory issue. Am I doing something wrong / silly? This application needs to run every 5 minutes 24/7 ...
Query deeply nested document with dynamic key
7 February 2026 @ 5:03 pm
I want to return a specific subdocument which is nested in a second level array.
My problems are:
The document is deeply nested
The fields (keys) are dynamic and based on req.body values
The collection looks something like this (simplified values for the example):
leagues:[
{
"_id": "693ae6dc320b2bb92635361e",
"cards": [
{
"_id": "600056266",
"users": [
{
"_id": "EafXiJktdKSM45OcnniU4gpcGWc2",
"vote": {
"234": {
"W": "56",
"M": "543",
"R": "322"
},