FIND YOUR NEXT FEW LINES

Results for “int”

Small, practical examples. Search by task or narrow things down below.

797 snippets foundClear filters
ReactGetting Started

Control a text input

Control a text input with a small React component and explicit browser behavior.

React✓ Tested
Arduino / CDigital input & output

Control an LED from a button

Translate an active-low button input into an LED output.

button✓ Tested
CSSType & reading flow

Control tab width in preformatted content

CSS: Tab-size defines the interval of tab stops in a preformatted block.

CSS✓ Tested
C++Tasks & synchronization

Convert a duration to another unit explicitly

C++: duration_cast converts units and truncates fractional integer units.

C++✓ Tested
PythonDates & time zones

Convert a duration to hours and minutes

Python: Use divmod to split nonnegative whole seconds into display components.

Python✓ Tested
Arduino / CSensor calculations

Convert Celsius to Fahrenheit

Arduino / C: Use floating-point constants to avoid integer division.

Arduino / C✓ Tested
SQLiteDates & time

Convert Unix time to a timestamp

Interpret a seconds-since-epoch value as UTC.

unixepoch✓ Tested
Linux CommandsFiles & folders

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
HTMLTables & list numbering

Count an ordered list downward

HTML: The reversed attribute changes the native numbering direction.

HTML✓ Tested
GitCommit history & revision selection

Count commits reachable from a revision

Git: rev-list --count counts reachable commits without printing commit identifiers.

Git✓ Tested
Arduino / CGetting Started

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
Linux CommandsText processing

Count lines in a file

Count newline characters in a text file, printing only the count without the filename.

lines✓ Tested