Results for “all”
Small, practical examples. Search by task or narrow things down below.
Test any and all elements with predicates
C++: These algorithms stop as soon as their result is known.
C++✓ Tested
Test whether any or all values match
C#: Any and All short-circuit instead of materializing filtered collections.
C#✓ Tested
Transform each regex match with a callback
JavaScript: A replacement callback computes the replacement separately for each match.
JavaScript✓ Tested
Transform each regex match with a callback
TypeScript: A replacement callback computes the replacement separately for each match.
TypeScript✓ 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
Update a shared counter atomically
Java: AtomicInteger provides an indivisible increment operation for a shared counter.
Java✓ Tested
Use a context’s fallback value
Use a context’s fallback value with a small React component and explicit browser behavior.
React✓ Tested
Use a fallback for a missing hashtable entry
PowerShell: Test the key explicitly so legitimate false or zero values are preserved.
PowerShell✓ Tested
Use a fallback for an unset variable
Bash Scripts: Use a fallback for an unset variable with a small standalone Bash program.
Bash Scripts✓ Tested