FIND YOUR NEXT FEW LINES

Results for “empty”

Small, practical examples. Search by task or narrow things down below.

487 snippets foundClear filters
Bash ScriptsGetting Started

Compare two text values

Bash Scripts: Compare two text values with a small standalone Bash program.

Bash Scripts✓ Tested
SQL ServerReporting & grouped calculations

Compute an integer weighted average

SQL Server: Multiply before summing and guard a zero total weight with NULLIF.

SQL Server✓ Tested
PostgresReporting & grouped calculations

Compute an integer weighted average

Postgres: Multiply before summing and guard a zero total weight with NULLIF.

Postgres✓ Tested
Bash ScriptsArguments & decisions

Consume positional arguments one at a time

Bash Scripts: Check the argument count before accessing the first parameter with nounset enabled.

Bash Scripts✓ Tested
Bash ScriptsVariables & text

Convert a string to lowercase

Normalize a text value using Bash expansion.

lowercase✓ Tested
Bash ScriptsParameter expansion

Convert a variable to uppercase

Bash Scripts: Double caret transforms matching lowercase characters in Bash 4 or later.

Bash Scripts✓ Tested
SQL ServerSelect & page

Convert text without raising a conversion error

Return NULL when a numeric conversion fails.

TRY_CONVERT✓ Tested
Docker / ComposeBuild images

Copy a file into an image

Include a small application file during the build.

Dockerfile✓ Tested
Bash ScriptsArray operations

Copy an array independently

Bash Scripts: A new array assignment copies element values rather than creating a shared reference.

Bash Scripts✓ Tested
SQL ServerBulk changes & set operations

Copy selected rows into another table

SQL Server: INSERT SELECT performs a set-based copy with an explicit destination column list.

SQL Server✓ Tested
PostgresBulk changes & set operations

Copy selected rows into another table

Postgres: INSERT SELECT performs a set-based copy with an explicit destination column list.

Postgres✓ Tested
Bash ScriptsGetting Started

Count array elements

Bash Scripts: Count array elements with a small standalone Bash program.

Bash Scripts✓ Tested