FIND YOUR NEXT FEW LINES

Results for “count”

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

200 snippets foundClear filters
PowerShellGetting Started

Use a counted loop

PowerShell: Use a counted loop using PowerShell 7.

PowerShell✓ Tested
Arduino / CGetting Started

Use a wider type for a large count

Arduino / C: Use a wider type for a large count on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
ReactState & reducers

Centralize state changes in a reducer

Centralize state changes in a reducer with a small React component and explicit browser behavior.

React✓ Tested
RustStrings & Unicode

Distinguish UTF-8 bytes from characters

Distinguish UTF-8 bytes from characters in a complete Rust program using the standard library.

Rust✓ Tested
ReactCustom hooks

Encapsulate increment and reset operations

Encapsulate increment and reset operations with a small React component and explicit browser behavior.

React✓ Tested
SQLExpressions & aggregates

Filter aggregate groups

Keep only categories with multiple products.

HAVING✓ Tested
Bash ScriptsFiles & reliability

Handle a filename pattern with no matches

Use nullglob so an unmatched pattern produces an empty array.

nullglob✓ Tested
ReactRefs & DOM interaction

Keep a mutable value without rendering on each write

Keep a mutable value without rendering on each write with a small React component and explicit browser behavior.

React✓ Tested
ReactGetting Started

Keep component state with useState

Keep component state with useState with a small React component and explicit browser behavior.

React✓ 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
Bash ScriptsArguments & decisions

Validate the number of positional arguments

Bash Scripts: Use the argument count to enforce a simple command-line contract.

Bash Scripts✓ Tested
CSSInteraction selectors

Alternate row backgrounds with a structural selector

CSS: Nth-child counts sibling positions starting at one.

CSS✓ Tested