Results for “Set-Content”
Small, practical examples. Search by task or narrow things down below.
Convert Unix seconds to an offset-aware timestamp
C#: DateTimeOffset preserves the UTC offset explicitly.
C#✓ Tested
Count set bits in an unsigned integer
C: Clearing the lowest set bit on each iteration counts only one iteration per set bit.
C✓ Tested
Discard incidental output from a setup command
PowerShell: Out-Null prevents setup objects from becoming part of a function or script’s useful result.
PowerShell✓ Tested
Display an instant at a fixed offset
Display an instant at a fixed offset using a complete Go program with explicit sample inputs.
Go✓ Tested
Distinguish unset variables from empty strings
Bash Scripts: Omitting the colon tests only whether a variable is unset; including it also treats an empty value as missing.
Bash Scripts✓ Tested
Encapsulate increment and reset operations
Encapsulate increment and reset operations with a small React component and explicit browser behavior.
React✓ Tested
Escape text for HTML content
Python: Use html.escape before placing plain text in an HTML text or quoted attribute context.
Python✓ Tested
Exclude a purely decorative image from accessible content
HTML: An empty alt indicates that this image adds no information beyond nearby content.
HTML✓ Tested
Extract a substring by offset and length
Bash Scripts: Bash substring offsets start at zero for an ordinary string.
Bash Scripts✓ Tested
Find common set members
Find common set members in a complete Rust program using the standard library.
Rust✓ Tested
Find members absent from another set
JavaScript: Negate a membership test to calculate the set difference.
JavaScript✓ Tested
Find members absent from another set
TypeScript: Negate a membership test to calculate the set difference.
TypeScript✓ Tested