FIND YOUR NEXT FEW LINES

Results for “Records & reliable control flow”

Small, practical examples. Search by task or narrow things down below.

215 snippets foundClear filters
RustNumbers & durations

Subtract durations without underflow

Subtract durations without underflow in a complete Rust program using the standard library.

Rust✓ Tested
Arduino / CArrays & embedded state

Use named states for a controller

Arduino / C: An enum makes state transitions easier to read than unexplained numbers.

Arduino / C✓ Tested
CSSInteraction selectors

Visually distinguish a disabled control

CSS: The disabled pseudo-class follows the control’s actual disabled state.

CSS✓ Tested
PowerShellStructured formats & encodings

Write object records to a CSV file

PowerShell: Export-Csv uses property names as headers and quotes values when needed.

PowerShell✓ Tested
PowerShellHashtables & object records

Add a calculated property during selection

PowerShell: A calculated property can derive a value while retaining selected original properties.

PowerShell✓ Tested
CSSBox dimensions & overflow

Add inner spacing to a content-sized box

CSS: In content-box sizing, padding adds to the declared content width.

CSS✓ Tested
CSSType & reading flow

Add spacing between characters

CSS: Letter-spacing adds a consistent amount between typographic characters.

CSS✓ Tested
CSSType & reading flow

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
CSSGetting Started

Allow long content to scroll

CSS: Learn how to allow long content to scroll in a complete browser example.

CSS✓ Tested
jQueryEvent control

Attach configuration when registering a handler

jQuery: event.data carries the registration-time data object.

jQuery✓ Tested
CSSBox dimensions & overflow

Cap a box’s width

CSS: Max-width constrains an otherwise larger declared width.

CSS✓ Tested
CDynamic memory & ownership

Check an array allocation size before multiplying

C: Compare the requested element count against SIZE_MAX divided by element size.

C✓ Tested