Results for “Relationships & missing data”
Small, practical examples. Search by task or narrow things down below.
Return a small immutable named record
Python: Use NamedTuple when callers need both tuple behavior and named fields.
Python✓ Tested
Search a sorted array efficiently
C#: Array.BinarySearch requires an array sorted with the same comparison rules.
C#✓ Tested
Store an object associated with an element
jQuery: data retains JavaScript values without serializing them into HTML attributes.
jQuery✓ Tested
Suggest a browser interface color
HTML: Theme-color is a browser chrome hint and does not style the page itself.
HTML✓ Tested
Supply a title and URL for link previews
HTML: Open Graph metadata describes a shared page without changing its visible content.
HTML✓ Tested
Tie a subscription’s lifetime to its component
Tie a subscription’s lifetime to its component with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Transform an observable value
Transform an observable value with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Use a last-in first-out stack
C#: Stack is useful for reversible traversal and other nested operations.
C#✓ Tested
Use an associated constructor
Use an associated constructor in a complete Rust program using the standard library.
Rust✓ Tested
Use case-insensitive dictionary keys
C#: Choose an ordinal comparer when case-insensitive keys represent identifiers.
C#✓ Tested
Verify a read-only volume rejects writes
Docker / Compose: A failed write confirms the mount’s read-only behavior.
Docker / Compose✓ Tested
Visit files recursively
Java: Close the stream returned by Files.walk and sort relative paths for stable output.
Java✓ Tested