Results for “Bulk changes & set operations”
Small, practical examples. Search by task or narrow things down below.
Center a fixed-size absolute child with auto margins
CSS: An all-zero inset plus auto margins distributes the available space around the child.
CSS✓ Tested
Check exact array membership
Bash Scripts: Compare each element literally instead of searching a concatenated string.
Bash Scripts✓ Tested
Check whether all required keys exist
Python: Compare the required key set with a dictionary key view.
Python✓ Tested
Clean up a temporary directory automatically
Python: Use TemporaryDirectory as a context manager so cleanup also happens after exceptions.
Python✓ Tested
Clear all map entries
Clear all map entries using a complete Go program with explicit sample inputs.
Go✓ Tested
Clear an owning pointer after releasing its allocation
C: Assigning NULL helps prevent accidental reuse through the same variable.
C✓ Tested
Clone a map before editing it
Clone a map before editing it using a complete Go program with explicit sample inputs.
Go✓ Tested
Collect unique sorted values
Collect unique sorted values in a complete Rust program using the standard library.
Rust✓ Tested
Compare map contents
Compare map contents using a complete Go program with explicit sample inputs.
Go✓ Tested
Compute a simple XOR checksum
C: XOR all payload bytes into one byte to demonstrate a basic error-detection field.
C✓ Tested
Construct a date from Unix seconds
JavaScript: Multiply seconds by 1000 before creating a Date.
JavaScript✓ Tested
Construct a date from Unix seconds
TypeScript: Multiply seconds by 1000 before creating a Date.
TypeScript✓ Tested