FIND YOUR NEXT FEW LINES

Results for “per”

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

447 snippets foundClear filters
CSmall algorithms & bit operations

Calculate the greatest common divisor

C: Euclid’s algorithm repeatedly replaces a pair with the divisor and remainder.

C✓ Tested
GoTesting & reusable helpers

Check a function with table-driven cases

Check a function with table-driven cases using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsArray operations

Check exact array membership

Bash Scripts: Compare each element literally instead of searching a concatenated string.

Bash Scripts✓ Tested
C++Ordering & set operations

Check whether a range is already sorted

C++: is_sorted reports ordering without modifying the input.

C++✓ Tested
GoTesting & reusable helpers

Check whether bytes contain valid JSON

Check whether bytes contain valid JSON using a complete Go program with explicit sample inputs.

Go✓ Tested
GoTesting & reusable helpers

Clamp a value to an allowed interval

Clamp a value to an allowed interval using a complete Go program with explicit sample inputs.

Go✓ Tested
PythonFile operations & archives

Clean up a temporary directory automatically

Python: Use TemporaryDirectory as a context manager so cleanup also happens after exceptions.

Python✓ Tested
SQLBulk changes & set operations

Combine results while retaining duplicates

SQL: UNION ALL does not spend work removing equal rows.

SQL✓ Tested
SQL ServerBulk changes & set operations

Combine results while retaining duplicates

SQL Server: UNION ALL does not spend work removing equal rows.

SQL Server✓ Tested
PostgresBulk changes & set operations

Combine results while retaining duplicates

Postgres: UNION ALL does not spend work removing equal rows.

Postgres✓ Tested
SQLiteBulk changes & set operations

Combine results while retaining duplicates

SQLite: UNION ALL does not spend work removing equal rows.

SQLite✓ Tested
GoTesting & reusable helpers

Compare floats within a tolerance

Compare floats within a tolerance using a complete Go program with explicit sample inputs.

Go✓ Tested