Results for “fold”
Small, practical examples. Search by task or narrow things down below.
Match any pattern from a file
Linux Commands: Use grep -F -f with one literal pattern per line.
Linux Commands✓ Tested
Match enum variants
Match enum variants in a complete Rust program using the standard library.
Rust✓ Tested
Match filenames without case sensitivity
Linux Commands: Use iname for a case-insensitive filename pattern.
Linux Commands✓ Tested
Match one value from a short list
SQLite: Use IN for a set of allowed values.
SQLite✓ Tested
Measure a duration between instants
Measure a duration between instants using a complete Go program with explicit sample inputs.
Go✓ Tested
Measure the length of ordinary text
SQLite: Use the engine’s text-length function; this ASCII example has no trailing spaces.
SQLite✓ Tested
Modify a value through a mutable borrow
Modify a value through a mutable borrow in a complete Rust program using the standard library.
Rust✓ Tested
Move a collection out and leave an empty default
Move a collection out and leave an empty default in a complete Rust program using the standard library.
Rust✓ Tested
Move owned data into a worker
Move owned data into a worker in a complete Rust program using the standard library.
Rust✓ Tested
Mutate a struct through a pointer receiver
Mutate a struct through a pointer receiver using a complete Go program with explicit sample inputs.
Go✓ Tested
Name a fixed configuration value
Name a fixed configuration value using a complete Go program with explicit sample inputs.
Go✓ Tested
Normalize a path without requiring it to exist
Linux Commands: Use GNU realpath -m and relative-to to normalize dot segments.
Linux Commands✓ Tested