Results for “z”
Small, practical examples. Search by task or narrow things down below.
Retrieve the result of an asynchronous task
C++: The explicit async launch policy requests asynchronous execution rather than deferred evaluation.
C++✓ Tested
Return a small immutable named record
Python: Use NamedTuple when callers need both tuple behavior and named fields.
Python✓ Tested
Run a task on a thread and join it
C++: Join before reading a result written by the worker thread.
C++✓ Tested
Set several selected options
jQuery: Passing an array to val selects matching values in a multiple select.
jQuery✓ Tested
Skip weekends when advancing dates
Python: Walk calendar dates and count only Monday through Friday.
Python✓ Tested
Split simple delimited text in place
C: strtok inserts terminators into a writable buffer and skips repeated delimiter characters.
C✓ Tested
Store an object associated with an element
jQuery: data retains JavaScript values without serializing them into HTML attributes.
jQuery✓ Tested
Wait for shared state with a condition variable
C++: Use a predicate so spurious wakeups cannot allow the worker to continue before the state is ready.
C++✓ Tested
Write a JSON file
Save a dictionary as readable, indented JSON while preserving Unicode characters.
json✓ Tested
Accumulate pipeline input across begin process and end
PowerShell: Keep initialization and final output separate from per-item work.
PowerShell✓ Tested
Add calendar days
Use DateOnly for a date without a time zone in C#.
C#✓ Tested
Advance an index around a fixed collection
Arduino / C: Modulo wraps a bounded nonnegative index to zero.
Arduino / C✓ Tested