FIND YOUR NEXT FEW LINES

Results for “get”

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

848 snippets foundClear filters
Arduino / CEEPROM & program memory

Copy a flash string into a bounded RAM buffer

Arduino / C: strncpy_P reads from program memory into ordinary RAM.

Arduino / C✓ 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
TypeScriptArray traversal & selection

Copy a range without changing the source

TypeScript: Array.slice returns a shallow copy of the selected half-open range.

TypeScript✓ Tested
Arduino / CText & bounded buffers

Copy a string with a guaranteed terminator

Arduino / C: Reserve one character for the terminator when copying a bounded string.

Arduino / C✓ Tested
TypeScriptObject behavior & collections

Copy nested structured data independently

TypeScript: structuredClone creates an independent copy of supported structured values.

TypeScript✓ Tested
Arduino / CDigital signals & interrupts

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
Arduino / CDigital input & output

Count a falling edge with an interrupt

Increment a counter when an external input changes.

attachInterrupt✓ Tested
Arduino / CDigital signals & interrupts

Count a rising edge with an interrupt

Arduino / C: RISING triggers when the input changes from low to high.

Arduino / C✓ Tested
PythonDates & time zones

Count days between calendar dates

Python: Subtract date objects to get an exact calendar-day difference.

Python✓ Tested
TypeScriptUTC date operations

Count days between UTC-midnight dates

TypeScript: A day is exactly 86400000 milliseconds for these explicitly UTC-midnight inputs.

TypeScript✓ Tested
TypeScriptText handling & Unicode

Count Unicode code points in a string

TypeScript: String iteration combines surrogate pairs, unlike the UTF-16 length property.

TypeScript✓ Tested
TypeScriptCollections & records

Count words using a Map

Update a keyed counter without losing its value type.

Map✓ Tested