Results for “all”
Small, practical examples. Search by task or narrow things down below.
Find parents whose every child meets a rule
Postgres: Combine existence with the absence of a violating child to exclude parents with no children.
Postgres✓ Tested
Find parents whose every child meets a rule
SQLite: Combine existence with the absence of a violating child to exclude parents with no children.
SQLite✓ Tested
Generate a bounded Fibonacci sequence
C: Keep only the two previous values instead of using exponential recursive calls.
C✓ Tested
Inspect both successful and failed promise results
JavaScript: allSettled preserves input order and reports failures without rejecting the combined promise.
JavaScript✓ Tested
Inspect both successful and failed promise results
TypeScript: allSettled preserves input order and reports failures without rejecting the combined promise.
TypeScript✓ Tested
Observe when a DOM node is attached
Observe when a DOM node is attached with a small React component and explicit browser behavior.
React✓ Tested
Perform cleanup even after an exception
C#: A finally block runs after a handled failure as well as after success.
C#✓ Tested
Remove matching items from a mutable list
C#: List.RemoveAll returns how many items it removed.
C#✓ Tested
Require every bit in a mask
Arduino / C: Masking followed by equality tests whether all required flags are set.
Arduino / C✓ Tested
Run cleanup after a caught exception
PowerShell: Use finally for cleanup that must occur after either success or failure.
PowerShell✓ Tested
Run cleanup after a handled exception
Java: A finally block executes whether the protected operation succeeds or fails.
Java✓ Tested
Run cleanup after a promise settles
JavaScript: finally runs after success or failure and normally preserves the original outcome.
JavaScript✓ Tested