FIND YOUR NEXT FEW LINES

Results for “LINQ transformations”

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

43 snippets foundClear filters
CArray transformations

Calculate a cumulative sum for each position

C: Keep a running total and store each prefix result in a separate output array.

C✓ Tested
JavaStream transformations

Calculate several numeric stream statistics

Java: Use summaryStatistics to calculate count, sum, minimum, maximum, and average in one pass.

Java✓ Tested
JavaStream transformations

Check any and all stream elements

Java: Use short-circuiting match operations for predicates over a Java collection.

Java✓ Tested
CArray transformations

Filter an array in place with a write index

C: Only retained values advance the write position.

C✓ Tested
JavaStream transformations

Find the first matching stream value

Java: Use findFirst and an explicit default for an empty result.

Java✓ Tested
RustIterators & transformations

Find the first matching value

Find the first matching value in a complete Rust program using the standard library.

Rust✓ Tested
CArray transformations

Find the smallest value in a nonempty array

C: Initialize from the first element instead of assuming a numeric sentinel.

C✓ Tested
JavaStream transformations

Flatten nested collections

Java: Use flatMap to concatenate nested Java lists into one stream.

Java✓ Tested
RustIterators & transformations

Flatten nested collections

Flatten nested collections in a complete Rust program using the standard library.

Rust✓ Tested
JavaStream transformations

Group strings by their length

Java: Choose a TreeMap supplier when group keys must have deterministic order.

Java✓ Tested
JavaStream transformations

Index records by a unique key

Java: Use toMap with an explicit merge rule so duplicate keys have defined behavior.

Java✓ Tested
CArray transformations

Insert into an array with spare capacity

C: Move the trailing elements before inserting and keep the logical length separate from capacity.

C✓ Tested