FIND YOUR NEXT FEW LINES

Results for “Encoding & structured values”

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

391 snippets foundClear filters
TypeScriptRegular expressions & URL encoding

Extract all regex matches with their groups

TypeScript: matchAll requires a global regular expression and returns an iterator of matches.

TypeScript✓ Tested
PythonText validation & encoding

Extract named regex fields

Python: Use named capture groups to parse a known date-shaped identifier.

Python✓ Tested
Arduino / CBinary values & packets

Extract the low and high byte of a value

Arduino / C: lowByte and highByte expose the two bytes of a 16-bit value.

Arduino / C✓ Tested
CBinary formats & structured parsing

Format a known timestamp in UTC

C: gmtime converts to UTC calendar fields and strftime formats them.

C✓ Tested
CBinary formats & structured parsing

Format a nonnegative integer amount as whole and fractional units

C: Keep the calculation in integer minor units and use two digits for the remainder.

C✓ Tested
RustErrors & optional values

Handle integer overflow without panicking

Handle integer overflow without panicking in a complete Rust program using the standard library.

Rust✓ Tested
PythonStructured data & serialization

Handle malformed JSON input

Python: Catch JSONDecodeError without hiding unrelated programming errors.

Python✓ Tested
C++Containers & compound values

Insert a map value only when a key is absent

C++: try_emplace preserves the old value when insertion does not take place.

C++✓ Tested
JavaScriptRegular expressions & URL encoding

Inspect the parsed pieces of a URL

JavaScript: Use URL properties rather than splitting a URL at punctuation.

JavaScript✓ Tested
TypeScriptRegular expressions & URL encoding

Inspect the parsed pieces of a URL

TypeScript: Use URL properties rather than splitting a URL at punctuation.

TypeScript✓ Tested
RustErrors & optional values

Keep an optional value only when valid

Keep an optional value only when valid in a complete Rust program using the standard library.

Rust✓ Tested
C#Text validation & encoding

Normalize canonically equivalent Unicode strings

C#: Normalize to NFC before an ordinal comparison of equivalent character sequences.

C#✓ Tested