Results for “first”
Small, practical examples. Search by task or narrow things down below.
Find the insertion position for a sorted value
C++: lower_bound returns the first position whose value is not less than the search key.
C++✓ Tested
Find the smallest value in a nonempty array
C: Initialize from the first element instead of assuming a numeric sentinel.
C✓ Tested
Hello World: Blink
Arduino / C: Blink the built-in LED slowly and then quickly, repeating both rates in loop().
Arduino / C✓ Tested
Identify headers for individual table rows
HTML: Scope row associates the first header cell with the data cells in that row.
HTML✓ Tested
Join a parent to pre-aggregated totals
SQL: Aggregate the child rows first to produce at most one joined row per parent.
SQL✓ Tested
Join a parent to pre-aggregated totals
SQL Server: Aggregate the child rows first to produce at most one joined row per parent.
SQL Server✓ Tested
Join a parent to pre-aggregated totals
Postgres: Aggregate the child rows first to produce at most one joined row per parent.
Postgres✓ Tested
Join a parent to pre-aggregated totals
SQLite: Aggregate the child rows first to produce at most one joined row per parent.
SQLite✓ Tested
Parse a complete integer without exceptions
C++: from_chars reports both an error code and the first unconsumed character.
C++✓ Tested
Preserve map insertion order
Java: Use LinkedHashMap when iteration should follow the order keys were first added.
Java✓ Tested
Process items by numeric priority
C#: PriorityQueue removes the item with the smallest priority value first.
C#✓ Tested
Read a file from the parent commit
Git: HEAD~1 names the first parent one generation before HEAD.
Git✓ Tested