Results for “UTF-8”
Small, practical examples. Search by task or narrow things down below.
Require two conditions to be true
C#: Combine a lower and an upper bound to check whether a value is in range.
C#✓ Tested
Require two filtering conditions
Postgres: Combine category and quantity conditions with AND.
Postgres✓ Tested
Resolve a relative URI against a base
C#: Use a base URI ending in a slash when the final path component represents a directory.
C#✓ Tested
Return all rows tied for the maximum in a group
Postgres: An equality comparison with a grouped maximum retains ties rather than choosing one arbitrary row.
Postgres✓ Tested
Return an inserted row
Read generated data directly from INSERT.
RETURNING✓ Tested
Return multiple named values from a method
C#: Named value tuples give lightweight field names without a separate class.
C#✓ Tested
Return zero for a sum over no rows
Postgres: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.
Postgres✓ Tested
Reuse an LED action with a function
Arduino / C: Put a short LED sequence in a named function and call it twice.
Arduino / C✓ Tested
Round a decimal using an explicit midpoint rule
C#: Use decimal literals for decimal arithmetic and choose the midpoint rounding behavior.
C#✓ Tested
Round a timestamp down to its month
Group dates by a calendar boundary.
date_trunc✓ Tested
Run a first SELECT query
Postgres: Return a literal value without creating a table.
Postgres✓ Tested
Run a first sketch and read serial output
Arduino / C: Run a first sketch and read serial output on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested