FIND YOUR NEXT FEW LINES

Results for “JSON & binary formats”

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

123 snippets foundClear filters
JavaScriptObjects & JSON

Merge object settings

Use object spread to apply JavaScript overrides to defaults.

JavaScript✓ Tested
PythonStructured data & serialization

Pack and unpack a network-order integer

Python: Use an explicit byte order so the binary format is independent of the host architecture.

Python✓ Tested
Arduino / CSerial communication

Print integers in different bases

Inspect a byte in decimal, hexadecimal, and binary.

Serial✓ Tested
JavaEncoding & structured values

Read a big-endian integer from bytes

Java: Set a byte order explicitly when handling a binary protocol.

Java✓ Tested
JavaScriptObjects & JSON

Read a nested value safely

Combine optional chaining with nullish coalescing in JavaScript.

JavaScript✓ Tested
PythonJSON & CSV

Read CSV rows as dictionaries

Read a CSV file using its header row as dictionary keys, so each column can be accessed by name.

csv✓ Tested
SQL ServerJSON & results

Read values generated by INSERT

Capture an IDENTITY value with OUTPUT.

OUTPUT✓ 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
PowerShellCollections & objects

Select object properties

Create a smaller object with only the fields you need.

Select-Object✓ Tested
JavaScriptObjects & JSON

Serialize an object

Turn a JavaScript object into JSON text.

JavaScript✓ Tested
Docker / ComposeBuild images

Set an image’s default command

Use JSON array syntax for a predictable command.

Dockerfile✓ 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