Results for “once”
Small, practical examples. Search by task or narrow things down below.
Hash a file without reading it all at once
Python: Feed fixed-size binary chunks into SHA-256 for files larger than memory.
Python✓ Tested
Initialize a resource only once
Initialize a resource only once using a complete Go program with explicit sample inputs.
Go✓ Tested
Initialize shared data once
Initialize shared data once in a complete Rust program using the standard library.
Rust✓ Tested
Print once from setup
Arduino / C: Print once from setup on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Run an event handler once
Use jQuery one for a handler that removes itself after the first event.
jQuery✓ Tested
Split a key-value pair once
Split a key-value pair once using a complete Go program with explicit sample inputs.
Go✓ Tested
Split a key-value pair once
Split a key-value pair once in a complete Rust program using the standard library.
Rust✓ Tested
List unordered pairs without duplicate reversals
SQL: Join using an increasing key comparison to omit self-pairs and reversed duplicates.
SQL✓ Tested
List unordered pairs without duplicate reversals
SQL Server: Join using an increasing key comparison to omit self-pairs and reversed duplicates.
SQL Server✓ Tested
List unordered pairs without duplicate reversals
Postgres: Join using an increasing key comparison to omit self-pairs and reversed duplicates.
Postgres✓ Tested
List unordered pairs without duplicate reversals
SQLite: Join using an increasing key comparison to omit self-pairs and reversed duplicates.
SQLite✓ Tested
Check whether any item matches
JavaScript: some stops once a predicate succeeds.
JavaScript✓ Tested