Results for “Sorting & joining records”
Small, practical examples. Search by task or narrow things down below.
Read the smallest and largest values
Postgres: Use MIN and MAX without sorting and fetching every row.
Postgres✓ Tested
Read the smallest and largest values
SQLite: Use MIN and MAX without sorting and fetching every row.
SQLite✓ Tested
Reject one outlier with a median-of-three filter
Arduino / C: Sorting three values leaves the median in the middle.
Arduino / C✓ Tested
Remove adjacent duplicates from a sorted array
C: Compact equal neighbors with a write index after sorting or otherwise establishing order.
C✓ Tested
Remove duplicate values with a Set
Keep the first occurrence order while deduplicating.
Set✓ Tested
Set and inspect a fractional CPU limit
Docker / Compose: The cpus option records a limit in units of one billion NanoCPUs.
Docker / Compose✓ Tested
Set and inspect a memory limit
Apply a per-container limit when creating a container.
memory✓ Tested
Sort numbers numerically
Supply a numeric comparator instead of JavaScript string sorting.
JavaScript✓ Tested
Split a line into named fields
Read a simple delimiter-separated line into variables.
read✓ Tested
Start an existing container and attach to its output
Docker / Compose: create records the command; start with attach runs that existing container.
Docker / Compose✓ Tested
Sum typed values with reduce
Accumulate numeric array elements.
reduce✓ Tested
Type a dictionary with Record
Limit a lookup table to a known set of keys.
Record✓ Tested