Results for “os”
Small, practical examples. Search by task or narrow things down below.
Block deletion of a referenced parent
Postgres: The default foreign-key action prevents deletion while a child still refers to the parent.
Postgres✓ Tested
Build a query from several named stages
Postgres: Separate row selection from aggregation using two common table expressions.
Postgres✓ Tested
Build an image with a default command
Docker / Compose: Build an image with a default command with a complete introductory Dockerfile.
Docker / Compose✓ Tested
Calculate a cumulative integer percentage
Postgres: Divide a running window sum by the complete total using a unique ordering key.
Postgres✓ Tested
Calculate a total for each group
Postgres: Group nonmissing categories and calculate separate totals.
Postgres✓ Tested
Calculate a value with SELECT
Postgres: Evaluate a small arithmetic expression on the database server.
Postgres✓ Tested
Calculate each group’s integer percentage of the total
Postgres: Multiply before division and protect against a zero denominator.
Postgres✓ Tested
Calculate each group’s numeric spread
Postgres: Subtract MIN from MAX to report the difference between extremes.
Postgres✓ Tested
Capture output while handling a failed command
Bash Scripts: An assignment inherits the status of its command substitution, allowing both output and status to be handled.
Bash Scripts✓ Tested
Center a fixed-size absolute child with auto margins
CSS: An all-zero inset plus auto margins distributes the available space around the child.
CSS✓ Tested
Check a script’s syntax without executing its body
Bash Scripts: bash -n parses commands but does not run ordinary script statements.
Bash Scripts✓ Tested
Check for an installed command
Bash Scripts: command -v checks command resolution without assuming a specific installation path.
Bash Scripts✓ Tested