FIND YOUR NEXT FEW LINES

Results for “Parsing & byte data”

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

761 snippets foundClear filters
RustFunctions & data types

Accept different types with a generic function

Accept different types with a generic function in a complete Rust program using the standard library.

Rust✓ Tested
C#Collections & data structures

Add a dictionary entry only if absent

C#: TryAdd reports a duplicate key without replacing its existing value.

C#✓ Tested
Linux CommandsStreams & byte tools

Append a stream to a log file

Linux Commands: Use tee -a to preserve existing log contents.

Linux Commands✓ Tested
CStrings & byte buffers

Append text only when the destination has enough capacity

C: Check the combined lengths including the terminator before using strcat.

C✓ Tested
Arduino / CBinary values & packets

Assemble a big-endian 16-bit value

Arduino / C: Cast to an unsigned 16-bit type before shifting the high byte.

Arduino / C✓ Tested
Docker / ComposeNetworks & volume metadata

Assign a network-scoped alias

Docker / Compose: An alias gives an endpoint an additional name on that network.

Docker / Compose✓ Tested
Docker / ComposeNetworks & volume metadata

Attach an existing container to another network

Docker / Compose: network connect adds an attachment without recreating the container.

Docker / Compose✓ Tested
jQueryEvent control

Attach configuration when registering a handler

jQuery: event.data carries the registration-time data object.

jQuery✓ Tested
CNumeric parsing & arithmetic

Calculate a page count without an overflowing addition

C: Divide first and add one only when a nonzero remainder remains.

C✓ Tested
C++Numeric parsing & calculations

Calculate a two-dimensional vector length

C++: hypot avoids unnecessary intermediate overflow in the sum of squares.

C++✓ Tested
RustFunctions & data types

Capture a surrounding value in a closure

Capture a surrounding value in a closure in a complete Rust program using the standard library.

Rust✓ Tested
CStrings & byte buffers

Check a literal filename suffix

C: Check lengths before subtracting so a short input cannot produce an invalid pointer.

C✓ Tested