FIND YOUR NEXT FEW LINES

Results for “Hashtables & object records”

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

151 snippets foundClear filters
JavaRecords & reliable control flow

Transform an asynchronous result

Java: Chain thenApply and join a CompletableFuture to retrieve the completed value.

Java✓ Tested
JavaRecords & reliable control flow

Transform an optional value

Java: Use Optional.map and orElse to transform a possibly absent result.

Java✓ Tested
JavaRecords & reliable control flow

Update a shared counter atomically

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

Java✓ Tested
JavaRecords & reliable control flow

Validate a required argument

Java: Use requireNonNull with a useful message at an API boundary.

Java✓ Tested
TypeScriptCollections & records

Filter and transform an array

Keep active objects and extract their names.

filter✓ Tested
jQueryEvent control

Attach configuration when registering a handler

jQuery: event.data carries the registration-time data object.

jQuery✓ Tested
PostgresJSON & arrays

Check JSONB containment

Test whether an object contains a key-value pair.

jsonb✓ Tested
GitRemotes & additional checkouts

Check out another branch in a second working tree

Git: A linked worktree shares repository objects while maintaining a separate checked-out branch.

Git✓ Tested
jQueryForm serialization & state

Collect repeated form field names

jQuery: serializeArray preserves multiple values as name-value records.

jQuery✓ Tested
PythonMappings & sets

Copy nested mutable data independently

Python: Use deepcopy when changes to nested lists must not affect the original object.

Python✓ Tested
PythonDates & time zones

Count days between calendar dates

Python: Subtract date objects to get an exact calendar-day difference.

Python✓ Tested
TypeScriptCollections & records

Count words using a Map

Update a keyed counter without losing its value type.

Map✓ Tested