FIND YOUR NEXT FEW LINES

Results for “Lists & control flow”

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

172 snippets foundClear filters
SQLiteText cleanup & matching

Place missing values after known values portably

SQLite: A CASE sort key controls NULL placement without relying on engine-specific defaults.

SQLite✓ Tested
CSSFlexbox alignment

Prevent an item from shrinking

CSS: Flex-shrink zero preserves a required size even when the container overflows.

CSS✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Reject a missing required configuration value

Bash Scripts: Check a required value explicitly and emit a controlled diagnostic before exiting.

Bash Scripts✓ Tested
Arduino / CTiming & control

Repeat an action a fixed number of times

Use a counter and delay for a simple finite sequence.

for loop✓ Tested
HTMLInput constraints

Require a checkbox to be selected

HTML: A required checkbox is invalid until that individual control is checked.

HTML✓ Tested
HTMLInput constraints

Require a nonempty text value

HTML: The required attribute makes an empty text control fail native constraint validation.

HTML✓ Tested
SQLSelect & filter

Select specific columns

Read only the fields a result needs.

SELECT✓ Tested
CSSGrid placement

Set explicit grid row heights

CSS: Grid-template-rows controls each declared row’s block-axis track size.

CSS✓ Tested
CArray transformations

Sort an integer array with qsort

C: The comparator uses relational comparisons to avoid subtraction overflow.

C✓ Tested
Linux CommandsDates & process utilities

Start a command with a minimal environment

Linux Commands: Use env -i with an explicit PATH for a controlled child environment.

Linux Commands✓ Tested
CSSInteraction selectors

Style a card based on a selected descendant

CSS: Has matches the parent when its relative selector finds a checked control inside it.

CSS✓ Tested
CSSInteraction selectors

Style content associated with a checked option

CSS: The adjacent-sibling selector connects a checked control with its following label text.

CSS✓ Tested