Results for “C”
Small, practical examples. Search by task or narrow things down below.
Compute a two-dimensional vector length
C: hypot avoids unnecessary intermediate overflow compared with squaring both inputs directly.
C✓ Tested
Compute an integer weighted average
SQL: Multiply before summing and guard a zero total weight with NULLIF.
SQL✓ Tested
Compute an integer weighted average
SQL Server: Multiply before summing and guard a zero total weight with NULLIF.
SQL Server✓ Tested
Compute an integer weighted average
Postgres: Multiply before summing and guard a zero total weight with NULLIF.
Postgres✓ Tested
Compute an integer weighted average
SQLite: Multiply before summing and guard a zero total weight with NULLIF.
SQLite✓ Tested
Compute beyond the fixed-width integer range
PowerShell: BigInteger keeps an exact result when ordinary integer types are too small.
PowerShell✓ Tested
Concatenate arrays without mutating either input
JavaScript: concat creates a shallow combined sequence.
JavaScript✓ Tested
Concatenate arrays without mutating either input
TypeScript: concat creates a shallow combined sequence.
TypeScript✓ Tested
Configure bounded retries after a failure
Docker / Compose: on-failure with a count limits automatic restart attempts.
Docker / Compose✓ Tested
Confirm the root filesystem rejects writes
Docker / Compose: A read-only root prevents creating files outside writable mounts.
Docker / Compose✓ Tested
Connect a reusable label using useId
Connect a reusable label using useId with a small React component and explicit browser behavior.
React✓ Tested
Connect an invalid field to its explanation
Connect an invalid field to its explanation with a small React component and explicit browser behavior.
React✓ Tested