FIND YOUR NEXT FEW LINES

Results for “after”

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

129 snippets foundClear filters
PostgresSchema design & transactions

Undo only the work after a savepoint

Postgres: After committing the fixtures, roll back a trial change while keeping earlier work in the second transaction.

Postgres✓ Tested
SQLiteSchema design & transactions

Undo only the work after a savepoint

SQLite: After committing the fixtures, roll back a trial change while keeping earlier work in the second transaction.

SQLite✓ Tested
PostgresDates & series

Add an interval to a date

Perform calendar arithmetic with an interval literal.

INTERVAL✓ Tested
GitStashing selected work

Apply and remove a successfully restored stash

Git: Pop removes the entry only after a successful application.

Git✓ Tested
Arduino / CTiming & control

Blink without blocking the loop

Use elapsed millis time instead of delay for a repeating action.

millis✓ Tested
PythonIteration & sequences

Calculate cumulative totals

Python: Use accumulate to retain the running sum after each input.

Python✓ Tested
Arduino / CGetting Started

Change an LED delay with a variable

Arduino / C: Assign a new value to a variable to change the next LED pulse duration.

Arduino / C✓ Tested
C++Text validation & parsing

Check a literal prefix in C++17

C++: Use string compare because starts_with was introduced after C++17.

C++✓ Tested
PythonFile operations & archives

Clean up a temporary directory automatically

Python: Use TemporaryDirectory as a context manager so cleanup also happens after exceptions.

Python✓ Tested
Arduino / CDigital signals & interrupts

Copy a multibyte interrupt-owned counter atomically

Arduino / C: ATOMIC_RESTORESTATE restores the interrupt state after reading a shared value.

Arduino / C✓ 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
CDynamic memory & ownership

Create an independent copy of a byte buffer

C: Allocate the exact byte length and copy only after checking the result.

C✓ Tested