Results for “library”
Small, practical examples. Search by task or narrow things down below.
List files in a folder
List the names of regular files in a folder in alphabetical order, excluding subdirectories.
directory✓ Tested
List regular files
List immediate regular files in sorted order and close the Java directory stream.
Java✓ Tested
Load a small properties configuration
Java: Use a Reader to make the configuration character encoding explicit.
Java✓ Tested
Locate a value in a sorted array
Java: Use Arrays.binarySearch only after establishing ascending order.
Java✓ Tested
Look up a map entry
Look up a map entry using a complete Go program with explicit sample inputs.
Go✓ Tested
Look up a map key
Use find to read a C++ map without inserting a missing key.
C++✓ Tested
Loop over an inclusive range
Loop over an inclusive range in a complete Rust program using the standard library.
Rust✓ Tested
Map a command with switch
Map a command with switch using a complete Go program with explicit sample inputs.
Go✓ Tested
Match enum variants
Match enum variants in a complete Rust program using the standard library.
Rust✓ Tested
Measure a duration between instants
Java: Use Duration for elapsed timeline time and retrieve total seconds.
Java✓ Tested
Measure a duration between instants
Measure a duration between instants using a complete Go program with explicit sample inputs.
Go✓ Tested
Measure a short text value
Python: Read the length of an ASCII string. Non-ASCII text may use multiple code units or bytes depending on the language.
Python✓ Tested