Lesson 136: Structured text with regular expressions
Focus
Treat the excerpt as executable notes: Intermediate drills Structured text with regular expressions; spin token 1163850 makes this page unlike its neighbours.
Key ideas
- Angle
Intermediate: micro cadence6mixesStructured text with regular expressions; spin73420. - Ritual: Swap one benign literal twice to see binding effects.
- Guardrail: promise one security boundary if this touched user data.
Example (LESSON_UID = "intermediate-136")
# Intermediate drill L136 topic-13 micro-5 pattern-7
LESSON_UID = "intermediate-136"
spin_a, spin_b, spin_c = 754, 320, 680
src = [((k + 136) * spin_a + 5) % 241 for k in range(4 + 5 % 3)]
derived = [v * v if v % 2 == 0 else v + spin_b for v in src]
print("src", src)
print("derived", derived)
print("zip_sum", sum(x + y for x, y in zip(src, derived)))
from pathlib import Path
import tempfile
with tempfile.TemporaryDirectory() as scratch:
target = Path(scratch) / "scratch-136.txt"
snap = [149, 912, 684, 456]
target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (680 + 131))
Practice
Practice 41: Discuss packaging layout deltas if helpers became a module. Literal nudge 41.
Fingerprints
- lesson_uid:
intermediate-136 - umbrella band:
Structured text with regular expressions(6/10) - lesson_index:
4356