FIND YOUR NEXT FEW LINES

Results for “fold”

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

668 snippets foundClear filters
Linux CommandsArchive integrity & packaging

Archive filenames safely with null delimiters

Linux Commands: Use find -print0 with tar --null to preserve spaces and embedded newlines in filenames.

Linux Commands✓ Tested
RustTesting & reusable patterns

Assert approximate floating-point equality

Assert approximate floating-point equality in a complete Rust program using the standard library.

Rust✓ Tested
Bash ScriptsParameter expansion

Assign a default to an empty or unset variable

Bash Scripts: The colon-equals expansion both supplies and assigns a fallback value.

Bash Scripts✓ Tested
SQLiteSubqueries & ranked selection

Attach an overall count to every row

SQLite: An uncorrelated scalar subquery supplies the same aggregate to each output row.

SQLite✓ Tested
GoFunctions & types

Attach behavior to a struct

Attach behavior to a struct using a complete Go program with explicit sample inputs.

Go✓ Tested
RustGetting Started

Bind a value with let

Bind a value with let in a complete Rust program using the standard library.

Rust✓ Tested
SQLiteConstraints & defaults

Block deletion of a referenced parent

SQLite: The default foreign-key action prevents deletion while a child still refers to the parent.

SQLite✓ Tested
RustThreads & shared ownership

Borrow local data in a scoped thread

Borrow local data in a scoped thread in a complete Rust program using the standard library.

Rust✓ Tested
RustTesting & reusable patterns

Borrow text until a modification is needed

Borrow text until a modification is needed in a complete Rust program using the standard library.

Rust✓ Tested
RustGetting Started

Borrow text without transferring ownership

Borrow text without transferring ownership in a complete Rust program using the standard library.

Rust✓ Tested
Linux CommandsDates & process utilities

Bound a command execution time

Linux Commands: Use timeout and handle status 124 as an expected time limit.

Linux Commands✓ Tested
Linux CommandsGetting Started

Branch on a command’s exit status

Linux Commands: Branch on a command’s exit status using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested