Results for “map”
Small, practical examples. Search by task or narrow things down below.
Limit concurrent access with SemaphoreSlim
C#: Release the semaphore in finally so exceptions cannot leave it permanently acquired.
C#✓ Tested
Look up a map entry
Look up a map entry using a complete Go program with explicit sample inputs.
Go✓ Tested
Look up a map key
Use find to read a C++ map without inserting a missing key.
C++✓ Tested
Map a command with switch
Map a command with switch using a complete Go program with explicit sample inputs.
Go✓ Tested
Map an input range to an output range
Scale an integer reading to a different interval.
map✓ 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
Merge configuration maps with override precedence
PowerShell: Copy defaults before applying override keys so the original remains unchanged.
PowerShell✓ Tested
Preserve map insertion order
Java: Use LinkedHashMap when iteration should follow the order keys were first added.
Java✓ Tested
Query an ordered map’s key range
Query an ordered map’s key range in a complete Rust program using the standard library.
Rust✓ Tested
Read a map with a default
Return a fallback when a Java map does not contain a key.
Java✓ Tested
Remove a Map entry and detect whether it existed
JavaScript: Map.delete returns true only when an entry was present.
JavaScript✓ Tested