SQLite Updated 2025-07-16
The minimalism, serverlessness/lack of temporary caches/lack of permission management, Hipp's religious obsession with efficiency, the use of their own pure Fossil version control[ref]. Wait, scrap that last one. Pure beauty!
Official Git mirror: github.com/sqlite/sqlite
Create a table
sqlite3 db.sqlite3 "
CREATE TABLE 'IntegerNames' (int0 INT, char0 CHAR(16));
INSERT INTO 'IntegerNames' (int0, char0) VALUES (2, 'two'), (3, 'three'), (5, 'five'), (7, 'seven');
"List tables:output:
sqlite3 db.sqlite3 '.tables'IntegerNamesShow schema of a table:outputs the query that would generate that table:
sqlite3 db.sqlite3 '.schema IntegerNames'CREATE TABLE IF NOT EXISTS 'IntegerNames' (int0 INT, char0 CHAR(16)); SQLite isolation levels Updated 2025-07-16
The default isolation level for SQLite is SERIALIZABLE
It does not appear possible to achieve the other two levels besides SERIALIZABLE and READ UNCOMMITED
nodejs/read_child_process_lines.js Updated 2025-07-16
SQL REPEATABLE READ isolation level Updated 2025-07-16
Vs SQL SERIALIZABLE isolation level on PostgreSQL: dba.stackexchange.com/questions/284744/postgres-repeatable-read-vs-serializable
nodejs/sequelize/raw/parallel_create_delete_empty_tag.js is an example which experimentally seems to be solved by
REAPEATABLE READ, although we are not sure that this is truly the case and why. What is clear is that that example is not solved by the SQL READ COMMITTED isolation level.In PostgreSQL, this is the first isolation level which can lead to postgreSQL serialization failures, this does not happen to SQL READ COMMITTED isolation level in that DBMS. You then have to retry the transaction.
How to blackout your window without drilling One year update Updated 2025-07-16
One problem popped up about one year after having bought the blinds in 2019: the blind won't stay still except at the most closed position. Anywhere above it started to slowly go up by itself.
riscv/timer.S Updated 2025-07-16
TODO: the interrupt is firing only once:
Adapted from: danielmangum.com/posts/risc-v-bytes-timer-interrupts/
Tested on Ubuntu 23.10:Then on shell 1:and on shell 2:GDB should break infinitel many times on
sudo apt install binutils-riscv64-unknown-elf qemu-system-misc gdb-multiarch
cd riscv
makeqemu-system-riscv64 -machine virt -cpu rv64 -smp 1 -s -S -nographic -bios none -kernel timer.elfgdb-multiarch timer.elf -nh -ex "target remote :1234" -ex 'display /i $pc' -ex 'break *mtrap' -ex 'display *0x2004000' -ex 'display *0x200BFF8'mtrap as interrupts happen. Find MAC address of a device on the other end of an Ethernet cable Updated 2025-07-16
Formal proof is useless Updated 2025-07-16
The only cases where formal proof of theorems seem to have had actual mathematical value is for theorems that require checking a very large number of case, so much so that no human can be fully certain that no mistakes were made. Some examples:
Functional Analysis I course of the University of Oxford 2023-2024 Updated 2025-07-16
Open access with solutions: courses.maths.ox.ac.uk/course/view.php?id=4988
Lecturer: Luc Nguyen
Genesis block output address Updated 2025-07-16
SQL tree traversal Updated 2025-07-16
Example: nodejs/sequelize/raw/tree.js
- Implementation agnostic
- Postgres
- stackoverflow.com/questions/67848017/simple-recursive-sql-query
- stackoverflow.com/questions/28688264/how-to-traverse-a-hierarchical-tree-structure-structure-backwards-using-recursiv
- stackoverflow.com/questions/51822070/how-can-postgres-represent-a-tree-of-row-ids
- depth first
- uspecified depth first variant
- preorder DFS
- breadth-first stackoverflow.com/questions/3709292/select-rows-from-table-using-tree-order
- MySQL
- Microsoft SQL Server
SQL window
RANGE Updated 2025-07-16rm -f tmp.sqlite
sqlite3 tmp.sqlite "create table t (id integer, val integer)"
sqlite3 tmp.sqlite <<EOF
insert into t values
(0, 0),
(1, 5),
(2, 10),
(3, 14),
(4, 15),
(5, 16),
(6, 20),
(7, 25),
(8, 29),
(9, 30),
(10, 30),
(11, 31),
(12, 35),
(13, 40)
EOFShow how many neighbours each column has with Output:
val between val - 2 and val + 2 inclusive:sqlite3 tmp.sqlite <<EOF
SELECT id, val, COUNT(*) OVER (
ORDER BY val RANGE BETWEEN 2 PRECEDING AND 2 FOLLOWING
) FROM t;
EOF0|0|1
1|5|1
2|10|1
3|14|3
4|15|3
5|16|3
6|20|1
7|25|1
8|29|4
9|30|4
10|30|4
11|31|4
12|35|1
13|40|1val - 1 and val + 1 inclusive instead:sqlite3 tmp.sqlite <<EOF
SELECT id, val, COUNT(*) OVER (
ORDER BY val RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING
) FROM t;
EOF0|0|1
1|5|1
2|10|1
3|14|2
4|15|3
5|16|2
6|20|1
7|25|1
8|29|3
9|30|4
10|30|4
11|31|3
12|35|1
13|40|1There seems to be no analogue to HAVING for window functions, so we can just settle for a subquery for once, e.g.:which outputs:
sqlite3 tmp.sqlite <<EOF
SELECT * FROM (
SELECT id, val, COUNT(*) OVER (
ORDER BY val RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING
) as c FROM t
) WHERE c > 2
EOF4|15|3
8|29|3
9|30|4
10|30|4
11|31|3 glTF Updated 2025-07-16
Official demos: github.com/KhronosGroup/glTF-Sample-Assets These are visible at: github.khronos.org/glTF-Sample-Viewer-Release/ with a JavaScript viewer present at: github.com/KhronosGroup/glTF-Sample-Viewer TODO can you load models on the web?
Supports animations, e.g.:
gltf-viewer.donmccurdy.com/ is based on doesn't work with those examples because they have separate asset files.
f3d just worked for it.
Hidden Answers Updated 2025-07-16
ROCm Updated 2025-07-16
ROCm on Ubuntu Updated 2025-07-16
Tested on Ubuntu 23.10 with P14s:TODO fails with:
sudo apt install hipcc
git clone https://github.com/ROCm/HIP-Examples
cd HIP-Examples/HIP-Examples-Applications/HelloWorld
make/bin/hipcc -g -c -o HelloWorld.o HelloWorld.cpp
clang: error: cannot find ROCm device library for gfx1103; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
make: *** [<builtin>: HelloWorld.o] Error 1 Infrastructure as a service Updated 2025-07-16
SQUID device Updated 2025-07-16
Superconducting Quantum Interference Device by Felipe Contipelli (2019)
Source. Good intuiotionistic video. Some points deserved a bit more detail.Mishmash of SQUID interviews and talks by Bartek Glowaki
. Source. The videos come from: www.ascg.msm.cam.ac.uk/lectures/. Vintage.
One of the segments is by John Clarke.
An experimental lab video for COVID-19 lockdown. Thanks, COVID-19. Presented by a cute and awkward Adam Stewart.
Uses a SQUID device and control system made by STAR Cryoelectronics. We can see Mr. SQUID EB-03 written on the probe and control box, that is their educational product.
As mentioned on the Mr. SQUID specs, it is a high-temperature superconductor, so liquid nitrogen is used.
He then measures the I-V curve on an Agilent Technologies oscilloscope.
Unfortunately, the video doesn't explain very well what is happening behind the scenes, e.g. with a circuit diagram. That is the curse of university laboratory videos: some of them assume that students will have material from other internal sources.
- youtu.be/ql2Yo5LgU8M?t=211 shows the classic voltage oscillations, presumably on a magnetic field sweep, and then he puts a magnet next to the device from outside the Dewar
- youtu.be/ql2Yo5LgU8M?t=253 demonstrates the formation of Shapiro steps. Inserts a Rohde & Schwarz signal generator into the Dewar to vary the flux. The result is not amazing, but they are visible somewhat.
Stack Overflow content deletion Updated 2025-07-16
Stack overflow allows deleting content/making it visible only to 10k rep users.
Ciro Santilli is strictly against this, and this is an intended core policy of OurBigBook.com.
If you delete people's content randomly, they will be much less likely to write anything.
Getting downvoted to oblivion is one thing, but data loss? Unacceptable.
Only illegal content must ever be deleted. Or extremely obvious spam. But anything in a gray area should never be removed.
Deletion can be done by either:
- votes of high reputation users
- moderators
- or worse of all, which happens often on the smaller websites: auto-deletion because come content has not received enough views/votes above some treshold! stackoverflow.com/help/auto-deleted-questions. The most illogical thing of all is that the question is not even permanently removed from the system, only hidden from other/low reputation users! So it does not save any disk space at all! Mind blowing!
There are unlisted articles, also show them or only show them.
