Results for “or”
Small, practical examples. Search by task or narrow things down below.
Swap owned buffers by swapping their pointers
C: Pointer swaps avoid copying the underlying data.
C✓ Tested
Take a page from a stream
Java: Use skip and limit with a known stable input order.
Java✓ Tested
Test any and all elements with predicates
C++: These algorithms stop as soon as their result is known.
C++✓ Tested
Test whether an unsigned value is a power of two
C: A nonzero power of two has exactly one set bit.
C✓ Tested
Translate ASCII lowercase letters to uppercase
Linux Commands: Use tr under a fixed locale for predictable ASCII character ranges.
Linux Commands✓ Tested
Transpose an optional parsing result
Transpose an optional parsing result in a complete Rust program using the standard library.
Rust✓ Tested
Treat dynamic regex input as literal text
Java: Use Pattern.quote so metacharacters in a search term lose their special meaning.
Java✓ Tested
Turn known group values into columns
SQL: Conditional aggregation gives a portable pivot when the category set is known.
SQL✓ Tested
Turn known group values into columns
SQL Server: Conditional aggregation gives a portable pivot when the category set is known.
SQL Server✓ Tested
Turn known group values into columns
Postgres: Conditional aggregation gives a portable pivot when the category set is known.
Postgres✓ Tested
Turn known group values into columns
SQLite: Conditional aggregation gives a portable pivot when the category set is known.
SQLite✓ Tested
Uncommit a local change and leave its edits unstaged
Git: A mixed reset resets the index while retaining working-file contents.
Git✓ Tested