FIND YOUR NEXT FEW LINES

Results for “when”

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

230 snippets foundClear filters
PythonDates & time zones

Skip weekends when advancing dates

Python: Walk calendar dates and count only Monday through Friday.

Python✓ Tested
RustErrors & optional values

Stop collecting when parsing fails

Stop collecting when parsing fails in a complete Rust program using the standard library.

Rust✓ Tested
Arduino / CDigital signals & interrupts

Stop receiving interrupts when a task finishes

Arduino / C: detachInterrupt removes the registered callback.

Arduino / C✓ Tested
Bash ScriptsParameter expansion

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
jQueryEvent control

Validate a field when focus leaves it

jQuery: focusout bubbles and can support delegated form validation.

jQuery✓ Tested
AngularEvents & DOM interaction

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
C#Asynchronous work & URI handling

Await multiple tasks while preserving result order

C#: Task.WhenAll returns results in the same order as the supplied tasks.

C#✓ Tested
jQueryDeferred work & queues

Wait for several deferred values

jQuery: when resolves only after every supplied deferred has resolved.

jQuery✓ Tested
CSSResponsive conditions & sizing

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
CSSVisual treatment & accessibility

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
SQL ServerSelect & page

Assign a rank within each group

Number rows with a partitioned window.

ROW_NUMBER✓ Tested
PythonFunctions & error handling

Avoid a shared mutable default argument

Python: Create a fresh list inside the function when the optional argument is omitted.

Python✓ Tested