FIND YOUR NEXT FEW LINES

Results for “fold”

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

668 snippets foundClear filters
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
GoConcurrency & cancellation

Receive a result from a goroutine

Receive a result from a goroutine using a complete Go program with explicit sample inputs.

Go✓ 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
SQLiteConstraints & defaults

Reference a parent identified by two columns

SQLite: A composite foreign key checks the complete referenced key rather than either column independently.

SQLite✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Refuse to overwrite an existing file with redirection

Bash Scripts: Noclobber makes a plain greater-than redirection fail when the target already exists.

Bash Scripts✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Reject a missing required configuration value

Bash Scripts: Check a required value explicitly and emit a controlled diagnostic before exiting.

Bash Scripts✓ Tested
RustNumbers & durations

Reject a narrowing integer conversion

Reject a narrowing integer conversion in a complete Rust program using the standard library.

Rust✓ Tested
SQLiteConstraints & defaults

Reject a negative quantity with CHECK

SQLite: Combine NOT NULL and CHECK because an unknown NULL check result is normally accepted.

SQLite✓ Tested
GoFiles & paths

Reject an escaping relative path

Reject an escaping relative path using a complete Go program with explicit sample inputs.

Go✓ Tested
GoErrors & validation

Reject an integer outside a byte’s range

Reject an integer outside a byte’s range using a complete Go program with explicit sample inputs.

Go✓ Tested
SQLiteConstraints & defaults

Reject duplicate business identifiers

SQLite: A UNIQUE constraint protects a business key independently of the primary key.

SQLite✓ Tested
GoErrors & validation

Reject non-finite numeric input

Reject non-finite numeric input using a complete Go program with explicit sample inputs.

Go✓ Tested