Results for “pre”
Small, practical examples. Search by task or narrow things down below.
Update several classifications in one statement
SQLite: A CASE expression computes the new value for each row covered by the update predicate.
SQLite✓ Tested
Use a fallback for a missing hashtable entry
PowerShell: Test the key explicitly so legitimate false or zero values are preserved.
PowerShell✓ Tested
Use case-insensitive dictionary keys
C#: Choose an ordinal comparer when case-insensitive keys represent identifiers.
C#✓ Tested
Validate a complete identifier
Java: String.matches requires the regular expression to match the entire input.
Java✓ Tested
Validate an unknown value with a type guard
Check a field before treating unknown data as a typed object.
unknown✓ Tested
Wait for shared state with a condition variable
C++: Use a predicate so spurious wakeups cannot allow the worker to continue before the state is ready.
C++✓ Tested
Write a JSON file
Save a dictionary as readable, indented JSON while preserving Unicode characters.
json✓ Tested
Write a multiline string without expanding variables
PowerShell: A single-quoted here-string preserves dollar signs literally.
PowerShell✓ Tested
Write dictionaries to CSV
Write a list of dictionaries to a CSV file with a header row and a predictable column order.
csv✓ Tested