FIND YOUR NEXT FEW LINES

Results for “fold”

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

668 snippets foundClear filters
SQLiteSubqueries & ranked selection

Include missing values in a not-equal filter

SQLite: Ordinary inequality does not include NULL; explicitly include it when that is the intended rule.

SQLite✓ Tested
SQLiteRelationships & missing data

Include zero counts for missing relationships

SQLite: Count the non-null child key after a left join so a missing relationship produces zero.

SQLite✓ Tested
Bash ScriptsGetting Started

Increase an integer variable

Bash Scripts: Increase an integer variable with a small standalone Bash program.

Bash Scripts✓ Tested
Bash ScriptsText parsing & arithmetic

Increment a counter without an unexpected errexit

Bash Scripts: An assignment avoids the zero-result exit status of a standalone arithmetic post-increment.

Bash Scripts✓ Tested
SQLiteBulk changes & set operations

Increment a stored value in the database

SQLite: An in-database arithmetic update avoids a separate application read-modify-write step.

SQLite✓ Tested
GoConcurrency & cancellation

Increment an atomic counter

Increment an atomic counter using a complete Go program with explicit sample inputs.

Go✓ Tested
GoConcurrency & cancellation

Initialize a resource only once

Initialize a resource only once using a complete Go program with explicit sample inputs.

Go✓ Tested
RustThreads & shared ownership

Initialize shared data once

Initialize shared data once in a complete Rust program using the standard library.

Rust✓ Tested
RustMaps & sets

Insert and retrieve a map value

Insert and retrieve a map value in a complete Rust program using the standard library.

Rust✓ 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
RustFiles & paths

Inspect a path’s filename and extension

Inspect a path’s filename and extension in a complete Rust program using the standard library.

Rust✓ Tested
GoErrors & validation

Inspect a typed conversion error

Inspect a typed conversion error using a complete Go program with explicit sample inputs.

Go✓ Tested