Results for “when”
Small, practical examples. Search by task or narrow things down below.
Skip weekends when advancing dates
Python: Walk calendar dates and count only Monday through Friday.
Python✓ Tested
Stop collecting when parsing fails
Stop collecting when parsing fails in a complete Rust program using the standard library.
Rust✓ Tested
Stop receiving interrupts when a task finishes
Arduino / C: detachInterrupt removes the registered callback.
Arduino / C✓ Tested
Use an alternate value only when a variable is nonempty
Bash Scripts: The colon-plus expansion returns its word only when the parameter has a nonempty value.
Bash Scripts✓ Tested
Validate a field when focus leaves it
jQuery: focusout bubbles and can support delegated form validation.
jQuery✓ Tested
Validate a field when focus leaves it
Validate a field when focus leaves it with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Await multiple tasks while preserving result order
C#: Task.WhenAll returns results in the same order as the supplied tasks.
C#✓ Tested
Wait for several deferred values
jQuery: when resolves only after every supplied deferred has resolved.
jQuery✓ Tested
Add a clear boundary in forced-colors mode
CSS: Use a system color for a border when the user’s forced-color mode is active.
CSS✓ Tested
Align an image within its content box
CSS: Object-position places the rendered object when fitting leaves spare space or crops an edge.
CSS✓ Tested
Assign a rank within each group
Number rows with a partitioned window.
ROW_NUMBER✓ Tested
Avoid a shared mutable default argument
Python: Create a fresh list inside the function when the optional argument is omitted.
Python✓ Tested