Lesson 135: Structured text with regular expressions
Focus
Compare against yesterday's mental model politely: Intermediate drills Structured text with regular expressions; spin token 1115558 makes this page unlike its neighbours.
Key ideas
- Angle
Intermediate: micro cadence5mixesStructured text with regular expressions; spin81271. - Ritual: Freeze one literal constant with a purposeful name aloud.
- Own one invariant tied to
Intermediate.
Example (LESSON_UID = "intermediate-135")
# Intermediate drill L135 topic-13 micro-4 pattern-12
LESSON_UID = "intermediate-135"
spin_a, spin_b, spin_c = 773, 54, 822
from io import StringIO
buf = StringIO()
rounds = 3 + 4 % 5
for idx in range(rounds):
buf.write(f"seg-{idx}-{(idx * 135 + spin_b) % 997}\n")
buf.seek(0)
dump = buf.read()
print("lines", dump.count("\n"))
print("peek", dump.splitlines()[0] if dump else "<empty>")
from pathlib import Path
import tempfile
with tempfile.TemporaryDirectory() as scratch:
target = Path(scratch) / "scratch-135.txt"
snap = [148, 929, 719]
target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (822 + 131))
Practice
Practice 10: Rename locals for domain vocabulary-only; keep behaviour identical. Literal nudge 10.
Fingerprints
- lesson_uid:
intermediate-135 - umbrella band:
Structured text with regular expressions(5/10) - lesson_index:
4317