FIND YOUR NEXT FEW LINES

Results for “save file”

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

1970 snippets foundClear filters
JavaStream transformations

Flatten nested collections

Java: Use flatMap to concatenate nested Java lists into one stream.

Java✓ Tested
PythonIteration & sequences

Flatten one level of nested lists

Python: Use a nested comprehension when each input item is itself an iterable.

Python✓ Tested
Docker / ComposeContainer lifecycle

Force a disposable container to stop

Docker / Compose: kill sends SIGKILL by default without a graceful shutdown interval.

Docker / Compose✓ Tested
JavaNumbers & dates

Format a decimal number

Format a Java decimal with two digits and a fixed locale.

Java✓ Tested
CNumbers & memory

Format a decimal value

Print two fractional digits with C printf.

C✓ Tested
CBinary formats & structured parsing

Format a known timestamp in UTC

C: gmtime converts to UTC calendar fields and strftime formats them.

C✓ Tested
CBinary formats & structured parsing

Format a nonnegative integer amount as whole and fractional units

C: Keep the calculation in integer minor units and use two digits for the remainder.

C✓ Tested
Bash ScriptsText parsing & arithmetic

Format a numeric label with leading zeroes

Bash Scripts: Use a constant printf format string and supply values as separate arguments.

Bash Scripts✓ Tested
SQLiteDates & time

Format a timestamp

Extract a year and month from ISO timestamp text.

strftime✓ Tested
C++Numeric parsing & calculations

Format an integer into a caller-owned buffer

C++: to_chars avoids allocation and reports whether the buffer was large enough.

C++✓ Tested
C++Numbers & algorithms

Format decimal output

Use fixed and setprecision to print two C++ decimal places.

C++✓ Tested
JavaScriptUTC date operations

Format whole seconds as hours minutes and seconds

JavaScript: Use integer divisions and remainders for a nonnegative duration.

JavaScript✓ Tested