FIND YOUR NEXT FEW LINES

Results for “if”

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

946 snippets foundClear filters
Docker / ComposeContainer lifecycle

Find a named container in the created state

Docker / Compose: Combine name and status filters to narrow a listing.

Docker / Compose✓ Tested
JavaScriptObject behavior & collections

Find members absent from another set

JavaScript: Negate a membership test to calculate the set difference.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Find members absent from another set

TypeScript: Negate a membership test to calculate the set difference.

TypeScript✓ Tested
RustMaps & sets

Find members missing from another set

Find members missing from another set in a complete Rust program using the standard library.

Rust✓ Tested
JavaQueues & collection operations

Find set members missing from another set

Java: Use removeAll on a copy to calculate a set difference.

Java✓ Tested
C++Ordering & set operations

Find sorted set members missing from another set

C++: set_difference writes elements present in the first sorted input but absent from the second.

C++✓ Tested
C++Sequence algorithms

Find the first value satisfying a condition

C++: Compare the returned iterator with end before dereferencing it.

C++✓ Tested
PythonMappings & sets

Find values missing from another collection

Python: Use a set difference to identify requested IDs absent from the available IDs.

Python✓ Tested
C#Collections & data structures

Find values missing from another collection

C#: Except removes duplicates as it calculates the set difference.

C#✓ Tested
Docker / ComposeContainer lifecycle

Force a disposable container to stop

Docker / Compose: kill sends SIGKILL by default without a graceful shutdown interval.

Docker / Compose✓ Tested
CFile positioning & lifecycle

Handle a missing file without treating it as an empty file

C: Inspect errno after a failed fopen to distinguish the documented missing-path condition.

C✓ Tested
Bash ScriptsFunctions & arguments

Handle an expected command failure

Branch on a command’s exit code without aborting the script.

exit status✓ Tested