Results for “read file”
Small, practical examples. Search by task or narrow things down below.
Use an associated constructor
Use an associated constructor in a complete Rust program using the standard library.
Rust✓ Tested
Use if to produce a value
Use if to produce a value in a complete Rust program using the standard library.
Rust✓ Tested
Use named states for a controller
Arduino / C: An enum makes state transitions easier to read than unexplained numbers.
Arduino / C✓ Tested
Validate a complete identifier
C++: regex_match requires the pattern to match the complete input sequence.
C++✓ Tested
Validate UTF-8 bytes
Validate UTF-8 bytes using a complete Go program with explicit sample inputs.
Go✓ Tested
Verify that a one-off container was removed
Docker / Compose: An automatically removed container no longer appears in an exact-name listing.
Docker / Compose✓ Tested
Visit every item in a collection
C++: Print each element in the collection’s original order.
C++✓ Tested
Visit selected elements
Use jQuery each to label every item with its one-based position.
jQuery✓ Tested
Wait for a container to exit
Docker / Compose: wait blocks until the container stops and prints its exit code.
Docker / Compose✓ Tested
Wait for a healthy Compose dependency
Docker / Compose: The service_healthy dependency condition waits for the dependency’s health command to succeed.
Docker / Compose✓ Tested
Wait for concurrent workers
Wait for concurrent workers using a complete Go program with explicit sample inputs.
Go✓ Tested
Wait for multiple promises
Use Promise.all to collect JavaScript results in input order.
JavaScript✓ Tested