Results for “Stream transformations”
Small, practical examples. Search by task or narrow things down below.
Pull without creating a merge commit
Update a branch only when its upstream can be fast-forwarded.
pull✓ Tested
Read a byte prefix
Linux Commands: Use GNU head -c for a fixed number of bytes, independent of line boundaries.
Linux Commands✓ Tested
Read a byte suffix
Linux Commands: Use GNU tail -c to extract a fixed-size ending.
Linux Commands✓ Tested
Read complete lines into an array
Bash Scripts: Mapfile with -t removes each line terminator but preserves other whitespace.
Bash Scripts✓ Tested
Read from a dedicated file descriptor
Bash Scripts: An explicitly opened descriptor keeps the script’s ordinary standard input available.
Bash Scripts✓ Tested
Read null-delimited filenames into an array
Bash Scripts: A null delimiter preserves spaces and embedded newlines in filenames.
Bash Scripts✓ Tested
Read values until a condition changes
Read values until a condition changes in a complete Rust program using the standard library.
Rust✓ Tested
Redirect an entire group of commands
Bash Scripts: Brace grouping runs in the current shell and shares a single output redirection.
Bash Scripts✓ 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 records by a selected key
C#: DistinctBy keeps the first record for each key in encounter order.
C#✓ Tested
Remove one array element and close the gap
C: memmove handles the overlap while the logical length shrinks by one.
C✓ Tested
Rotate a nonempty array left by one element
C: Save the first item before shifting the remaining elements.
C✓ Tested