FIND YOUR NEXT FEW LINES

Results for “File operations & binary data”

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

1473 snippets foundClear filters
CSmall algorithms & bit operations

Calculate an average without integer division truncation

C: Accumulate into double and divide by the nonzero number of readings.

C✓ Tested
CSmall algorithms & bit operations

Calculate the greatest common divisor

C: Euclid’s algorithm repeatedly replaces a pair with the divisor and remainder.

C✓ Tested
RustFiles & paths

Change a path’s extension

Change a path’s extension in a complete Rust program using the standard library.

Rust✓ Tested
Bash ScriptsArray operations

Check exact array membership

Bash Scripts: Compare each element literally instead of searching a concatenated string.

Bash Scripts✓ Tested
C++Ordering & set operations

Check whether a range is already sorted

C++: is_sorted reports ordering without modifying the input.

C++✓ Tested
Docker / ComposeDockerfile patterns

Choose Bash with pipefail for build commands

Docker / Compose: SHELL changes the interpreter for subsequent shell-form instructions.

Docker / Compose✓ Tested
Arduino / CBinary values & packets

Clear a flag without affecting neighboring bits

Arduino / C: bitClear resets only the selected bit.

Arduino / C✓ Tested
Docker / ComposeDockerfile patterns

Combine a stable entrypoint with default arguments

Docker / Compose: CMD supplies default arguments to an exec-form ENTRYPOINT.

Docker / Compose✓ Tested
C#Collections & data structures

Combine collections as a distinct set

C#: Union retains each value once across both inputs.

C#✓ Tested
AngularLifecycle & observable data

Combine the latest values from observables

Combine the latest values from observables with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
CSmall algorithms & bit operations

Compute a simple XOR checksum

C: XOR all payload bytes into one byte to demonstrate a basic error-detection field.

C✓ Tested
JavaScriptUTC date operations

Construct a date from Unix seconds

JavaScript: Multiply seconds by 1000 before creating a Date.

JavaScript✓ Tested