Results for “read file”
Small, practical examples. Search by task or narrow things down below.
Convert ASCII text to lowercase safely
C++: Cast each byte to unsigned char before using the cctype function.
C++✓ Tested
Convert between hexadecimal text and bytes
PowerShell: Use the .NET hexadecimal helpers instead of parsing byte pairs manually.
PowerShell✓ Tested
Convert hexadecimal text to bytes
Python: Use bytes.fromhex for a readable byte representation and hex for the reverse conversion.
Python✓ Tested
Convert known numeric text to an integer
C++: Convert a trusted literal to an integer before adding. Validate external input before converting it.
C++✓ Tested
Convert Unix seconds into an aware UTC timestamp
PowerShell: DateTimeOffset.FromUnixTimeSeconds creates a value with an explicit UTC offset.
PowerShell✓ Tested
Convert Unix seconds to UTC
Convert Unix seconds to UTC using a complete Go program with explicit sample inputs.
Go✓ Tested
Convert Unix time to a timestamp
Interpret a seconds-since-epoch value as UTC.
unixepoch✓ Tested
Copy a flash string into a bounded RAM buffer
Arduino / C: strncpy_P reads from program memory into ordinary RAM.
Arduino / C✓ Tested
Copy a multibyte interrupt-owned counter atomically
Arduino / C: ATOMIC_RESTORESTATE restores the interrupt state after reading a shared value.
Arduino / C✓ Tested
Copy a slice without sharing storage
Copy a slice without sharing storage using a complete Go program with explicit sample inputs.
Go✓ Tested
Copy entries into another map
Copy entries into another map using a complete Go program with explicit sample inputs.
Go✓ Tested
Correct the latest unpublished commit message
Git: Amend replaces the current commit while preserving its tree when no new changes are staged.
Git✓ Tested