Results for “Records & reliable control flow”
Small, practical examples. Search by task or narrow things down below.
Compute a two-dimensional vector length
C: hypot avoids unnecessary intermediate overflow compared with squaring both inputs directly.
C✓ Tested
Constrain a calendar date input
HTML: Use ISO date values for the date control’s minimum and maximum.
HTML✓ Tested
Continue an ordered list at a chosen number
HTML: The start attribute controls the initial ordinal without changing item text.
HTML✓ Tested
Count words using a Map
Update a keyed counter without losing its value type.
Map✓ Tested
Create an archive from an explicit file list
Linux Commands: Use tar -T for a controlled list of relative archive members.
Linux Commands✓ Tested
Debounce a button with a stable-time check
Accept an input change only after it stays stable for 30 ms.
debounce✓ Tested
Declare LF normalization for a file type
Git: A gitattributes rule records text normalization expectations for matching paths.
Git✓ Tested
Define a function with a typed parameter
Accept a name and return a greeting.
function✓ Tested
Delete rows selected by a related table
SQL: A correlated EXISTS limits the delete to explicitly listed records.
SQL✓ Tested
Delete rows selected by a related table
SQL Server: A correlated EXISTS limits the delete to explicitly listed records.
SQL Server✓ Tested
Delete rows selected by a related table
Postgres: A correlated EXISTS limits the delete to explicitly listed records.
Postgres✓ Tested
Delete rows selected by a related table
SQLite: A correlated EXISTS limits the delete to explicitly listed records.
SQLite✓ Tested