FIND YOUR NEXT FEW LINES

Results for “tr”

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

1534 snippets foundClear filters
C++Ordering & set operations

Group matching values while preserving their order

C++: stable_partition keeps the relative order within both predicate groups.

C++✓ Tested
ReactGetting Started

Group siblings with a fragment

Group siblings with a fragment with a small React component and explicit browser behavior.

React✓ Tested
CDynamic memory & ownership

Grow an allocation without losing it on failure

C: Assign realloc to a temporary pointer so the original allocation remains available if growth fails.

C✓ Tested
ReactGetting Started

Handle a button click

Handle a button click with a small React component and explicit browser behavior.

React✓ Tested
AngularGetting Started

Handle a button click

Handle a button click with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactGetting Started

Handle a form without navigating

Handle a form without navigating with a small React component and explicit browser behavior.

React✓ Tested
TypeScriptSafe data handling

Handle a result with a discriminated union

Separate success data from an error message.

discriminated union✓ Tested
AngularTemplate-driven forms

Handle a template-driven form submission

Handle a template-driven form submission with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactAsync work & status

Handle an asynchronous failure

Handle an asynchronous failure with a small React component and explicit browser behavior.

React✓ Tested
ReactAccessibility & events

Handle an Escape key press

Handle an Escape key press with a small React component and explicit browser behavior.

React✓ Tested
AngularGetting Started

Handle an event emitted by a child

Handle an event emitted by a child with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
PythonFunctions & error handling

Handle an expected child-process failure

Python: Catch CalledProcessError when check=True reports a nonzero exit status.

Python✓ Tested