Results for “when”
Small, practical examples. Search by task or narrow things down below.
Include missing values in a not-equal filter
Postgres: Ordinary inequality does not include NULL; explicitly include it when that is the intended rule.
Postgres✓ Tested
Include missing values in a not-equal filter
SQLite: Ordinary inequality does not include NULL; explicitly include it when that is the intended rule.
SQLite✓ Tested
Increment a shared counter safely
C++: Atomic increments prevent lost updates when two threads change the same counter.
C++✓ Tested
Insert a row with named columns
Add a record without relying on implicit column order.
INSERT✓ Tested
Invert a dictionary with unique values
Python: Swap keys and values when the values are hashable and unique.
Python✓ Tested
Join through a lookup table
SQL: Use explicit aliases and join keys when enriching records through two relationships.
SQL✓ Tested
Join through a lookup table
SQL Server: Use explicit aliases and join keys when enriching records through two relationships.
SQL Server✓ Tested
Join through a lookup table
Postgres: Use explicit aliases and join keys when enriching records through two relationships.
Postgres✓ Tested
Join through a lookup table
SQLite: Use explicit aliases and join keys when enriching records through two relationships.
SQLite✓ Tested
Keep a control fixed to the viewport during scrolling
CSS: Fixed positioning normally uses the viewport when no ancestor establishes a different fixed containing block.
CSS✓ Tested
Keep a counter from wrapping at its maximum
Arduino / C: Increment only when the value is below its limit.
Arduino / C✓ Tested
Keep both matching and rejected values
JavaScript: Use two explicit outputs when a caller needs both sides of a classification.
JavaScript✓ Tested