Results for “pre”
Small, practical examples. Search by task or narrow things down below.
Parse a date with an explicit input pattern
Java: Use DateTimeFormatter for a non-ISO date representation.
Java✓ Tested
Parse a hexadecimal integer with from_chars
C++: An explicit radix controls digit interpretation without a locale dependency.
C++✓ Tested
Parse digits with leading zeroes as decimal
Bash Scripts: The 10# prefix avoids Bash treating a leading zero as an octal notation.
Bash Scripts✓ Tested
Print a label beside a number
Arduino / C: Combine Serial.print and Serial.println to put text and a value on one line.
Arduino / C✓ Tested
Print a selected range of lines
Linux Commands: Use sed -n with a line address to suppress other output.
Linux Commands✓ Tested
Produce compact deterministic JSON
Python: Sort dictionary keys and remove separator whitespace for a reproducible representation.
Python✓ Tested
Quote a CSV field and double embedded quotes
C: A quoted CSV field represents a quote character by repeating it.
C✓ Tested
Quote a literal search term for a regex
C#: Regex.Escape prevents metacharacters in a literal term from changing the pattern.
C#✓ Tested
Read a button in the Serial Monitor
Arduino / C: Use a pull-up input and if/else to report three button readings.
Arduino / C✓ Tested
Read a button with the internal pull-up
Treat a grounded input as a pressed button.
INPUT_PULLUP✓ Tested
Read a page after a known unique key
SQL: A keyset predicate avoids scanning and discarding an increasing offset on a suitable index.
SQL✓ Tested
Read a page after a known unique key
SQL Server: A keyset predicate avoids scanning and discarding an increasing offset on a suitable index.
SQL Server✓ Tested