MongoDB Updated +Created
List databases:
echo 'show dbs' | mongo
Delete database:
use mydb
db.dropDatabase()
or:
echo 'db.dropDatabase()' | mongo mydb
View collections within a database:
echo 'db.getCollectionNames()' | mongo mydb
Show all data from one of the collections: stackoverflow.com/questions/24985684/mongodb-show-all-contents-from-all-collections
echo 'db.collectionName.find()' | mongo mydb
Schoof's algorithm Updated +Created
Alphabet Updated +Created
Trillium Notes Updated +Created
Originally at github.com/zadam/trilium, then after development stopped the community took it up at: github.com/TriliumNext/Notes.
Tree based organization at last. Infinitely deep.
Amazing WYSIWYG, including maths and tables, plus insane plugins like canvas mode, and specific file formats like code/mermaid diagrams/drawing mode.
Intentionally or not, they've basically made an open source Notion, with the possible exception that Notion historically started on web and moved to the desktop, while Trillium went the other way round.
Version history with automatic snapshots at intervals. TODO how is it implemented? Do they just ZIP multiple versions?
No multiuser features. Except for that, could have been a good starting point of an online multiuser thing such as OurBigBook.com!
With Book Notes it is possible possible to see more than one page at a time on the output, which his a major feature of OurBigBook. But does it show on HTML export as well?
You can static HTML export any subtree by right clicking on it in the navigation tree.
Is there a CLI to export to HTML? github.com/zadam/trilium/issues/3012
HTML export keeps all data as HTML is their native format. This may be inherited from CKEditor. The files are mostly visible, but there is some CSS missing, it is not 100% like editor, notably math is broken. There is also a hosted way of exposing: github.com/zadam/trilium/wiki/Sharing.
trilium.rocks however has a very good export, it is just a question of how much they had to hacked things, source at: github.com/zerebos/trilium.rocks
The default tHTML export uses frame navigation, with a toc fixed on the left frame. Efficient, but not of this century.
There is no concept of user created unique text IDs: you can have the same headers in the same folders in the UI. It's not even a matter of scopes. On exports they are differentiated as 1_name, 2_name, etc.
./Trilium Demo/Books/To read/1_HR.md
./Trilium Demo/Books/To read/2_HR.md
./Trilium Demo/Books/To read/HR.md
Markdown export warns:
this preserves most of the formatting
Architecture: runs on local SQLite database via better-sqlite3. Data apparently stored in SQLite database at ~/.local/share/trilium-data, no raw files.
Markup is stored as HTML as seen from: sqlite3 document.db 'SELECT * from note_contents'. HTML is their native storage format, quite interesting. But this means it is not source centric, so any source editing would have to go via import/export. It can be done apparently: github.com/zadam/trilium/wiki/Markdown but involves shoving a ZIP around.
WYSIWYG based on ckeditor.com/ which is a dependency. It is kind of cool that the view in which you view the output is exactly the same as the one you edit in, and there is no intermediate format, just the HTML.
Math is KaTeX based.
It also runs on the browser via a server: github.com/zadam/trilium/wiki/Server-installation. And they have a paid service for it at: trilium.cc/. Quite impressive.
They have server to from desktop sync: github.com/zadam/trilium/wiki/synchronization. There is no conflict resolution, one of them wins randomly. But they have revision history, and anything lost will be in the revision history. They have so many features it is mind blowing.
Maintainer announced he would be slowing down development since January 2024: github.com/zadam/trilium/issues/4620?ref=selfh.st
C. elegans body system Updated +Created
Classification of finite simple groups Updated +Created
Ciro Santilli is very fond of this result: the beauty of mathematics.
How can so much complexity come out from so few rules?
How can the proof be so long (thousands of papers)?? Surprise!!
And to top if all off, the awesomely named monster group could have a relationship with string theory via the monstrous moonshine?
The classification contains:
Video 1.
Simple Groups - Abstract Algebra by Socratica (2018)
Source. Good quick overview.
College of the University of Cambridge Updated +Created
Lamb-Retherford experiment Updated +Created
Published as "Fine Structure of the Hydrogen Atom by a Microwave Method" by Willis Lamb and Robert Retherford (1947) on Physical Review. This one actually has open accesses as of 2021, miracle! journals.aps.org/pr/pdf/10.1103/PhysRev.72.241
Microwave technology was developed in World War II for radar, notably at the MIT Radiation Laboratory. Before that, people were using much higher frequencies such as the visible spectrum. But to detect small energy differences, you need to look into longer wavelengths.
This experiment was fundamental to the development of quantum electrodynamics. As mentioned at Genius: Richard Feynman and Modern Physics by James Gleick (1994) chapter "Shrinking the infinities", before the experiment, people already knew that trying to add electromagnetism to the Dirac equation led to infinities using previous methods, and something needed to change urgently. However for the first time now the theorists had one precise number to try and hack their formulas to reach, not just a philosophical debate about infinities, and this led to major breakthroughs. The same book also describes the experiment briefly as:
Willis Lamb had just shined a beam of microwaves onto a hot wisp of hydrogen blowing from an oven.
It is two pages and a half long.
They were at Columbia University in the Columbia Radiation Laboratory. Robert was Willis' graduate student.
Previous less experiments had already hinted at this effect, but they were too imprecise to be sure.
Laplacian in Einstein notation Updated +Created
Consider a real valued function of three variables:
Its Laplacian can be written as:
It is common to just omit the variables of the function, so we tend to just say:
or equivalently when referring just to the operator:
Larmor precession Updated +Created
The equation is simple: frequency is proportional to field strength!
ELF Hello World Tutorial / .symtab Updated +Created
Section type: sh_type == SHT_SYMTAB.
Common name: "symbol table".
First the we note that:
  • sh_link = 5
  • sh_info = 6
