FIND YOUR NEXT FEW LINES

Results for “Form serialization & state”

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

895 snippets foundClear filters
C#JSON & binary formats

Read an optional JSON property safely

C#: Use TryGetProperty instead of throwing when an optional property is absent.

C#✓ Tested
PythonStructured data & serialization

Read elements from trusted XML

Python: Use ElementTree to inspect a small trusted XML document.

Python✓ Tested
PowerShellStructured formats & encodings

Read JSON into a hashtable

PowerShell: AsHashtable produces dictionary-style results for keys that are data rather than fixed property names.

PowerShell✓ Tested
PythonStructured data & serialization

Read one JSON document per line

Python: Parse nonempty JSON Lines records independently instead of loading a JSON array.

Python✓ Tested
RustIterators & transformations

Read values until a condition changes

Read values until a condition changes in a complete Rust program using the standard library.

Rust✓ Tested
Arduino / CArrays & embedded state

Reject insertion when a fixed queue is full

Arduino / C: Track a count separately from circular read and write positions.

Arduino / C✓ Tested
CArray transformations

Remove adjacent duplicates from a sorted array

C: Compact equal neighbors with a write index after sorting or otherwise establishing order.

C✓ Tested
ReactState & reducers

Remove an item with filter

Remove an item with filter with a small React component and explicit browser behavior.

React✓ Tested
Linux CommandsTransforming text

Remove blank or whitespace-only lines

Linux Commands: Use a POSIX character class so tabs and spaces are handled together.

Linux Commands✓ Tested
Linux CommandsTransforming text

Remove carriage-return characters

Linux Commands: Use tr -d to remove CR characters from Windows-style line endings.

Linux Commands✓ Tested
C#LINQ transformations

Remove duplicate records by a selected key

C#: DistinctBy keeps the first record for each key in encounter order.

C#✓ Tested
CArray transformations

Remove one array element and close the gap

C: memmove handles the overlap while the logical length shrinks by one.

C✓ Tested