Results for “uri”
Small, practical examples. Search by task or narrow things down below.
Generate a bounded integer range
JavaScript: Array.from supplies each output position to its mapping function.
JavaScript✓ Tested
Generate a bounded integer range
TypeScript: Array.from supplies each output position to its mapping function.
TypeScript✓ Tested
Increment a shared counter atomically
C#: Interlocked performs an indivisible update without a separate lock for this operation.
C#✓ Tested
Insert Docker’s small init process
Docker / Compose: The init option adds a PID 1 process that reaps children and forwards signals.
Docker / Compose✓ Tested
Keep both matching and rejected values
JavaScript: Use two explicit outputs when a caller needs both sides of a classification.
JavaScript✓ Tested
Keep both matching and rejected values
TypeScript: Use two explicit outputs when a caller needs both sides of a classification.
TypeScript✓ Tested
Limit concurrent access with SemaphoreSlim
C#: Release the semaphore in finally so exceptions cannot leave it permanently acquired.
C#✓ Tested
Limit the number of container processes
Docker / Compose: The pids-limit setting caps the container’s process count.
Docker / Compose✓ Tested
Map items to multiple output values
JavaScript: flatMap combines mapping and a one-level flattening operation.
JavaScript✓ Tested
Map items to multiple output values
TypeScript: flatMap combines mapping and a one-level flattening operation.
TypeScript✓ Tested
Observe cancellation through a token
C#: A cancellation token is cooperative; operations must check it or accept it as an argument.
C#✓ Tested
Parse a GUID without an exception
C#: TryParse reports malformed values with a boolean return.
C#✓ Tested