Today was the day I launched this blog. But before that, two other things happened.
I woke up before 5 AM because I could not stop thinking about Uncle Tungsten by Oliver Sacks. I built a scaled periodic table in an ice-cube tray — each cell labelled with the atomic number and the chemical symbol in my handwriting, specimens placed in their actual positions on the table.
Specimens: Fe (26) rusted screw + coin · Cu (29) wire · Ni (28) jumper-wire tip · Al (13) foil + screw (confirmed by negative magnet test) · Zn (30) screw (same test) · W (74) ballpoint-nib tungsten carbide · C (6) pencil graphite · S (16) burnt matchstick residue · Na (11) NaCl · Ca (20) chalk, CaCO3 · I (53) povidone-iodine from the medicine drawer, decanted into cling film and dried onto cotton to isolate the stain. Later added Mn (25) and Cr (24).
The four compound-based identifications (Na, S, Ca, I) are the point: recognising that the element is present inside its compound even when the pure metal isn’t visible. The iodine specimen involved a liquid-to-solid transfer so the specimen displays as “iodine” and not “iodine solution.”
Quicksort is a divide-and-conquer algorithm. The strategy:
quicksort(left) + [pivot] + quicksort(right).I played it by hand on paper first with the list [22, 8, 47, 15, 3, 31, 19]. Pivot 31 → everything smaller goes left, 47 goes right. Then on the left pile pivot 19, then 15, then 3 and 8. After four rounds the base case fires everywhere and the list is sorted: [3, 8, 15, 19, 22, 31, 47].
Then I wrote it in Python:
def quicksort(array):
if len(array) < 2:
return array # base case
else:
pivot = array[0]
less = [i for i in array[1:] if i <= pivot]
greater = [i for i in array[1:] if i > pivot]
return quicksort(less) + [pivot] + quicksort(greater)
print(quicksort([22, 8, 47, 15, 3, 31, 19]))
# [3, 8, 15, 19, 22, 31, 47]
Big O: O(n log n) on average. Each round does O(n) work splitting into piles, and you do about log n rounds of splitting (because each round roughly halves the work). n × log n = n log n. Beats selection sort’s O(n²) badly on big lists. 1000 items at O(n²) is 1,000,000 operations; at O(n log n) it’s about 10,000.
A flashlight has four parts: battery, wire, bulb, switch.
Petzold introduces Ohm’s law: I = E / R (current = voltage ÷ resistance). And power: P = E × I (watts = volts × amps).
The chapter ends with the whole point: a flashlight is either ON or OFF, with no in-between. It is a binary device. Just like Morse (dot/dash), Braille (bump/flat), and binary numbers (0/1). The next chapters are going to use this fact to build an entire computer out of nothing but switches and wires. I noticed that copper, the best cheap conductor, is the same copper I found in my jumper wire this morning for the Metal Lab. Chemistry and circuits are the same substance.
I built this blog today using Jekyll on GitHub Pages. It is my 7th public repo. I wrote the _config.yml, index.md, and about.md myself.
Debugging the theme took longer than writing the posts. I tried the Hacker theme (dark terminal green) which looked beautiful on my phone but served my laptop plain unstyled HTML. I tried remote_theme and theme, I switched to Cayman, I used view-source to see what the browser was actually getting, I watched 13 pages-build-and-deployment workflows run in the Actions tab. In the end the fix was: strip _config.yml to the three essential lines and set index.md to layout: default. The Hacker theme issue stays unsolved — a project for another day.
Takeaway: when something that worked yesterday breaks today, read the actual HTML the server is sending. Don’t assume. Look.
Grokking Chapter 5 (Hash Tables) and Petzold Chapter 5 (Communicating Around Corners).