Results for “Restoring & revising local work”
Small, practical examples. Search by task or narrow things down below.
Parse a hexadecimal integer with from_chars
C++: An explicit radix controls digit interpretation without a locale dependency.
C++✓ Tested
Parse a short option with getopts
Read a named option and handle invalid flags explicitly.
getopts✓ Tested
Parse a signed decimal integer
Parse a signed decimal integer in a complete Rust program using the standard library.
Rust✓ Tested
Parse a small set of long options
Bash Scripts: Use a loop and case statement to consume a value-bearing long option.
Bash Scripts✓ Tested
Parse an email address syntax
Parse an email address syntax using a complete Go program with explicit sample inputs.
Go✓ Tested
Parse digits with leading zeroes as decimal
Bash Scripts: The 10# prefix avoids Bash treating a leading zero as an octal notation.
Bash Scripts✓ Tested
Parse only valid integers
Parse only valid integers in a complete Rust program using the standard library.
Rust✓ Tested
Partition values into two collections
Partition values into two collections in a complete Rust program using the standard library.
Rust✓ Tested
Pass a named configuration value
Docker / Compose: Pass a named configuration value using a locally available Ubuntu image.
Docker / Compose✓ Tested
Pass a variable to standard input
Bash Scripts: A here-string supplies the expanded value followed by a newline.
Bash Scripts✓ Tested
Pass an environment variable
Supply configuration without changing an image.
environment✓ Tested
Pass dollar expressions through Compose
Docker / Compose: Double dollar signs defer expansion to the container shell.
Docker / Compose✓ Tested