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
JavaFile operations & binary data

Normalize relative path components

Java: Path.normalize removes redundant dot components without accessing the filesystem.

Java✓ Tested
Arduino / CBinary values & packets

Pack two small values into one byte

Arduino / C: Mask each four-bit value before combining it.

Arduino / C✓ Tested
RustParsing & byte data

Parse a Boolean literal

Parse a Boolean literal in a complete Rust program using the standard library.

Rust✓ Tested
C++Numeric parsing & calculations

Parse a complete integer without exceptions

C++: from_chars reports both an error code and the first unconsumed character.

C++✓ Tested
RustParsing & byte data

Parse a delimited integer record

Parse a delimited integer record in a complete Rust program using the standard library.

Rust✓ Tested
RustParsing & byte data

Parse a hexadecimal integer

Parse a hexadecimal integer in a complete Rust program using the standard library.

Rust✓ Tested
C++Numeric parsing & calculations

Parse a hexadecimal integer with from_chars

C++: An explicit radix controls digit interpretation without a locale dependency.

C++✓ Tested
RustParsing & byte data

Parse a signed decimal integer

Parse a signed decimal integer in a complete Rust program using the standard library.

Rust✓ Tested
JavaEncoding & structured values

Parse a UUID and inspect its version

Java: Use UUID.fromString for a standard UUID value.

Java✓ Tested
CNumeric parsing & arithmetic

Parse an unsigned hexadecimal integer

C: Use an explicit base and check both range and full consumption.

C✓ Tested
Bash ScriptsText parsing & arithmetic

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
PythonStructured data & serialization

Parse quoted CSV from an in-memory string

Python: Use StringIO with csv.reader so quoted commas are handled correctly.

Python✓ Tested