FIND YOUR NEXT FEW LINES

Results for “Bulk changes & set operations”

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

686 snippets foundClear filters
C#File operations & paths

Inspect a file length without reading it

C#: Use FileInfo.Length to retrieve a logical size in bytes.

C#✓ Tested
JavaScriptPromises & iteration protocols

Inspect both successful and failed promise results

JavaScript: allSettled preserves input order and reports failures without rejecting the combined promise.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Inspect both successful and failed promise results

TypeScript: allSettled preserves input order and reports failures without rejecting the combined promise.

TypeScript✓ Tested
PythonMappings & sets

Invert a dictionary with unique values

Python: Swap keys and values when the values are hashable and unique.

Python✓ Tested
RustMaps & sets

Iterate over keys in sorted order

Iterate over keys in sorted order in a complete Rust program using the standard library.

Rust✓ Tested
Bash ScriptsArray operations

Join array items with a one-character separator

Bash Scripts: A local IFS controls the separator used by the quoted star expansion.

Bash Scripts✓ Tested
SQLConstraints & defaults

Keep children while clearing a deleted relationship

SQL: ON DELETE SET NULL requires a nullable foreign-key column.

SQL✓ Tested
SQL ServerConstraints & defaults

Keep children while clearing a deleted relationship

SQL Server: ON DELETE SET NULL requires a nullable foreign-key column.

SQL Server✓ Tested
PostgresConstraints & defaults

Keep children while clearing a deleted relationship

Postgres: ON DELETE SET NULL requires a nullable foreign-key column.

Postgres✓ Tested
SQLiteConstraints & defaults

Keep children while clearing a deleted relationship

SQLite: ON DELETE SET NULL requires a nullable foreign-key column.

SQLite✓ Tested
PythonMappings & sets

Keep only the most recent items

Python: Use a bounded deque to discard the oldest item as new values arrive.

Python✓ Tested
C++Filesystem operations

List regular files recursively in sorted order

C++: Collect relative paths before sorting because directory iteration order is unspecified.

C++✓ Tested