Results for “Queues & collection operations”
Small, practical examples. Search by task or narrow things down below.
Split an array into fixed-size batches
PowerShell: Bound the final index so the last batch can contain fewer elements.
PowerShell✓ Tested
Start a named queue explicitly
jQuery: Named queues wait until dequeue starts them.
jQuery✓ Tested
Sum the decimal digits of an unsigned integer
C: Repeated division and remainder extract digits without converting to text.
C✓ Tested
Test whether an array contains a value
PowerShell: The contains operator compares complete items rather than matching substrings.
PowerShell✓ Tested
Test whether an unsigned value is a power of two
C: A nonzero power of two has exactly one set bit.
C✓ Tested
Transform a deferred value with then
jQuery: then returns a new promise with the callback’s result.
jQuery✓ Tested
Update rows selected by a related table
SQL: Use EXISTS to limit updates based on an independent eligibility table.
SQL✓ Tested
Update rows selected by a related table
SQL Server: Use EXISTS to limit updates based on an independent eligibility table.
SQL Server✓ Tested
Update rows selected by a related table
Postgres: Use EXISTS to limit updates based on an independent eligibility table.
Postgres✓ Tested
Update rows selected by a related table
SQLite: Use EXISTS to limit updates based on an independent eligibility table.
SQLite✓ Tested
Update several classifications in one statement
SQL: A CASE expression computes the new value for each row covered by the update predicate.
SQL✓ Tested
Update several classifications in one statement
SQL Server: A CASE expression computes the new value for each row covered by the update predicate.
SQL Server✓ Tested