FIND YOUR NEXT FEW LINES

Results for “tr”

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

1534 snippets foundClear filters
C++Getting Started

Read the first collection element

C++: Access index zero only after establishing that the collection is nonempty.

C++✓ Tested
CGetting Started

Read the first collection element

C: Access index zero only after establishing that the collection is nonempty.

C✓ Tested
SQLiteTables & writes

Read values from an inserted row

Use RETURNING to retrieve an automatically assigned row ID.

RETURNING✓ Tested
TypeScriptPromises & iteration protocols

Recover from an expected promise rejection

TypeScript: Return a fallback from catch so later handlers receive an ordinary resolved value.

TypeScript✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Reject a missing required configuration value

Bash Scripts: Check a required value explicitly and emit a controlled diagnostic before exiting.

Bash Scripts✓ Tested
Arduino / CEEPROM & program memory

Reject an unsupported settings version

Arduino / C: A version byte lets firmware fall back when stored settings use another format.

Arduino / C✓ Tested
C++Numeric parsing & calculations

Reject infinite and NaN numeric values

C++: std::isfinite excludes special floating-point values.

C++✓ Tested
Arduino / CArrays & embedded state

Reject insertion when a fixed queue is full

Arduino / C: Track a count separately from circular read and write positions.

Arduino / C✓ Tested
CNumeric parsing & arithmetic

Reject NaN and infinite values

C: isfinite detects whether a floating-point value is an ordinary finite number.

C✓ Tested
Arduino / CSensor calculations

Reject one outlier with a median-of-three filter

Arduino / C: Sorting three values leaves the median in the middle.

Arduino / C✓ Tested
ReactRefs & DOM interaction

Remember the previously committed value

Remember the previously committed value with a small React component and explicit browser behavior.

React✓ Tested
PythonText validation & encoding

Remove a known prefix safely

Python: Use removeprefix instead of lstrip when removing a literal prefix rather than a set of characters.

Python✓ Tested