How the K-ary tree is used in x86 by Ciro Santilli 35 Updated +Created
x86's multi-level paging scheme uses a 2 level K-ary tree with 2^10 bits on each level.
Addresses are now split as:
| directory (10 bits) | table (10 bits) | offset (12 bits) |
Then:
  • the top 10 bits are used to walk the top level of the K-ary tree (level0)
    The top table is called a "directory of page tables".
    cr3 now points to the location on RAM of the page directory of the current process instead of page tables.
    Page directory entries are very similar to page table entries except that they point to the physical addresses of page tables instead of physical addresses of pages.
    Each directory entry also takes up 4 bytes, just like page entries, so that makes 4 KiB per process minimum.
    Page directory entries also contain a valid flag: if invalid, the OS does not allocate a page table for that entry, and saves memory.
    Each process has one and only one page directory associated to it (and pointed to by cr3), so it will contain at least 2^10 = 1K page directory entries, much better than the minimum 1M entries required on a single-level scheme.
  • the next 10 bits are used to walk the second level of the K-ary tree (level1)
    Second level entries are also called page tables like the single level scheme.
    Page tables are only allocated only as needed by the OS.
    Each page table has only 2^10 = 1K page table entries instead of 2^20 for the single paging scheme.
    Each process can now have up to 2^10 page tables instead of 2^20 for the single paging scheme.
  • the offset is again not used for translation, it only gives the offset within a page
One reason for using 10 bits on the first two levels (and not, say, 12 | 8 | 12 ) is that each Page Table entry is 4 bytes long. Then the 2^10 entries of Page directories and Page Tables will fit nicely into 4Kb pages. This means that it faster and simpler to allocate and deallocate pages for that purpose.
Nuxt.js by Ciro Santilli 35 Updated +Created
Launchpad (website) by Ciro Santilli 35 Updated +Created
Superconducting qubit type by Ciro Santilli 35 Updated +Created
Nested set model by Ciro Santilli 35 Updated +Created
This is particularly important in SQL: Nested set model in SQL, as it is an efficient way to transverse trees there, since querying parents every time would require multiple disk accesses.
As a tree:
  • Root 1
    • Child 1.1
      • Child 1.1.1
      • Child 1.1.2
    • Child 1.2
      • Child 1.2.1
      • Child 1.2.2
As the sets:
 __________________________________________________________________________
|  Root 1                                                                  |
|   ________________________________    ________________________________   |
|  |  Child 1.1                     |  |  Child 1.2                     |  |
|  |   ___________    ___________   |  |   ___________    ___________   |  |
|  |  |  C 1.1.1  |  |  C 1.1.2  |  |  |  |  C 1.2.1  |  |  C 1.2.2  |  |  |
1  2  3___________4  5___________6  7  8  9___________10 11__________12 13 14
|  |________________________________|  |________________________________|  |
|__________________________________________________________________________|
Consider the following nested set:
0, 8, root
  1, 7, mathematics
    2, 3, geometry
      3, 6, calculus
        4, 5, derivative
        5, 6, integral
      6, 7, algebra
  7, 8, physics
When we want to insert one element, e.g. limit, normally under calculus, we have to specify:
  • parent
  • index within parent
so we have a method:
insert(parent, previousSibling)
SELECT (SQL) by Ciro Santilli 35 Updated +Created
SQLite by Ciro Santilli 35 Updated +Created
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:
sqlite3 db.sqlite3 '.tables'
output:
IntegerNames
Show schema of a table:
sqlite3 db.sqlite3 '.schema IntegerNames'
outputs the query that would generate that table:
CREATE TABLE IF NOT EXISTS 'IntegerNames' (int0 INT, char0 CHAR(16));
Show all data in a table:
sqlite3 db.sqlite3 'SELECT * FROM IntegerNames'
output:
2|two
3|three
5|five
7|seven
Spin-transfer torque by Ciro Santilli 35 Updated +Created
Video 1.
Introduction to Spintronics by Aurélien Manchon (2020) spin-transfer torque section
. Source.
Describes how how spin-transfer torque was used in magnetoresistive RAM
20% time rule by Ciro Santilli 35 Updated +Created
The Google Story suggests that this practice existed in academia, where it was brought from. But I can't find external references to it easily:
At Google, the preference is for working in small teams of three, with individual employees expected to allot 20 percent of their time to exploring whatever ideas interest them most. The notion of "20 percent time" is borrowed from the academic world, where professors are given one day a week to pursue private interests.
ORF1ab by Ciro Santilli 35 Updated +Created
How large primes are found for RSA by Ciro Santilli 35 Updated +Created
Answers suggest hat you basically pick a random large odd number, and add 2 to it until your selected primality test passes.
The prime number theorem tells us that the probability that a number between 1 and is a prime number is .
Therefore, for an N-bit integer, we only have to run the test N times on average to find a prime.
Since say, A 512-bit integer is already humongous and sufficiently large, we would only need to search 512 times on average even for such sizes, and therefore the procedure scales well.
Raspberry Pi Pico variant by Ciro Santilli 35 Updated +Created
Quantum field theory lecture by Tobias Osborne (2017) by Ciro Santilli 35 Updated +Created
This is a bit "formal hocus pocus first, action later". But withing that category, it is just barely basic enough that 2021 Ciro can understand something.
Lecture notes transcribed by a student: github.com/avstjohn/qft
18 1h30 lectures.
Protein dimer by Ciro Santilli 35 Updated +Created
Earth by Ciro Santilli 35 Updated +Created
Neptune by Ciro Santilli 35 Updated +Created
Quite cool how it was discoverd by the perturbation of Uranus' orbit.
Photonics equipment by Ciro Santilli 35 Updated +Created
Arm on tracks by Ciro Santilli 35 Updated +Created
Snakes and Ladders by Ciro Santilli 35 Updated +Created
"Game" is a bit of a stretch as there are no player choices at all.
A more precise word would be simulation.
More precise, this "game" is exactly an absorbing Markov chain.

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