FIND YOUR NEXT FEW LINES

Results for “Record”

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

111 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
PowerShellHashtables & object records

Use a fallback for a missing hashtable entry

PowerShell: Test the key explicitly so legitimate false or zero values are preserved.

PowerShell✓ Tested
JavaRecords & reliable control flow

Validate a required argument

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

Java✓ Tested
PythonFiles & paths

Append a line to a file

Add a new line to the end of a text file without replacing its existing contents. Append mode also creates the file if it does not exist.

file✓ Tested
Docker / ComposeLimits & process security

Choose the signal used for graceful stopping

Docker / Compose: The configured stop signal is recorded in container metadata.

Docker / Compose✓ Tested
jQueryForm serialization & state

Collect repeated form field names

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

jQuery✓ Tested
GitMerging & replaying changes

Combine a branch’s changes into one new commit

Git: Squash prepares the combined changes in the index without recording a merge parent.

Git✓ Tested
PythonCollections

Count occurrences in a list

Count how often each value appears using Counter from the standard library.

count✓ Tested
TypeScriptCollections & records

Count words using a Map

Update a keyed counter without losing its value type.

Map✓ Tested
PythonFiles & paths

Create nested folders

Create a folder and any missing parent folders in one call. Running the code again is safe when the folder already exists.

directory✓ Tested
GitTags & repository configuration

Declare LF normalization for a file type

Git: A gitattributes rule records text normalization expectations for matching paths.

Git✓ Tested
SQLChange & combine data

Delete one matching row

Remove a selected record and inspect what remains.

DELETE✓ Tested