Results for “tr”
Small, practical examples. Search by task or narrow things down below.
Normalize identifier case consistently
TypeScript: Use toLowerCase for a simple case-insensitive ASCII identifier lookup.
TypeScript✓ Tested
Notify a parent with a callback prop
Notify a parent with a callback prop with a small React component and explicit browser behavior.
React✓ Tested
Number a sorted result
Assign a row number without changing stored data.
row_number✓ Tested
Observe an exception from an asynchronous task
C++: Calling get rethrows an exception captured by the future.
C++✓ Tested
Observe shared ownership without extending its lifetime
C++: A weak_ptr can be locked while an owner exists and becomes expired after the last owner is released.
C++✓ Tested
Observe when a DOM node is attached
Observe when a DOM node is attached with a small React component and explicit browser behavior.
React✓ Tested
Offer a downloadable text file
HTML: The download attribute supplies a filename for this same-document data URL.
HTML✓ Tested
Open and close a native dialog
Open and close a native dialog with a small React component and explicit browser behavior.
React✓ Tested
Override context in a nested section
Override context in a nested section with a small React component and explicit browser behavior.
React✓ Tested
Pack two small values into one byte
Arduino / C: Mask each four-bit value before combining it.
Arduino / C✓ Tested
Pad a numeric label
Convert a number to text and pad it to a fixed width.
JavaScript✓ Tested
Pair corresponding list items
Python: Zip two equally sized sequences into pairs; strict mode rejects mismatched lengths on Python 3.10 or later.
Python✓ Tested