Results for “Small algorithms & bit operations”
Small, practical examples. Search by task or narrow things down below.
Centralize state changes in a reducer
Centralize state changes in a reducer with a small React component and explicit browser behavior.
React✓ Tested
Check any and all stream elements
Java: Use short-circuiting match operations for predicates over a Java collection.
Java✓ Tested
Choose a local file through a labeled control
HTML: A file input exposes selected file metadata to the page without providing arbitrary filesystem access.
HTML✓ Tested
Choose an action with case
Bash Scripts: Choose an action with case with a small standalone Bash program.
Bash Scripts✓ Tested
Choose an action with switch
Map a small command value to a result.
switch✓ Tested
Choose between two render branches
Choose between two render branches with a small React component and explicit browser behavior.
React✓ Tested
Choose between two script branches
Bash Scripts: Choose between two script branches with a small standalone Bash program.
Bash Scripts✓ Tested
Choose labels from a language context
Choose labels from a language context with a small React component and explicit browser behavior.
React✓ Tested
Clamp a value to a range
Use C++17 clamp to bound a numeric value.
C++✓ Tested
Clean up a subscription when a child unmounts
Clean up a subscription when a child unmounts with a small React component and explicit browser behavior.
React✓ Tested
Collect selected options from a multi-select
Collect selected options from a multi-select with a small React component and explicit browser behavior.
React✓ Tested
Combine independent asynchronous results
Combine independent asynchronous results with a small React component and explicit browser behavior.
React✓ Tested