Results for “Type & reading flow”
Small, practical examples. Search by task or narrow things down below.
Add and remove values at both ends
C++: Deque supports efficient end operations without requiring contiguous storage.
C++✓ Tested
Allow a long flex child to shrink inside its container
CSS: Min-width zero removes the default content-size floor so local overflow handling can take effect.
CSS✓ Tested
Apply a linear sensor calibration
Arduino / C: Convert a raw reading using an offset and scale measured for the sensor.
Arduino / C✓ Tested
Apply an operation to a variant’s active value
C++: A generic visitor lets the compiler check behavior for every possible alternative.
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
Await an asynchronous method result
C#: Use Task<T> for an async operation with a typed result.
C#✓ Tested
Await several independent results
Preserve input order while awaiting multiple promises.
Promise.all✓ Tested
Build a minimum-priority queue
C++: Supply greater as the comparator because priority_queue defaults to the largest value first.
C++✓ Tested
Calculate a least common multiple using a GCD
C: Divide before multiplying to reduce the risk of intermediate overflow.
C✓ Tested
Calculate a lexical relative path
C++: lexically_relative compares path components without requiring the paths to exist.
C++✓ Tested
Calculate a simple total
C++: Multiply a unit price by a quantity, then add a delivery fee.
C++✓ Tested
Calculate an average without integer division truncation
C: Accumulate into double and divide by the nonzero number of readings.
C✓ Tested