Results for “read text”
Small, practical examples. Search by task or narrow things down below.
Build a JSON array from rows
Aggregate ordered text values into JSON.
json_group_array✓ 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 lexical relative path
C++: lexically_relative compares path components without requiring the paths to exist.
C++✓ Tested
Calculate a running total
Accumulate values in row order.
window✓ Tested
Calculate a simple total
C++: Multiply a unit price by a quantity, then add a delivery fee.
C++✓ Tested
Calculate a two-dimensional vector length
C++: hypot avoids unnecessary intermediate overflow in the sum of squares.
C++✓ Tested
Calculate an average without integer division truncation
C: Accumulate into double and divide by the nonzero number of readings.
C✓ Tested
Calculate cumulative totals
C++: partial_sum writes the sum of each input prefix to the output sequence.
C++✓ Tested
Calculate the dot product of two vectors
C++: inner_product multiplies corresponding elements and accumulates them from a chosen seed.
C++✓ Tested
Call a library function
C++: Use a standard absolute-value function with a small negative number.
C++✓ Tested
Capture configuration by value in a callable
C++: A value capture retains the value from lambda creation even if the original variable changes later.
C++✓ Tested
Capture standard output and standard error separately
Bash Scripts: Use distinct redirections when diagnostic text should not be mixed with data.
Bash Scripts✓ Tested