Results for “if”
Small, practical examples. Search by task or narrow things down below.
Divide an ordered result into numbered buckets
SQLite: NTILE distributes rows across buckets; include a unique tie-breaker for deterministic assignment.
SQLite✓ Tested
Divide grid space in a chosen proportion
CSS: Fraction units divide the remaining track space proportionally.
CSS✓ Tested
Draw a basic rectangle on a labeled canvas
HTML: Canvas requires script to draw pixels; provide alternative content and an accessible label.
HTML✓ Tested
Draw a visible element border
CSS: Learn how to draw a visible element border in a complete browser example.
CSS✓ Tested
Drop the fractional part toward zero
JavaScript: Math.trunc differs from floor for negative inputs.
JavaScript✓ Tested
Drop the fractional part toward zero
TypeScript: Math.trunc differs from floor for negative inputs.
TypeScript✓ Tested
Enable and use foreign keys
Turn on relationship enforcement for the connection.
foreign keys✓ Tested
Encode a value as little-endian bytes
Arduino / C: Store the least significant byte first when the protocol requires it.
Arduino / C✓ Tested
Enforce a bounded numeric range
SQL: A named CHECK constraint keeps numeric values inside an inclusive interval.
SQL✓ Tested
Enforce a bounded numeric range
SQL Server: A named CHECK constraint keeps numeric values inside an inclusive interval.
SQL Server✓ Tested
Enforce a bounded numeric range
Postgres: A named CHECK constraint keeps numeric values inside an inclusive interval.
Postgres✓ Tested
Enforce a bounded numeric range
SQLite: A named CHECK constraint keeps numeric values inside an inclusive interval.
SQLite✓ Tested