Results for “condition”
Small, practical examples. Search by task or narrow things down below.
Filter a list with a condition
Build a new list containing only the values that satisfy a condition using a list comprehension.
list✓ Tested
Find the first value satisfying a condition
C++: Compare the returned iterator with end before dereferencing it.
C++✓ Tested
Keep only values satisfying a condition
Keep only values satisfying a condition in a complete Rust program using the standard library.
Rust✓ Tested
Keep rows matching a condition
SQL: Use WHERE to select rows with a particular category.
SQL✓ Tested
Keep rows matching a condition
SQL Server: Use WHERE to select rows with a particular category.
SQL Server✓ Tested
Keep rows matching a condition
Postgres: Use WHERE to select rows with a particular category.
Postgres✓ Tested
Keep rows matching a condition
SQLite: Use WHERE to select rows with a particular category.
SQLite✓ Tested
Read values until a condition changes
Read values until a condition changes in a complete Rust program using the standard library.
Rust✓ Tested
Remove collection items that satisfy a condition
Java: Use removeIf on a mutable collection to avoid changing it manually inside a for-each loop.
Java✓ Tested
Render a conditional branch with @if
Render a conditional branch with @if with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Repeat until a condition becomes true
Bash Scripts: An until loop continues while its test returns a nonzero status.
Bash Scripts✓ Tested
Repeat while a condition holds
Python: Count down while a positive number remains, updating the loop variable on each iteration.
Python✓ Tested