Results for “first”
Small, practical examples. Search by task or narrow things down below.
Replace NULL in a result
Choose a fallback for a missing value.
COALESCE✓ Tested
Rotate a nonempty array left by one element
C: Save the first item before shifting the remaining elements.
C✓ Tested
Rotate a sequence around a selected position
C++: rotate places the element at the middle iterator first while preserving the two segment orders.
C++✓ Tested
Run an event handler once
Use jQuery one for a handler that removes itself after the first event.
jQuery✓ Tested
Share data through a named volume
Keep a file across two short-lived containers.
volume✓ Tested
Substitute a value for NULL
Use SQL Server’s ISNULL expression.
ISNULL✓ Tested
Trim surrounding ASCII whitespace
C++: Find the first and last non-whitespace bytes before taking a substring.
C++✓ Tested
Undo a multi-row transfer atomically
SQL: The first transaction commits the fixtures. Rolling back the second transaction restores both sides of the attempted transfer.
SQL✓ Tested
Undo a multi-row transfer atomically
SQL Server: The first transaction commits the fixtures. Rolling back the second transaction restores both sides of the attempted transfer.
SQL Server✓ Tested
Undo a multi-row transfer atomically
Postgres: The first transaction commits the fixtures. Rolling back the second transaction restores both sides of the attempted transfer.
Postgres✓ Tested
Undo a multi-row transfer atomically
SQLite: The first transaction commits the fixtures. Rolling back the second transaction restores both sides of the attempted transfer.
SQLite✓ Tested
Use a deque as a stack
Java: Use push and pop for last-in, first-out behavior.
Java✓ Tested