For SHT_SYMTAB sections, those numbers mean that:
  • strings that give symbol names are in section 5, .strtab
  • the relocation data is in section 6, .rela.text
A good high level tool to disassemble that section is:
nm hello_world.o
which gives:
0000000000000000 T _start
0000000000000000 d hello_world
000000000000000d a hello_world_len
This is however a high level view that omits some types of symbols and in which the symbol types . A more detailed disassembly can be obtained with:
readelf -s hello_world.o
which gives:
Symbol table '.symtab' contains 7 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS hello_world.asm
     2: 0000000000000000     0 SECTION LOCAL  DEFAULT    1
     3: 0000000000000000     0 SECTION LOCAL  DEFAULT    2
     4: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT    1 hello_world
     5: 000000000000000d     0 NOTYPE  LOCAL  DEFAULT  ABS hello_world_len
     6: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT    2 _start
The binary format of the table is documented at www.sco.com/developers/gabi/2003-12-17/ch4.symtab.html
The data is:
readelf -x .symtab hello_world.o
which gives:
Hex dump of section '.symtab':
  0x00000000 00000000 00000000 00000000 00000000 ................
  0x00000010 00000000 00000000 01000000 0400f1ff ................
  0x00000020 00000000 00000000 00000000 00000000 ................
  0x00000030 00000000 03000100 00000000 00000000 ................
  0x00000040 00000000 00000000 00000000 03000200 ................
  0x00000050 00000000 00000000 00000000 00000000 ................
  0x00000060 11000000 00000100 00000000 00000000 ................
  0x00000070 00000000 00000000 1d000000 0000f1ff ................
  0x00000080 0d000000 00000000 00000000 00000000 ................
  0x00000090 2d000000 10000200 00000000 00000000 -...............
  0x000000a0 00000000 00000000                   ........
The entries are of type:
typedef struct {
    Elf64_Word  st_name;
    unsigned char   st_info;
    unsigned char   st_other;
    Elf64_Half  st_shndx;
    Elf64_Addr  st_value;
    Elf64_Xword st_size;
} Elf64_Sym;
Like in the section table, the first entry is magical and set to a fixed meaningless values.
Elliptic-curve Diffie-Hellman Updated +Created
The algorithm is completely analogous to Diffie-Hellman key exchange in that you efficiently raise a number to a power times and send the result over while keeping as private key.
The only difference is that a different group is used: instead of using the cyclic group, we use the elliptic curve group of an elliptic curve over a finite field.
Video 1.
Elliptic curves by Computerphile (2018)
Source. youtu.be/NF1pwjL9-DE?t=143 shows the continuous group well, but then fails to explain the discrete part.
Enthalpy Updated +Created
Adds up chemical energy and kinetic energy.
Wikipedia mentions however that the kinetic energy is often negligible, even for gases.
The sum is of interest when thinking about reactions because chemical reactions can change the number of molecules involved, and therefore the pressure.
To predict if a reaction is spontaneous or not, negative enthalpy is not enough, we must also consider entropy via Gibbs free energy.
Entrepreneurship at the University of Cambridge Updated +Created
Erik Finman Updated +Created
www.unilad.com/technology/erik-finman-bitcoin-12-year-old-millionaire-invest-798094-20231207
In 2011, Finman made a deal with his parents that he would not pursue a college degree as he wanted to make his fortune outside of traditional education.
After receiving $1,245 from his grandmother that year, Finman invested into Bitcoin (BTC) - which was then trading at around $12 - and this gave him about 103 BTC.
Shame that he seems to be a American exceptionalism idiot. Perhaps it was inevitable given his circonstances. After a small market crash: x.com/erikfinman/status/1820457023013626322.
Opportunities like this come across only once every few years.
This ain’t financial advice…
But if you got the cash.
Never bet against America
UNION (SQL) Updated +Created
Basic example tested on SQLite 3.40.1, Ubuntu 23.04:
sqlite3 :memory: 'select 1 union select 2'
output:
1
2
Two columns two rows:
sqlite3 :memory: <<EOF
select * from (values (1, 2), (2, 3))
union
select * from (values (2, 3), (3, 4))
EOF
output:
1|2
2|3
3|4
Note how duplicates are removed, to keep them we UNION ALL instead:
sqlite3 :memory: <<EOF
select * from (values (1, 2), (2, 3))
union all
select * from (values (2, 3), (3, 4))
EOF
output:
1|2
2|3
2|3
3|4

There are unlisted articles, also show them or only show them.