Results for “read text”
Small, practical examples. Search by task or narrow things down below.
Normalize a path without touching the filesystem
C++: lexically_normal removes redundant dot components using path syntax alone.
C++✓ Tested
Number a sorted result
Assign a row number without changing stored data.
row_number✓ Tested
Number rows within each group
Assign ordered row numbers with a window function.
row_number✓ Tested
Observe an exception from an asynchronous task
C++: Calling get rethrows an exception captured by the future.
C++✓ Tested
Observe shared ownership without extending its lifetime
C++: A weak_ptr can be locked while an owner exists and becomes expired after the last owner is released.
C++✓ Tested
Open a link in a separate tab
Declare a separate browsing context with an explicit noopener relationship.
HTML✓ Tested
Own one dynamically allocated value with unique_ptr
C++: make_unique allocates a value whose lifetime is tied to its owning smart pointer.
C++✓ Tested
Pad a numeric label
Convert a number to text and pad it to a fixed width.
JavaScript✓ Tested
Parse a complete integer without exceptions
C++: from_chars reports both an error code and the first unconsumed character.
C++✓ Tested
Parse a hexadecimal integer with from_chars
C++: An explicit radix controls digit interpretation without a locale dependency.
C++✓ Tested
Parse a JSON string
Convert a JSON string into a Python dictionary and read values by key.
json✓ Tested
Parse a short option with getopts
Read a named option and handle invalid flags explicitly.
getopts✓ Tested