FIND YOUR NEXT FEW LINES

Results for “date arithmetic”

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

292 snippets foundClear filters
Bash ScriptsText parsing & arithmetic

Split a record while retaining its remainder

Bash Scripts: The final read variable receives the remainder of a delimited record.

Bash Scripts✓ Tested
Linux CommandsDates & process utilities

Start a command with a minimal environment

Linux Commands: Use env -i with an explicit PATH for a controlled child environment.

Linux Commands✓ Tested
Bash ScriptsLoops & decisions

Sum a range of integers

Use an arithmetic loop without launching external processes.

arithmetic✓ Tested
Bash ScriptsText parsing & arithmetic

Test numeric divisibility with a remainder

Bash Scripts: The modulo operator computes an integer remainder.

Bash Scripts✓ Tested
Arduino / CData & storage

Write and read a setting in EEPROM

Persist one byte using the update operation.

EEPROM✓ Tested
PythonNumbers & calculations

Calculate the number of required pages

Python: Use integer arithmetic to round a nonnegative count up to a positive page size.

Python✓ Tested
Bash ScriptsLoops & decisions

Check whether input is a nonnegative integer

Reject empty input and nonnumeric characters before arithmetic.

validation✓ Tested
SQLSchema design & transactions

Commit multiple related changes together

SQL: The first transaction prepares the fixtures. The second commits both updates as one unit.

SQL✓ Tested
SQL ServerSchema design & transactions

Commit multiple related changes together

SQL Server: The first transaction prepares the fixtures. The second commits both updates as one unit.

SQL Server✓ Tested
PostgresSchema design & transactions

Commit multiple related changes together

Postgres: The first transaction prepares the fixtures. The second commits both updates as one unit.

Postgres✓ Tested
SQLiteSchema design & transactions

Commit multiple related changes together

SQLite: The first transaction prepares the fixtures. The second commits both updates as one unit.

SQLite✓ Tested
Arduino / CTiming & control

Compare elapsed time across timer rollover

Use unsigned subtraction when a millisecond counter wraps.

rollover✓ Tested