Results for “Array operations”
Small, practical examples. Search by task or narrow things down below.
Handle a filename pattern with no matches
Use nullglob so an unmatched pattern produces an empty array.
nullglob✓ Tested
Measure a small seekable binary file
C: Seek to the end and inspect ftell, checking both operations for errors.
C✓ Tested
Observe cancellation through a token
C#: A cancellation token is cooperative; operations must check it or accept it as an argument.
C#✓ Tested
Pass values through a custom event
jQuery: trigger passes its extra argument array after the event object.
jQuery✓ Tested
Produce a lazy sequence with a generator
JavaScript: A generator yields one value per iteration without building an intermediate array.
JavaScript✓ Tested
Produce a lazy sequence with a generator
TypeScript: A generator yields one value per iteration without building an intermediate array.
TypeScript✓ Tested
Read a JSONB field as text
Extract a nested value from a JSON document.
jsonb✓ Tested
Read a scalar JSON property
Extract a named value using a JSON path.
JSON_VALUE✓ Tested
Read and total a flash lookup table
Arduino / C: Array size can be computed at compile time even for a flash-resident table.
Arduino / C✓ Tested
Read one JSON document per line
Python: Parse nonempty JSON Lines records independently instead of loading a JSON array.
Python✓ Tested
Remove duplicate values
Use a JavaScript Set to preserve the first occurrence of each primitive value.
JavaScript✓ Tested
Replace a nested JSONB value
Change one path with jsonb_set.
jsonb_set✓ Tested