Results for “lock”
Small, practical examples. Search by task or narrow things down below.
Increment a shared counter atomically
C#: Interlocked performs an indivisible update without a separate lock for this operation.
C#✓ Tested
Initialize shared data once
Initialize shared data once in a complete Rust program using the standard library.
Rust✓ Tested
Mark a longer quotation and its source
HTML: Blockquote marks quoted content; a visible source link remains useful because cite is metadata.
HTML✓ Tested
Place fixed-size boxes on the same line
CSS: Inline-block allows dimensions while participating in inline layout.
CSS✓ Tested
Blink the built-in LED three times
Alternate the built-in LED with a short blocking delay.
blink✓ Tested
Center a small item in a grid cell
CSS: Place-items sets both block-axis and inline-axis item alignment.
CSS✓ Tested
Change an LED delay with a variable
Arduino / C: Assign a new value to a variable to change the next LED pulse duration.
Arduino / C✓ Tested
Clean up a generator after an early break
JavaScript: Breaking a for-of loop closes a generator and runs its finally block.
JavaScript✓ Tested
Clean up a generator after an early break
TypeScript: Breaking a for-of loop closes a generator and runs its finally block.
TypeScript✓ Tested
Control tab width in preformatted content
CSS: Tab-size defines the interval of tab stops in a preformatted block.
CSS✓ Tested
Detect integer overflow with checked
C#: A checked arithmetic block throws instead of silently wrapping an integer result.
C#✓ Tested
Explain a sketch with comments
Arduino / C: Use single-line and block comments to document what a sketch does.
Arduino / C✓ Tested