Results for “tr”
Small, practical examples. Search by task or narrow things down below.
Format an integer into a caller-owned buffer
C++: to_chars avoids allocation and reports whether the buffer was large enough.
C++✓ Tested
Format decimal output
Use fixed and setprecision to print two C++ decimal places.
C++✓ Tested
Format several integers in a fixed buffer
Arduino / C: snprintf limits writes to the buffer size and includes a terminating null byte.
Arduino / C✓ Tested
Format text in lowercase
Format text in lowercase with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Format text through a built-in pipe
Format text through a built-in pipe with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Format whole seconds as hours minutes and seconds
TypeScript: Use integer divisions and remainders for a nonnegative duration.
TypeScript✓ Tested
Forward input props to a reusable field
Forward input props to a reusable field with a small React component and explicit browser behavior.
React✓ Tested
Generate a bounded Fibonacci sequence
C: Keep only the two previous values instead of using exponential recursive calls.
C✓ Tested
Generate a bounded sequence recursively
Use a recursive CTE with a recursion limit.
recursive CTE✓ Tested
Generate and measure a short output pulse
Arduino / C: delayMicroseconds can create a short blocking pulse on an output pin.
Arduino / C✓ Tested
Give an LED pin a constant name
Arduino / C: Use const to name the built-in LED pin and reuse it in output instructions.
Arduino / C✓ Tested
Give an optional property a default
Handle missing object fields with nullish coalescing.
optional✓ Tested