FIND YOUR NEXT FEW LINES

Results for “or”

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

2638 snippets foundClear filters
CDynamic memory & ownership

Swap owned buffers by swapping their pointers

C: Pointer swaps avoid copying the underlying data.

C✓ Tested
JavaStream transformations

Take a page from a stream

Java: Use skip and limit with a known stable input order.

Java✓ Tested
C++Sequence algorithms

Test any and all elements with predicates

C++: These algorithms stop as soon as their result is known.

C++✓ Tested
CSmall algorithms & bit operations

Test whether an unsigned value is a power of two

C: A nonzero power of two has exactly one set bit.

C✓ Tested
Linux CommandsTransforming text

Translate ASCII lowercase letters to uppercase

Linux Commands: Use tr under a fixed locale for predictable ASCII character ranges.

Linux Commands✓ Tested
RustErrors & optional values

Transpose an optional parsing result

Transpose an optional parsing result in a complete Rust program using the standard library.

Rust✓ Tested
JavaText validation & formatting

Treat dynamic regex input as literal text

Java: Use Pattern.quote so metacharacters in a search term lose their special meaning.

Java✓ Tested
SQLReporting & grouped calculations

Turn known group values into columns

SQL: Conditional aggregation gives a portable pivot when the category set is known.

SQL✓ Tested
SQL ServerReporting & grouped calculations

Turn known group values into columns

SQL Server: Conditional aggregation gives a portable pivot when the category set is known.

SQL Server✓ Tested
PostgresReporting & grouped calculations

Turn known group values into columns

Postgres: Conditional aggregation gives a portable pivot when the category set is known.

Postgres✓ Tested
SQLiteReporting & grouped calculations

Turn known group values into columns

SQLite: Conditional aggregation gives a portable pivot when the category set is known.

SQLite✓ Tested
GitRestoring & revising local work

Uncommit a local change and leave its edits unstaged

Git: A mixed reset resets the index while retaining working-file contents.

Git✓ Tested