Results for “C#”
Small, practical examples. Search by task or narrow things down below.
Load a small properties configuration
Java: Use a Reader to make the configuration character encoding explicit.
Java✓ Tested
Load functions from a trusted local script
Bash Scripts: Source executes a file in the current shell so its function definitions remain available.
Bash Scripts✓ Tested
Load service variables from an env file
Docker / Compose: env_file supplies runtime environment values.
Docker / Compose✓ Tested
Locate a value in a sorted array
Java: Use Arrays.binarySearch only after establishing ascending order.
Java✓ Tested
Look up a dictionary value
Use TryGetValue for a C# dictionary lookup with a fallback.
C#✓ Tested
Look up values in an associative array
Use named keys for a small in-memory configuration table.
dictionary✓ Tested
Loop over an inclusive range
Loop over an inclusive range in a complete Rust program using the standard library.
Rust✓ Tested
Maintain a rolling sum in a circular window
Arduino / C: Subtract the overwritten sample before adding the next one.
Arduino / C✓ Tested
Make a Compose service’s filesystem read-only
Docker / Compose: Make a Compose service’s filesystem read-only in a small Compose file.
Docker / Compose✓ Tested
Make a pair of columns unique together
SQL: A composite primary key permits repeated individual values while forbidding a duplicate combination.
SQL✓ Tested
Make a pair of columns unique together
SQL Server: A composite primary key permits repeated individual values while forbidding a duplicate combination.
SQL Server✓ Tested
Make a pair of columns unique together
Postgres: A composite primary key permits repeated individual values while forbidding a duplicate combination.
Postgres✓ Tested