Results for “File operations & binary data”
Small, practical examples. Search by task or narrow things down below.
Count occurrences in a sorted sequence
C++: equal_range finds the half-open interval containing values equal to the key.
C++✓ Tested
Count set bits in an unsigned integer
C: Clearing the lowest set bit on each iteration counts only one iteration per set bit.
C✓ Tested
Count the elements in an array
Bash Scripts: The array length form counts assigned elements, not characters in the first value.
Bash Scripts✓ Tested
Create a nested directory tree
Create a nested directory tree in a complete Rust program using the standard library.
Rust✓ Tested
Create nested directories
Create nested directories using a complete Go program with explicit sample inputs.
Go✓ Tested
Declare a preferred canonical URL
HTML: A canonical link identifies the preferred public URL for duplicate representations of a document.
HTML✓ Tested
Declare an indexing preference for a draft page
HTML: A robots meta element can request noindex while allowing link following.
HTML✓ Tested
Decode a 16-bit big-endian integer
C: Promote bytes to an unsigned integer type before combining shifted values.
C✓ Tested
Decode a validated pair of hexadecimal digits
C: Convert each nibble and reject a nonhexadecimal character before combining them.
C✓ Tested
Deserialize a JSON object into a dictionary
C#: Specify the value type expected from a known JSON shape.
C#✓ Tested
Detect an invalid Date object
JavaScript: An invalid Date has a NaN time value.
JavaScript✓ Tested
Detect an invalid Date object
TypeScript: An invalid Date has a NaN time value.
TypeScript✓ Tested