FIND YOUR NEXT FEW LINES

Results for “Threads & shared ownership”

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

70 snippets foundClear filters
PythonFunctions & error handling

Avoid a shared mutable default argument

Python: Create a fresh list inside the function when the optional argument is omitted.

Python✓ Tested
RustGetting Started

Borrow text without transferring ownership

Borrow text without transferring ownership in a complete Rust program using the standard library.

Rust✓ Tested
AngularServices & dependency injection

Derive totals inside a shared service

Derive totals inside a shared service with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
GoFunctions & types

Embed a struct for shared fields

Embed a struct for shared fields using a complete Go program with explicit sample inputs.

Go✓ Tested
SQLBulk changes & set operations

Find rows shared by two query results

SQL: INTERSECT compares complete selected rows and removes duplicates.

SQL✓ Tested
SQL ServerBulk changes & set operations

Find rows shared by two query results

SQL Server: INTERSECT compares complete selected rows and removes duplicates.

SQL Server✓ Tested
PostgresBulk changes & set operations

Find rows shared by two query results

Postgres: INTERSECT compares complete selected rows and removes duplicates.

Postgres✓ Tested
SQLiteBulk changes & set operations

Find rows shared by two query results

SQLite: INTERSECT compares complete selected rows and removes duplicates.

SQLite✓ Tested
JavaScriptObject behavior & collections

Find shared members of two sets

JavaScript: Filter one set through the other set’s membership test.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Find shared members of two sets

TypeScript: Filter one set through the other set’s membership test.

TypeScript✓ Tested
JavaQueues & collection operations

Find shared set members

Java: Copy a set before retainAll when the original must remain unchanged.

Java✓ Tested
PythonMappings & sets

Find values shared by two collections

Python: Use set intersection and sort the result for deterministic display.

Python✓ Tested