FIND YOUR NEXT FEW LINES

Results for “Accessible structure”

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

97 snippets foundClear filters
PowerShellStructured formats & encodings

Handle a malformed JSON document

PowerShell: ConvertFrom-Json reports a terminating conversion error under the selected error preference.

PowerShell✓ Tested
PythonStructured data & serialization

Handle malformed JSON input

Python: Catch JSONDecodeError without hiding unrelated programming errors.

Python✓ Tested
JavaEncoding & structured values

Inspect components of a URI

Java: Use URI parsing instead of splitting a URL at punctuation manually.

Java✓ Tested
CStructures & function interfaces

Iterate over a fixed array of records

C: Compute the array element count with sizeof at the point where it is still an array.

C✓ Tested
CStructures & function interfaces

Keep function state between calls

C: A static local variable retains its stored value for the lifetime of the process.

C✓ Tested
JavaEncoding & structured values

Measure UTF-8 bytes separately from characters

Java: Encode a Java string before measuring its serialized byte length.

Java✓ 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
CBinary formats & structured parsing

Parse a bounded simple record with sscanf

C: A width limit protects the destination buffer and the consumed count detects trailing junk.

C✓ Tested
JavaEncoding & structured values

Parse a UUID and inspect its version

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

Java✓ 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
CStructures & function interfaces

Pass a function as a callback

C: A typed function pointer permits behavior to be supplied to another function.

C✓ Tested
C#Collections & data structures

Process a FIFO queue

C#: Queue removes elements in the order they were enqueued.

C#✓ Tested