Results for “running total”
Small, practical examples. Search by task or narrow things down below.
Compute an integer weighted average
Postgres: Multiply before summing and guard a zero total weight with NULLIF.
Postgres✓ Tested
Compute an integer weighted average
SQLite: Multiply before summing and guard a zero total weight with NULLIF.
SQLite✓ Tested
Create nested folders
Create a folder and any missing parent folders in one call. Running the code again is safe when the folder already exists.
directory✓ Tested
Filter groups after aggregation
SQL: Use HAVING to test a group’s calculated total.
SQL✓ Tested
Filter groups after aggregation
SQL Server: Use HAVING to test a group’s calculated total.
SQL Server✓ Tested
Filter groups after aggregation
Postgres: Use HAVING to test a group’s calculated total.
Postgres✓ Tested
Filter groups after aggregation
SQLite: Use HAVING to test a group’s calculated total.
SQLite✓ Tested
Measure a duration between instants
Java: Use Duration for elapsed timeline time and retrieve total seconds.
Java✓ Tested
Mount a host directory read-only
Expose existing files without allowing the container to change them.
bind mount✓ Tested
Preserve a failure status while an EXIT trap runs
Bash Scripts: Capture the status immediately on entry to the trap before running cleanup commands.
Bash Scripts✓ Tested
Set a working directory
Choose the default directory for later instructions and the running process.
Dockerfile✓ Tested
Show the current directory
Print the absolute path of your current working directory before running commands that depend on relative paths.
directory✓ Tested