Results for “per”
Small, practical examples. Search by task or narrow things down below.
Inspect a file length without reading it
C#: Use FileInfo.Length to retrieve a logical size in bytes.
C#✓ Tested
Join array items with a one-character separator
Bash Scripts: A local IFS controls the separator used by the quoted star expansion.
Bash Scripts✓ Tested
Keep a callback stable between renders
Keep a callback stable between renders with a small React component and explicit browser behavior.
React✓ Tested
Limit the bytes read from a stream
Limit the bytes read from a stream using a complete Go program with explicit sample inputs.
Go✓ Tested
List regular files recursively in sorted order
C++: Collect relative paths before sorting because directory iteration order is unspecified.
C++✓ Tested
Locate a value in a sorted array
Java: Use Arrays.binarySearch only after establishing ascending order.
Java✓ Tested
Make a script executable by its owner
Linux Commands: Add the owner execute bit without replacing all permission bits.
Linux Commands✓ Tested
Mark a nonurgent state update as a transition
Mark a nonurgent state update as a transition with a small React component and explicit browser behavior.
React✓ Tested
Memoize a component with stable props
Memoize a component with stable props with a small React component and explicit browser behavior.
React✓ Tested
Memoize a derived collection
Memoize a derived collection with a small React component and explicit browser behavior.
React✓ Tested
Memoize a sorted copy of state
Memoize a sorted copy of state with a small React component and explicit browser behavior.
React✓ Tested
Memoize an object passed to a provider
Memoize an object passed to a provider with a small React component and explicit browser behavior.
React✓ Tested