Results for “all”
Small, practical examples. Search by task or narrow things down below.
Find the second-highest distinct value
SQL Server: Select the maximum below the overall maximum to skip ties at the top.
SQL Server✓ Tested
Find the second-highest distinct value
Postgres: Select the maximum below the overall maximum to skip ties at the top.
Postgres✓ Tested
Find the second-highest distinct value
SQLite: Select the maximum below the overall maximum to skip ties at the top.
SQLite✓ Tested
Find what remains after division
C++: Use the remainder operator to count items left after forming complete groups.
C++✓ Tested
Find what remains after division
C: Use the remainder operator to count items left after forming complete groups.
C✓ Tested
Fit an entire image inside a differently shaped box
CSS: Contain preserves the image aspect ratio while keeping all of it visible inside the specified content box.
CSS✓ Tested
Focus an input through a ref
Focus an input through a ref with a small React component and explicit browser behavior.
React✓ Tested
Force a disposable container to stop
Docker / Compose: kill sends SIGKILL by default without a graceful shutdown interval.
Docker / Compose✓ Tested
Format a decimal value
Print two fractional digits with C printf.
C✓ Tested
Format a known timestamp in UTC
C: gmtime converts to UTC calendar fields and strftime formats them.
C✓ Tested
Format a nonnegative integer amount as whole and fractional units
C: Keep the calculation in integer minor units and use two digits for the remainder.
C✓ Tested
Format an ISO date
Format a UTC JavaScript Date deterministically.
JavaScript✓ Tested