Results for “int”
Small, practical examples. Search by task or narrow things down below.
Control a text input
Control a text input with a small React component and explicit browser behavior.
React✓ Tested
Control an LED from a button
Translate an active-low button input into an LED output.
button✓ Tested
Control tab width in preformatted content
CSS: Tab-size defines the interval of tab stops in a preformatted block.
CSS✓ Tested
Convert a duration to another unit explicitly
C++: duration_cast converts units and truncates fractional integer units.
C++✓ Tested
Convert a duration to hours and minutes
Python: Use divmod to split nonnegative whole seconds into display components.
Python✓ Tested
Convert Celsius to Fahrenheit
Arduino / C: Use floating-point constants to avoid integer division.
Arduino / C✓ Tested
Convert Unix time to a timestamp
Interpret a seconds-since-epoch value as UTC.
unixepoch✓ Tested
Copy a file to a folder
Create a backup folder if needed, then copy a file into it while preserving its modification time and permission bits.
file✓ Tested
Count an ordered list downward
HTML: The reversed attribute changes the native numbering direction.
HTML✓ Tested
Count commits reachable from a revision
Git: rev-list --count counts reachable commits without printing commit identifiers.
Git✓ Tested
Count five LED flashes with a for loop
Arduino / C: Repeat an LED action a known number of times and print the current count.
Arduino / C✓ Tested
Count lines in a file
Count newline characters in a text file, printing only the count without the filename.
lines✓ Tested