Results for “library”
Small, practical examples. Search by task or narrow things down below.
Produce compact deterministic JSON
Python: Sort dictionary keys and remove separator whitespace for a reproducible representation.
Python✓ Tested
Propagate a parsing error with question mark
Propagate a parsing error with question mark in a complete Rust program using the standard library.
Rust✓ Tested
Protect a shared counter
Protect a shared counter using a complete Go program with explicit sample inputs.
Go✓ Tested
Protect shared mutable state with a mutex
Protect shared mutable state with a mutex in a complete Rust program using the standard library.
Rust✓ Tested
Provide a default for a missing value
Provide a default for a missing value in a complete Rust program using the standard library.
Rust✓ 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
Queue values in a buffered channel
Queue values in a buffered channel using a complete Go program with explicit sample inputs.
Go✓ Tested
Raise and catch a domain-specific exception
Python: Give a validation failure its own exception type so callers can handle it narrowly.
Python✓ Tested
Range over a closed channel
Range over a closed channel using a complete Go program with explicit sample inputs.
Go✓ Tested
Read a big-endian integer from bytes
Java: Set a byte order explicitly when handling a binary protocol.
Java✓ Tested
Read a big-endian integer from bytes
Read a big-endian integer from bytes using a complete Go program with explicit sample inputs.
Go✓ Tested
Read a channel until all senders close
Read a channel until all senders close in a complete Rust program using the standard library.
Rust✓ Tested