FIND YOUR NEXT FEW LINES

Results for “defined”

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

15 snippets foundClear filters
Docker / ComposeStorage & isolation

Attach containers to a user-defined network

Create a dedicated network for a small group of containers.

network✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Check whether a function has been defined

Bash Scripts: declare -F tests a function name without executing it.

Bash Scripts✓ Tested
Docker / ComposeNetworks & volume metadata

Inspect a user-defined network’s driver

Docker / Compose: The default driver for a local user-defined network is bridge.

Docker / Compose✓ Tested
Docker / ComposeNetworks & volume metadata

Resolve a peer’s name on a user-defined network

Docker / Compose: The embedded DNS service resolves names on user-defined bridges.

Docker / Compose✓ Tested
TypeScriptTypes & functions

Return the first item with a generic function

Preserve the element type while allowing empty arrays.

generics✓ Tested
CStrings

Convert ASCII text to uppercase

Convert characters with toupper while avoiding signed-char undefined behavior.

C✓ Tested
TypeScriptCollections & records

Count words using a Map

Update a keyed counter without losing its value type.

Map✓ Tested
JavaScriptArray traversal & selection

Find the first matching array item

JavaScript: find returns undefined when no item satisfies the predicate.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Find the first matching array item

TypeScript: find returns undefined when no item satisfies the predicate.

TypeScript✓ Tested
TypeScriptTypes & functions

Give an optional property a default

Handle missing object fields with nullish coalescing.

optional✓ Tested
JavaStream transformations

Index records by a unique key

Java: Use toMap with an explicit merge rule so duplicate keys have defined behavior.

Java✓ Tested
C#Types & reliable control flow

Parse an enum name without throwing

C#: Combine TryParse and IsDefined when only named declared values should be accepted.

C#✓ Tested