FIND YOUR NEXT FEW LINES

Results for “read lines”

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

504 snippets foundClear filters
C++Numeric parsing & calculations

Check an upper integer bound before adding

C++: For these nonnegative values, compare against the maximum minus the addend first.

C++✓ Tested
Linux CommandsSystem information

Check available disk space

Show total, used, and available filesystem space for the current directory in human-readable units.

disk✓ Tested
Linux CommandsSystem information

Check memory usage

Show memory and swap totals in human-readable units. The available column estimates memory usable by new applications.

memory✓ Tested
Bash ScriptsFiles & reliability

Check that a file is present and nonempty

Test file content availability before reading it.

file check✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Check whether a variable exists under nounset

Bash Scripts: The plus expansion distinguishes an unset variable without reading its missing value.

Bash Scripts✓ Tested
C++Getting Started

Choose between two branches

C++: Use if and else to handle an available or empty stock count.

C++✓ Tested
SQLJoins & subqueries

Combine matching rows with INNER JOIN

Read product names with their matching stock values.

INNER JOIN✓ Tested
C++Getting Started

Combine text with a name

C++: Construct a greeting from a fixed prefix and a stored name.

C++✓ Tested
PostgresWindows & text

Compare a row with the previous row

Read a preceding value with LAG.

LAG✓ Tested
PythonGetting Started

Compare a value with a limit

Python: Turn a comparison into a readable yes or no result.

Python✓ Tested
C#Getting Started

Compare a value with a limit

C#: Turn a comparison into a readable yes or no result.

C#✓ Tested
JavaGetting Started

Compare a value with a limit

Java: Turn a comparison into a readable yes or no result.

Java✓ Tested