Computer Sciencefor Theatre & Technical Direction

ReferenceExaminable

Numbers to know

Every number the course expects you to have, in class order. It is generated from the classes themselves, so it cannot drift from what you were actually taught. There is a short verbal quiz at the top of every class, drawn from this deck, so nothing in it is a surprise and nothing in it is a trick.

Drill these

Class 1 · Why a Technical Director Writes Code #

ThingValue
Operations a modern CPU core executes per secondRoughly 10⁹, a thousand million
What a computer fundamentally doesFetch, arithmetic, store, decide what is next
Layers between a voltage and a cue buttonAbout eight
The four questionsState, each pass, assumptions, failure
Loop rate for sleep(0.02)50 times per second, ignoring the work itself
Human perception threshold for a light changeAround 10 to 20 ms
Frames at 25 fps40 ms each
Automate whenTimes × duration exceeds writing plus maintenance, or hand work is error-prone
The four failure modesCrash, hang, hold last value, carry on regardless
Default failure mode if nobody choosesCarry on regardless
What a fixture does on DMX lossHolds its last look
What an amplifier does on clock lossMutes
What a hoist does on signal lossStops and holds

Class 2 · Inside the Language #

ThingValue
Steps from source text to executionFour: lex, parse, compile, execute
Why 2 + 3 * 4 is 14Precedence is in the tree the parser builds
Bits in a double-precision float significand53
Relative error of a doubleAbout 1 part in 10¹⁶
0.1 + 0.2 in any IEEE 754 language0.30000000000000004
Safe float comparisonabs(a - b) < tolerance
Range of an 8-bit unsigned integer0 to 255, which is one DMX slot
Range of a 16-bit unsigned integer0 to 65535, which is 16-bit pan or tilt
DMX universe size512 slots
What arrives from a file, network or serial portText, always, until you convert it
Simple values on assignmentCopied
Collections on assignmentReferenced, not copied
The four shapes of control flowSequence, branch, loop, call
The first thing to read in any functionIts signature, then one line of the docstring
What a patcher isThe parser's tree, edited directly, with the parsing step removed
Ladder logicA graphical language in IEC 61131-3, and what runs safety-rated automation
What block languages removeSyntax errors, not any of the four questions
Where a patch is weakestVersion control, search, review, reuse and scale
An unconnected input in most node environmentsSilently zero, black or the last value, reported by nothing
C1972, for writing an operating system without assembly
Python1991, for scripting that is pleasant to read
JavaScript1995, designed in ten days, and it owns the browser by being the only option
Lua1993, small enough to embed inside another application
Rust2010, memory safety without a garbage collector
Ladder logic1960s, so electricians could program controllers from relay diagrams
Why a language dominates a fieldIts original constraint is still that field's constraint
What the ceremony around hello world tells youWhat the language decided to buy, and what it charged for it

Class 3 · Data, Structure and Keeping the Work #

ThingValue
Finding an item in a list of nUp to n comparisons
Finding an item in a dictionaryOne lookup, regardless of size
A loop inside a loop over the same datan², the shape that ambushes you
4000 items, compared every pair16 million operations, about 0.2 s
20 000 items, compared every pair400 million operations, about 30 s
Sorting n itemsn log n
What a git commit storesA snapshot of every file, not a difference
Commands covering 90 per cent of solo gitinit, add, commit, log, checkout
Date format that sorts correctlyISO 8601: YYYY-MM-DD
Bisections to search 1000 linesAbout 10
Where to convert text to numbersAt the boundary, on the way in
What an empty CSV field meansWhatever you decided in writing. Otherwise, a future argument
Copies of a repository needed for it to be a backupAt least two, on different machines
Lines in a project READMEAbout ten, and never zero

Class 4 · Coding With AI #

ThingValue
What a model computesA probability distribution over the next token
A token, in EnglishAbout 0.75 of a word, three to four characters
A token, in codeRather less; punctuation and identifiers split
Context window, current frontier modelsAround one million tokens
Context window, smaller and older models200 000 tokens or fewer
Relative cost of output tokensSeveral times input, typically about five
Cost of a cached prefix re-readA large discount, on exact prefix match
Cost of asynchronous batch workTypically about half
Where the model is strongestCommon languages, conventional structure, boilerplate
Where it is weakestNiche industry tooling, undocumented hardware, your rig
Steps in the loopDescribe, draft, read, run on a copy, prove by hand, commit
First thing to read in generated codeAnything that deletes, overwrites or writes
Most common dangerous generated behaviourSilently skipping the rows it could not parse
What never goes to a modelCredentials, NDA material, personal data, network diagrams
What a model never sits betweenA performer and a machine

Class 5 · From Code to Effect: Arduino and Raspberry Pi #

ThingValue
Microcontroller response timeMicroseconds, consistent
Raspberry Pi boot time20 to 40 seconds
A Pi's response timeUsually milliseconds. Not guaranteed
Button debounceIgnore changes for 20 to 50 ms
Human-imperceptible check interval for a button10 ms
DMX512 data rate250 kbit/s
DMX512 full frameUp to 23 ms, so 44 refreshes per second maximum
DMX slots in one universe512
RGB pixels in one universe170
Bytes per RGB pixel per frame3
WS2812 write time per pixelAbout 30 microseconds
1000 WS2812 pixels, one frameAbout 30 ms of blocking write
5000 pixels at 40 fps600 kB/s, and 30 universes
millis() wrap periodAbout 49 days
Correct timing comparisonmillis() - started >= interval
A microcontroller pin's current limitAbout 20 mA, and less across the whole chip
Cue timeout before going safeDecided in the design meeting, written down

Class 6 · Capstone: Build It, Prove It, Hand It Over #

ThingValue
The four steps of doneWorks, survives, fails as chosen, somebody else can run it
Time in this class on making it workOne hour of four
Time on everything after thatNearly three hours of four, which is the ratio of the job
Lines in a READMEAbout ten, and never zero
Sentences specifying an effectFive: what, what starts it, twice, power loss, who is near
Scope test for a capstoneCould you finish it badly in an afternoon
First thing to check in somebody else'sCan you run it from the README alone
First code to read in somebody else'sEverything that writes or deletes
Safe to run twiceIdempotent, and worth roughly double one that is not
Required before anything destructiveA dry run, and a copy
What a finding should containWhat you did, what happened, and the row or the traceback
Who is responsible for a generated lineWhoever shipped it
Value of a tool nobody else can runZero, from the day you are unavailable