Results for “Input streams & redirection”
Small, practical examples. Search by task or narrow things down below.
Return to the previously checked-out branch
Git: The dash shorthand selects the previous branch in the checkout history.
Git✓ Tested
Return two values from a function
Return two values from a function using a complete Go program with explicit sample inputs.
Go✓ Tested
Return zero for a sum over no rows
SQL: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.
SQL✓ Tested
Return zero for a sum over no rows
SQL Server: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.
SQL Server✓ 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
Return zero for a sum over no rows
SQLite: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.
SQLite✓ Tested
Reverse slice order
Reverse slice order using a complete Go program with explicit sample inputs.
Go✓ Tested
Round a decimal with a chosen midpoint rule
PowerShell: Use decimal input and an explicit rounding policy for a reproducible decimal result.
PowerShell✓ Tested
Round down to a whole minute
Round down to a whole minute using a complete Go program with explicit sample inputs.
Go✓ Tested
Run a command in a running container
Execute an additional process inside an existing container.
exec✓ Tested
Run a Compose service as a non-root user
Docker / Compose: user overrides the image’s default identity.
Docker / Compose✓ Tested
Run a Compose service as a numeric user
Docker / Compose: Run a Compose service as a numeric user in a small Compose file.
Docker / Compose✓ Tested