Results for “C++”
Small, practical examples. Search by task or narrow things down below.
Distinguish an own property from an inherited one
TypeScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.
TypeScript✓ Tested
Distinguish unset variables from empty strings
Bash Scripts: Omitting the colon tests only whether a variable is unset; including it also treats an empty value as missing.
Bash Scripts✓ Tested
Divide negative integers with floor rounding
Java: floorDiv and floorMod provide consistent floor-based quotient and remainder.
Java✓ Tested
Draw a visible element border
CSS: Learn how to draw a visible element border in a complete browser example.
CSS✓ Tested
Drive the built-in LED low after turning it on
Arduino / C: digitalWrite changes the actual output level of a configured pin.
Arduino / C✓ Tested
Enable and use foreign keys
Turn on relationship enforcement for the connection.
foreign keys✓ Tested
Enumerate hashtable entries in a stable order
PowerShell: Sort entries by key when predictable output matters.
PowerShell✓ Tested
Enumerate the items of a JSON array
C#: Dispose JsonDocument after reading its elements.
C#✓ Tested
Expand a JSON array into rows
Iterate array elements using a table-valued function.
json_each✓ Tested
Expand an abbreviation with explanatory text
HTML: The title attribute supplies the full form while nearby text remains useful without hovering.
HTML✓ Tested
Expose a reusable filtered view
SQL: A view stores a query definition rather than a snapshot of its rows.
SQL✓ Tested
Expose a reusable filtered view
SQL Server: A view stores a query definition rather than a snapshot of its rows.
SQL Server✓ Tested