Results for “if”
Small, practical examples. Search by task or narrow things down below.
Notify a parent with a callback prop
Notify a parent with a callback prop with a small React component and explicit browser behavior.
React✓ Tested
Observe shared ownership without extending its lifetime
C++: A weak_ptr can be locked while an owner exists and becomes expired after the last owner is released.
C++✓ Tested
Print integers in different bases
Inspect a byte in decimal, hexadecimal, and binary.
Serial✓ Tested
Process a FIFO queue
C#: Queue removes elements in the order they were enqueued.
C#✓ Tested
Raise and catch a domain-specific exception
Python: Give a validation failure its own exception type so callers can handle it narrowly.
Python✓ Tested
Read a repository-specific configuration value
Git: The local scope makes configuration lookup predictable for this practice repository.
Git✓ Tested
Reference a parent identified by two columns
SQL: A composite foreign key checks the complete referenced key rather than either column independently.
SQL✓ Tested
Reference a parent identified by two columns
SQL Server: A composite foreign key checks the complete referenced key rather than either column independently.
SQL Server✓ Tested
Reference a parent identified by two columns
Postgres: A composite foreign key checks the complete referenced key rather than either column independently.
Postgres✓ Tested
Reference a parent identified by two columns
SQLite: A composite foreign key checks the complete referenced key rather than either column independently.
SQLite✓ Tested
Reject duplicate business identifiers
SQL: A UNIQUE constraint protects a business key independently of the primary key.
SQL✓ Tested
Reject duplicate business identifiers
SQL Server: A UNIQUE constraint protects a business key independently of the primary key.
SQL Server✓ Tested