FIND YOUR NEXT FEW LINES

Results for “Binary formats & structured parsing”

Small, practical examples. Search by task or narrow things down below.

155 snippets foundClear filters
SQL ServerDates & text

Add days to a date

Use DATEADD for date arithmetic.

DATEADD✓ Tested
PythonNumbers & calculations

Calculate with exact rational values

Python: Use Fraction for exact ratios rather than binary floating-point approximations.

Python✓ Tested
JavaScriptNumbers & numeric validation

Convert between integer bases

JavaScript: Supply a radix when parsing a nondecimal integer string.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Convert between integer bases

TypeScript: Supply a radix when parsing a nondecimal integer string.

TypeScript✓ Tested
PythonFile operations & archives

Hash a file without reading it all at once

Python: Feed fixed-size binary chunks into SHA-256 for files larger than memory.

Python✓ Tested
GitMerging & replaying changes

List the paths with unresolved merge conflicts

Git: The U diff filter identifies unmerged entries without parsing human-readable status output.

Git✓ Tested
CNumbers & memory

Parse an integer with validation

Validate range and trailing characters when parsing a C integer with strtol.

C✓ Tested
Arduino / CSerial communication

Print integers in different bases

Inspect a byte in decimal, hexadecimal, and binary.

Serial✓ Tested
JavaPrecise numeric calculations

Round a decimal with an explicit rule

Java: Construct BigDecimal from text to avoid importing a binary floating-point approximation.

Java✓ Tested
C++Containers & compound values

Store and inspect a fixed set of bits

C++: bitset offers named operations and a readable binary representation.

C++✓ Tested
CFile positioning & lifecycle

Use an automatically removed temporary file

C: tmpfile creates a binary update stream whose file is removed when closed.

C✓ Tested