Results for “du”
Small, practical examples. Search by task or narrow things down below.
Sort and deduplicate lines
Sort lines alphabetically and remove duplicate lines in a predictable C locale.
sort✓ Tested
Sort and deduplicate values
Produce an ordered list without duplicates.
Sort-Object✓ Tested
Sort and deduplicate values
Sort a C++ vector and erase adjacent duplicates.
C++✓ Tested
Subtract durations without underflow
Subtract durations without underflow in a complete Rust program using the standard library.
Rust✓ Tested
Sum typed values with reduce
Accumulate numeric array elements.
reduce✓ Tested
Trim surrounding whitespace from an Arduino String
Arduino / C: String.trim modifies the object in place.
Arduino / C✓ Tested
Use if to produce a value
Use if to produce a value in a complete Rust program using the standard library.
Rust✓ Tested
Advance an index around a fixed collection
Arduino / C: Modulo wraps a bounded nonnegative index to zero.
Arduino / C✓ Tested
Allocate an independent copy of a C string
C: Include one extra byte for the terminating null character.
C✓ Tested
Apply a linear sensor calibration
Arduino / C: Convert a raw reading using an offset and scale measured for the sensor.
Arduino / C✓ Tested
Assemble a big-endian 16-bit value
Arduino / C: Cast to an unsigned 16-bit type before shifting the high byte.
Arduino / C✓ Tested
Assign a bit from a Boolean state
Arduino / C: bitWrite accepts a bit position and a zero or nonzero value.
Arduino / C✓ Tested