FIND YOUR NEXT FEW LINES

Results for “condition”

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

102 snippets foundClear filters
PythonCollections

Filter a list with a condition

Build a new list containing only the values that satisfy a condition using a list comprehension.

list✓ Tested
C++Sequence algorithms

Find the first value satisfying a condition

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

C++✓ Tested
RustVectors & slices

Keep only values satisfying a condition

Keep only values satisfying a condition in a complete Rust program using the standard library.

Rust✓ Tested
SQLGetting Started

Keep rows matching a condition

SQL: Use WHERE to select rows with a particular category.

SQL✓ Tested
SQL ServerGetting Started

Keep rows matching a condition

SQL Server: Use WHERE to select rows with a particular category.

SQL Server✓ Tested
PostgresGetting Started

Keep rows matching a condition

Postgres: Use WHERE to select rows with a particular category.

Postgres✓ Tested
SQLiteGetting Started

Keep rows matching a condition

SQLite: Use WHERE to select rows with a particular category.

SQLite✓ Tested
RustIterators & transformations

Read values until a condition changes

Read values until a condition changes in a complete Rust program using the standard library.

Rust✓ Tested
JavaQueues & collection operations

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
AngularGetting Started

Render a conditional branch with @if

Render a conditional branch with @if with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
Bash ScriptsArguments & decisions

Repeat until a condition becomes true

Bash Scripts: An until loop continues while its test returns a nonzero status.

Bash Scripts✓ Tested
PythonGetting Started

Repeat while a condition holds

Python: Count down while a positive number remains, updating the loop variable on each iteration.

Python✓ Tested