Results for “save”
Small, practical examples. Search by task or narrow things down below.
Inspect the parsed pieces of a URL
TypeScript: Use URL properties rather than splitting a URL at punctuation.
TypeScript✓ Tested
Invert a dictionary with unique values
Python: Swap keys and values when the values are hashable and unique.
Python✓ Tested
Isolate a value with a different writing direction
HTML: Bdi isolates embedded user text so its direction does not reorder surrounding punctuation.
HTML✓ Tested
Isolate variable changes in a subshell
Bash Scripts: Parentheses create a subshell whose variable assignments do not change the parent.
Bash Scripts✓ Tested
Iterate over a fixed array of records
C: Compute the array element count with sizeof at the point where it is still an array.
C✓ Tested
Iterate over all regular-expression matches
C++: A regex iterator yields successive matches without manually updating an offset.
C++✓ Tested
Iterate over bounded chunks
Iterate over bounded chunks using a complete Go program with explicit sample inputs.
Go✓ Tested
Iterate over keys in sorted order
Iterate over keys in sorted order in a complete Rust program using the standard library.
Rust✓ Tested
Iterate over object entries
Read JavaScript property names and values using Object.entries.
JavaScript✓ Tested
Iterate with array indices and values
JavaScript: entries provides each position and value without a separate counter.
JavaScript✓ Tested
Iterate with array indices and values
TypeScript: entries provides each position and value without a separate counter.
TypeScript✓ Tested
Join a worker thread and read its result
Join a worker thread and read its result in a complete Rust program using the standard library.
Rust✓ Tested