Results for “per”
Small, practical examples. Search by task or narrow things down below.
Generate every combination of two sets
SQLite: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.
SQLite✓ Tested
Get the latest row in each group
Select one ordered row per key with DISTINCT ON.
DISTINCT ON✓ Tested
Handle a failed string-to-integer conversion
C++: stoi throws invalid_argument when no conversion can be performed.
C++✓ Tested
Handle a result with a discriminated union
Separate success data from an error message.
discriminated union✓ Tested
Increment a shared counter atomically
C#: Interlocked performs an indivisible update without a separate lock for this operation.
C#✓ Tested
Inspect a parsed URI
C#: Use Uri properties instead of splitting URL strings manually.
C#✓ Tested
Inspect the parsed pieces of a URL
JavaScript: Use URL properties rather than splitting a URL at punctuation.
JavaScript✓ Tested
Inspect the parsed pieces of a URL
TypeScript: Use URL properties rather than splitting a URL at punctuation.
TypeScript✓ Tested
Iterate over object entries
Read JavaScript property names and values using Object.entries.
JavaScript✓ Tested
Join a parent to pre-aggregated totals
SQL: Aggregate the child rows first to produce at most one joined row per parent.
SQL✓ Tested
Join a parent to pre-aggregated totals
SQL Server: Aggregate the child rows first to produce at most one joined row per parent.
SQL Server✓ Tested
Join a parent to pre-aggregated totals
Postgres: Aggregate the child rows first to produce at most one joined row per parent.
Postgres✓ Tested