FIND YOUR NEXT FEW LINES

Results for “try”

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

176 snippets foundClear filters
C#Collections & data structures

Add a dictionary entry only if absent

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

C#✓ Tested
GitStashing selected work

Apply a stash while keeping the saved entry

Git: Apply restores changes without removing the stash reference.

Git✓ 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
RustMaps & sets

Count values with the entry API

Count values with the entry API in a complete Rust program using the standard library.

Rust✓ Tested
jQueryForm serialization & state

Delete a cached data entry

jQuery: removeData removes the jQuery cache value for the selected key.

jQuery✓ Tested
GoMaps & sets

Delete a map entry

Delete a map entry using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaQueues & collection operations

Initialize a map entry only when absent

Java: Use computeIfAbsent when creating a collection for a new key.

Java✓ Tested
GoGetting Started

Look up a map entry

Look up a map entry using a complete Go program with explicit sample inputs.

Go✓ Tested
ReactAsync work & status

Offer a retry after a failed attempt

Offer a retry after a failed attempt with a small React component and explicit browser behavior.

React✓ Tested
Docker / ComposeExecution & file transfer

Override an image’s entrypoint at runtime

Docker / Compose: An explicit entrypoint replaces the image entrypoint for this invocation.

Docker / Compose✓ Tested
Docker / ComposeCompose service options

Override the image entrypoint in Compose

Docker / Compose: entrypoint and command combine as executable and arguments.

Docker / Compose✓ Tested
Bash ScriptsArray operations

Read an optional associative-array entry

Bash Scripts: Use a fallback expansion when a map key may not be present under nounset.

Bash Scripts✓ Tested