FIND YOUR NEXT FEW LINES

Results for “all”

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

1115 snippets foundClear filters
CArray transformations

Sort an integer array with qsort

C: The comparator uses relational comparisons to avoid subtraction overflow.

C✓ Tested
Linux CommandsText processing

Sort and deduplicate lines

Sort lines alphabetically and remove duplicate lines in a predictable C locale.

sort✓ Tested
C++Collections

Sort and deduplicate values

Sort a C++ vector and erase adjacent duplicates.

C++✓ Tested
SQLSubqueries & ranked selection

Sort preferred rows ahead of other rows

SQL: A CASE ordering key expresses business priority before a stable secondary sort.

SQL✓ Tested
SQL ServerSubqueries & ranked selection

Sort preferred rows ahead of other rows

SQL Server: A CASE ordering key expresses business priority before a stable secondary sort.

SQL Server✓ Tested
PostgresSubqueries & ranked selection

Sort preferred rows ahead of other rows

Postgres: A CASE ordering key expresses business priority before a stable secondary sort.

Postgres✓ Tested
SQLiteSubqueries & ranked selection

Sort preferred rows ahead of other rows

SQLite: A CASE ordering key expresses business priority before a stable secondary sort.

SQLite✓ Tested
C++Ordering & set operations

Sort records by two fields

C++: Tuple comparison implements lexicographic ordering across several keys.

C++✓ Tested
PythonIteration & sequences

Split a list into fixed-size batches

Python: Slice a sequence at regular offsets; the final batch can be smaller.

Python✓ Tested
PythonStrings & dates

Split a string into words

Split text on whitespace, automatically treating repeated spaces, tabs, and line breaks as a single separator.

string✓ Tested
JavaScriptArray restructuring

Split an array into bounded batches

JavaScript: Advance by a positive batch size and allow a shorter final chunk.

JavaScript✓ Tested
TypeScriptArray restructuring

Split an array into bounded batches

TypeScript: Advance by a positive batch size and allow a shorter final chunk.

TypeScript✓ Tested