FIND YOUR NEXT FEW LINES

Results for “save”

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

1671 snippets foundClear filters
JavaRecords & reliable control flow

Update a shared counter atomically

Java: AtomicInteger provides an indivisible increment operation for a shared counter.

Java✓ Tested
GoGetting Started

Update a value through a pointer

Update a value through a pointer using a complete Go program with explicit sample inputs.

Go✓ Tested
RustThreads & shared ownership

Update an atomic counter

Update an atomic counter in a complete Rust program using the standard library.

Rust✓ Tested
RustMaps & sets

Update an existing map value

Update an existing map value in a complete Rust program using the standard library.

Rust✓ Tested
RustGetting Started

Update an explicitly mutable variable

Update an explicitly mutable variable in a complete Rust program using the standard library.

Rust✓ Tested
TypeScriptSafe data handling

Update an object with a readonly input

Create a changed copy while retaining the original.

readonly✓ Tested
Docker / ComposeDockerfile patterns

Use a build argument while creating an image

Docker / Compose: ARG supplies a build-time value that is not automatically a runtime environment variable.

Docker / Compose✓ Tested
GoGetting Started

Use a condition-only for loop

Use a condition-only for loop using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsGetting Started

Use a counted Bash loop

Bash Scripts: Use a counted Bash loop with a small standalone Bash program.

Bash Scripts✓ Tested
PowerShellGetting Started

Use a counted loop

PowerShell: Use a counted loop using PowerShell 7.

PowerShell✓ Tested
Bash ScriptsVariables & text

Use a default value for an unset variable

Supply a fallback without changing the original variable.

parameter expansion✓ Tested
JavaQueues & collection operations

Use a deque as a FIFO queue

Java: Add at the tail and remove at the head using ArrayDeque.

Java✓ Tested