Results for “id”
Small, practical examples. Search by task or narrow things down below.
Pack two small values into one byte
Arduino / C: Mask each four-bit value before combining it.
Arduino / C✓ Tested
Pad a label with leading zeroes
PowerShell: Use a numeric format specifier to control the displayed width.
PowerShell✓ Tested
Pad a numeric label
Convert a number to text and pad it to a fixed width.
JavaScript✓ Tested
Pair corresponding array items by position
JavaScript: Validate equal lengths before zipping when missing counterparts would be an error.
JavaScript✓ Tested
Pair corresponding array items by position
TypeScript: Validate equal lengths before zipping when missing counterparts would be an error.
TypeScript✓ Tested
Pair corresponding collection elements
C#: Zip stops at the shorter sequence, so validate lengths separately if mismatches are an error.
C#✓ Tested
Pair employees with their managers
SQL: Alias a table twice to represent two different roles in one relationship.
SQL✓ Tested
Pair employees with their managers
SQL Server: Alias a table twice to represent two different roles in one relationship.
SQL Server✓ Tested
Pair employees with their managers
Postgres: Alias a table twice to represent two different roles in one relationship.
Postgres✓ Tested
Pair employees with their managers
SQLite: Alias a table twice to represent two different roles in one relationship.
SQLite✓ Tested
Parse a bounded simple record with sscanf
C: A width limit protects the destination buffer and the consumed count detects trailing junk.
C✓ Tested
Parse a date without a time component
C#: DateOnly avoids attaching an irrelevant time or timezone to a calendar date.
C#✓ Tested