FIND YOUR NEXT FEW LINES

Results for “Accessible structure”

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

97 snippets foundClear filters
PythonStructured data & serialization

Represent a record with a dataclass

Python: Generate initialization and convert a typed record to a dictionary.

Python✓ Tested
CStructures & function interfaces

Represent a small set of named states

C: An enum gives symbolic names to integer state values.

C✓ Tested
PythonStructured data & serialization

Return a small immutable named record

Python: Use NamedTuple when callers need both tuple behavior and named fields.

Python✓ Tested
CStructures & function interfaces

Return a status separately from a calculated result

C: An output pointer lets a function return success or failure independently of its numeric result.

C✓ Tested
C#Collections & data structures

Search a sorted array efficiently

C#: Array.BinarySearch requires an array sorted with the same comparison rules.

C#✓ Tested
JavaScriptArray traversal & selection

Separate a first item from the remaining items

JavaScript: Array destructuring and a rest element produce named pieces of a sequence.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Separate a first item from the remaining items

TypeScript: Array destructuring and a rest element produce named pieces of a sequence.

TypeScript✓ Tested
CBinary formats & structured parsing

Serialize a 16-bit integer in big-endian order

C: Explicit shifts make a byte format independent of the CPU’s native byte order.

C✓ Tested
PowerShellStructured formats & encodings

Serialize nested objects with an explicit depth

PowerShell: Select a sufficient depth so nested data is retained instead of converted into a descriptive string.

PowerShell✓ Tested
CStructures & function interfaces

Track which union member is currently valid

C: An explicit tag tells callers which overlaid union value to read.

C✓ Tested
C#Collections & data structures

Use a last-in first-out stack

C#: Stack is useful for reversible traversal and other nested operations.

C#✓ Tested
C#Collections & data structures

Use case-insensitive dictionary keys

C#: Choose an ordinal comparer when case-insensitive keys represent identifiers.

C#✓ Tested