FIND YOUR NEXT FEW LINES

Results for “Stream transformations”

Small, practical examples. Search by task or narrow things down below.

85 snippets foundClear filters
GitRemotes & collaboration

Pull without creating a merge commit

Update a branch only when its upstream can be fast-forwarded.

pull✓ Tested
Linux CommandsStreams & byte tools

Read a byte prefix

Linux Commands: Use GNU head -c for a fixed number of bytes, independent of line boundaries.

Linux Commands✓ Tested
Linux CommandsStreams & byte tools

Read a byte suffix

Linux Commands: Use GNU tail -c to extract a fixed-size ending.

Linux Commands✓ Tested
Bash ScriptsInput streams & redirection

Read complete lines into an array

Bash Scripts: Mapfile with -t removes each line terminator but preserves other whitespace.

Bash Scripts✓ Tested
Bash ScriptsInput streams & redirection

Read from a dedicated file descriptor

Bash Scripts: An explicitly opened descriptor keeps the script’s ordinary standard input available.

Bash Scripts✓ Tested
Bash ScriptsInput streams & redirection

Read null-delimited filenames into an array

Bash Scripts: A null delimiter preserves spaces and embedded newlines in filenames.

Bash Scripts✓ Tested
RustIterators & transformations

Read values until a condition changes

Read values until a condition changes in a complete Rust program using the standard library.

Rust✓ Tested
Bash ScriptsInput streams & redirection

Redirect an entire group of commands

Bash Scripts: Brace grouping runs in the current shell and shares a single output redirection.

Bash Scripts✓ Tested
CArray transformations

Remove adjacent duplicates from a sorted array

C: Compact equal neighbors with a write index after sorting or otherwise establishing order.

C✓ Tested
C#LINQ transformations

Remove duplicate records by a selected key

C#: DistinctBy keeps the first record for each key in encounter order.

C#✓ Tested
CArray transformations

Remove one array element and close the gap

C: memmove handles the overlap while the logical length shrinks by one.

C✓ Tested
CArray transformations

Rotate a nonempty array left by one element

C: Save the first item before shifting the remaining elements.

C✓ Tested