Results for “tr”
Small, practical examples. Search by task or narrow things down below.
Convert known numeric text to an integer
Java: Convert a trusted literal to an integer before adding. Validate external input before converting it.
Java✓ Tested
Convert known numeric text to an integer
JavaScript: Convert a trusted literal to an integer before adding. Validate external input before converting it.
JavaScript✓ Tested
Convert known numeric text to an integer
TypeScript: Convert a trusted literal to an integer before adding. Validate external input before converting it.
TypeScript✓ 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 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 received ASCII letters to uppercase
Arduino / C: ctype functions should receive an unsigned character value.
Arduino / C✓ Tested
Copy a file without replacing an existing destination
C++: The default copy_file policy refuses to overwrite an existing destination.
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 text into a fixed buffer
Use snprintf and check for truncation when copying a C string.
C✓ 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
Count a button’s falling edge in the main loop
Arduino / C: Compare each reading with the previous state to detect transitions.
Arduino / C✓ Tested
Count a falling edge with an interrupt
Increment a counter when an external input changes.
attachInterrupt✓ Tested