@eniko I looked at a library the other day that did CPU feature detection. You'd think that would be a lot of CPUID stuff - just a bit of assembly, or some C intrinsics, yeah?
I looked at the FreeBSD support and found it worked by parsing out the Features= line out of /var/run/dmesg.boot.
CPython interns integers in the range [-5, 256] (both inclusive). Does anyone know why it's -5, and why the upper limit is 256 and not 255? Is it just arbitrary?
I wish I had a single unix command-line tool that presented a single command-line interface but can work with all the various compression formats I use (tgz, 7zip, zip, etc).
Currently zip, 7z, tar, zstd etc all use different tools with totally different interfaces. I find myself needing to consult one or another --help far more than I should. zstd just startled me greatly when I discovered that zstd -d by default writes the output file in the same directory as the input file rather than pwd
@grumpygamer I'm not too familiar with SQLite. Let's see.
INSERT INTO kv_store (project, key, value, time) VALUES (?, ?, ?, datetime()) ON CONFLICT (project,key) DO UPDATE SET value=value+?,time=datetime() RETURNING VALUE
@grumpygamer Ah, I see, rows are immutable and it's all append-only. Yeah, an index on (key,id) might be good for performance.
How about something like this:
INSERT INTO kv_store(project,key,value,time) VALUES (?,?,? + COALESCE((SELECT value FROM kv_store WHERE project=? AND key=? ORDER BY id DESC LIMIT 1), 0),datetime()) RETURNING value