FIND YOUR NEXT FEW LINES

Results for “Lifecycle & observable data”

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

639 snippets foundClear filters
PythonStructured data & serialization

Read a tab-separated table

Python: Select a delimiter explicitly rather than splitting lines manually.

Python✓ Tested
CFile positioning & lifecycle

Read bytes from a chosen file offset

C: Check fseek before reading so an unsupported or invalid seek is not ignored.

C✓ Tested
CFile positioning & lifecycle

Read characters without confusing EOF with a byte

C: Store fgetc in int so every unsigned-char value remains distinguishable from EOF.

C✓ Tested
PythonStructured data & serialization

Read elements from trusted XML

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

Python✓ 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
C#Collections & data structures

Remove matching items from a mutable list

C#: List.RemoveAll returns how many items it removed.

C#✓ Tested
CFile positioning & lifecycle

Remove one known scratch file

C: Check remove’s return value instead of assuming deletion succeeded.

C✓ Tested
Docker / ComposeNetworks & volume metadata

Remove one network attachment

Docker / Compose: network disconnect removes the specified attachment while retaining the container.

Docker / Compose✓ Tested
Docker / ComposeContainer lifecycle

Rename a container without recreating it

Docker / Compose: rename updates the container name while preserving its identity.

Docker / Compose✓ Tested
CFile positioning & lifecycle

Rename a known file

C: The standard rename function reports failure through its return value.

C✓ Tested
CFile positioning & lifecycle

Replace bytes at a known position in a binary file

C: Open in update mode and seek before writing a fixed-size replacement.

C✓ Tested
ReactEffects & lifecycle

Rerun an effect when its dependency changes

Rerun an effect when its dependency changes with a small React component and explicit browser behavior.

React✓ Tested