Results for “Records & reliable control flow”
Small, practical examples. Search by task or narrow things down below.
Subtract durations without underflow
Subtract durations without underflow in a complete Rust program using the standard library.
Rust✓ Tested
Use named states for a controller
Arduino / C: An enum makes state transitions easier to read than unexplained numbers.
Arduino / C✓ Tested
Visually distinguish a disabled control
CSS: The disabled pseudo-class follows the control’s actual disabled state.
CSS✓ Tested
Write object records to a CSV file
PowerShell: Export-Csv uses property names as headers and quotes values when needed.
PowerShell✓ Tested
Add a calculated property during selection
PowerShell: A calculated property can derive a value while retaining selected original properties.
PowerShell✓ Tested
Add inner spacing to a content-sized box
CSS: In content-box sizing, padding adds to the declared content width.
CSS✓ Tested
Add spacing between characters
CSS: Letter-spacing adds a consistent amount between typographic characters.
CSS✓ Tested
Align inline text to the container’s end edge
CSS: Text-align end follows the writing direction rather than always choosing the right edge.
CSS✓ Tested
Allow long content to scroll
CSS: Learn how to allow long content to scroll in a complete browser example.
CSS✓ Tested
Attach configuration when registering a handler
jQuery: event.data carries the registration-time data object.
jQuery✓ Tested
Cap a box’s width
CSS: Max-width constrains an otherwise larger declared width.
CSS✓ Tested
Check an array allocation size before multiplying
C: Compare the requested element count against SIZE_MAX divided by element size.
C✓ Tested