FIND YOUR NEXT FEW LINES

Results for “target”

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

264 snippets foundClear filters
Arduino / CGetting Started

Choose the smaller of two values

Arduino / C: Choose the smaller of two values on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
TypeScriptNumbers & numeric validation

Clamp a number between inclusive bounds

TypeScript: Combine Math.min and Math.max when lower is no greater than upper.

TypeScript✓ Tested
TypeScriptPromises & iteration protocols

Clean up a generator after an early break

TypeScript: Breaking a for-of loop closes a generator and runs its finally block.

TypeScript✓ Tested
Arduino / CBinary values & packets

Clear a flag without affecting neighboring bits

Arduino / C: bitClear resets only the selected bit.

Arduino / C✓ Tested
Arduino / CSerial communication

Collect a serial line in a fixed buffer

Read a short command without dynamic String allocation.

serial line✓ Tested
Arduino / CGetting Started

Combine several Serial.print calls

Arduino / C: Combine several Serial.print calls on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
TypeScriptGetting Started

Combine text with a name

TypeScript: Construct a greeting from a fixed prefix and a stored name.

TypeScript✓ Tested
Arduino / CText & bounded buffers

Compare a command case-sensitively

Arduino / C: strcmp returns zero when both null-terminated strings match.

Arduino / C✓ Tested
TypeScriptGetting Started

Compare a value with a limit

TypeScript: Turn a comparison into a readable yes or no result.

TypeScript✓ Tested
TypeScriptNumbers & numeric validation

Compare bounded floating-point results with a tolerance

TypeScript: Use an absolute error threshold for values known to be near one.

TypeScript✓ Tested
TypeScriptText handling & Unicode

Compare canonically equivalent Unicode text

TypeScript: Normalize to NFC before comparing equivalent composed and decomposed text.

TypeScript✓ Tested
Arduino / CTiming & control

Compare elapsed time across timer rollover

Use unsigned subtraction when a millisecond counter wraps.

rollover✓ Tested