Results for “Functions & data types”
Small, practical examples. Search by task or narrow things down below.
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 Boolean literal
Parse a Boolean literal in a complete Rust program using the standard library.
Rust✓ Tested
Parse a delimited integer record
Parse a delimited integer record in a complete Rust program using the standard library.
Rust✓ Tested
Parse a hexadecimal integer
Parse a hexadecimal integer in a complete Rust program using the standard library.
Rust✓ Tested
Parse a signed decimal integer
Parse a signed decimal integer in a complete Rust program using the standard library.
Rust✓ Tested
Parse a typed command-line option
Python: Use argparse to validate and convert an integer option.
Python✓ Tested
Parse an enum name without throwing
C#: Combine TryParse and IsDefined when only named declared values should be accepted.
C#✓ Tested
Parse quoted CSV from an in-memory string
Python: Use StringIO with csv.reader so quoted commas are handled correctly.
Python✓ Tested
Pass a block of behavior as an argument
PowerShell: Invoke a scriptblock with the call operator and an explicit input value.
PowerShell✓ Tested
Pass behavior as a function delegate
C#: Func describes a callable with typed parameters and a return value.
C#✓ Tested