FIND YOUR NEXT FEW LINES

Results for “Array operations”

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

298 snippets foundClear filters
JavaQueues & collection operations

Initialize a map entry only when absent

Java: Use computeIfAbsent when creating a collection for a new key.

Java✓ Tested
SQLBulk changes & set operations

Insert only keys absent from a destination

SQL: NOT EXISTS supports a set-based missing-row insert in a single-writer example.

SQL✓ Tested
SQL ServerBulk changes & set operations

Insert only keys absent from a destination

SQL Server: NOT EXISTS supports a set-based missing-row insert in a single-writer example.

SQL Server✓ Tested
PostgresBulk changes & set operations

Insert only keys absent from a destination

Postgres: NOT EXISTS supports a set-based missing-row insert in a single-writer example.

Postgres✓ Tested
SQLiteBulk changes & set operations

Insert only keys absent from a destination

SQLite: NOT EXISTS supports a set-based missing-row insert in a single-writer example.

SQLite✓ Tested
C#File operations & paths

Inspect a file length without reading it

C#: Use FileInfo.Length to retrieve a logical size in bytes.

C#✓ Tested
Arduino / CArrays & embedded state

Keep a counter from wrapping at its maximum

Arduino / C: Increment only when the value is below its limit.

Arduino / C✓ Tested
JavaScriptArray restructuring

Keep both matching and rejected values

JavaScript: Use two explicit outputs when a caller needs both sides of a classification.

JavaScript✓ Tested
TypeScriptArray restructuring

Keep both matching and rejected values

TypeScript: Use two explicit outputs when a caller needs both sides of a classification.

TypeScript✓ Tested
C++Filesystem operations

List regular files recursively in sorted order

C++: Collect relative paths before sorting because directory iteration order is unspecified.

C++✓ Tested
JavaFile operations & binary data

Load a small properties configuration

Java: Use a Reader to make the configuration character encoding explicit.

Java✓ Tested
JavaScriptArray restructuring

Map items to multiple output values

JavaScript: flatMap combines mapping and a one-level flattening operation.

JavaScript✓ Tested