Educational Cards
Learn from video content, text, and interactive tasks
Filters
JIT accelerators caveats
Numba (and similar tools) compile restricted Python/NumPy loops to machine code. They shine on...
Type hints aiding maintainability—not runtime magic
PEP 484 annotations document expected types for humans and for static checkers ( mypy , pyright ,...
Exceptions signal contract violations cleanly
Return codes like -1 or sentinel strings collide with legitimate data: a temperature of -1 might be...
Normalising calculators and tokens
Human-entered expressions mix Unicode spaces, x for multiplication, and locale-specific decimals....
Structured token ladders
Unary-free arithmetic ladders alternate operand, operator, operand, … with odd length: [10, '+', 2,...
Guard clauses before brittle arithmetic
Division, logarithms, and normalisations explode on zero or negative values in the wrong domain....
Network-shaped failures without fragile parsing
HTTP layers deliver bytes on the wire; JSON parsers want text ; base64 wraps binary inside ASCII....
Whitelist vs blacklist at simple parsers
A whitelist allows only known-good characters ( [a-z0-9_-] for slugs). A blacklist bans known-bad...
Static methods versus instance misuse
@staticmethod functions live in class namespace but do not receive self or cls . They are plain...
Assertions vs validator contracts
assert condition documents internal invariants you believe should already hold: “this tensor is 2-D...
Empirical timings with perf_counter
time.perf_counter() returns a float timestamp from a monotonic clock suitable for deltas : subtract...
Big-O: describe growth, not microseconds
Big-O notation answers: “If I double the training set / feature dimension / graph size, what...