FIND YOUR NEXT FEW LINES

Results for “COUNT”

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

200 snippets foundClear filters
TypeScriptArray traversal & selection

Iterate with array indices and values

TypeScript: entries provides each position and value without a separate counter.

TypeScript✓ Tested
Bash ScriptsProcesses & environment

Keep loop state by avoiding a pipeline subshell

Bash Scripts: Redirect input into a while loop so updates to a counter remain in the current shell.

Bash Scripts✓ Tested
Docker / ComposeLimits & process security

Limit the number of container processes

Docker / Compose: The pids-limit setting caps the container’s process count.

Docker / Compose✓ Tested
CStrings

Measure a string length

Count bytes before the null terminator with C strlen.

C✓ Tested
C#JSON & binary formats

Measure the byte length of UTF-8 text

C#: Character count and encoded byte count can differ for non-ASCII text.

C#✓ Tested
PythonIteration & sequences

Number items while iterating

Python: Use enumerate to attach a one-based position without maintaining a separate counter.

Python✓ Tested
JavaScriptArray traversal & selection

Pair corresponding array items by position

JavaScript: Validate equal lengths before zipping when missing counterparts would be an error.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Pair corresponding array items by position

TypeScript: Validate equal lengths before zipping when missing counterparts would be an error.

TypeScript✓ Tested
CBinary formats & structured parsing

Parse a bounded simple record with sscanf

C: A width limit protects the destination buffer and the consumed count detects trailing junk.

C✓ Tested
C++Ordering & set operations

Preserve equal-key order while sorting records

C++: stable_sort retains encounter order for records whose selected sort keys compare equal.

C++✓ Tested
GitRemotes & collaboration

Push a new branch and set its upstream

Connect a feature branch with its remote counterpart.

push✓ Tested
Bash ScriptsParameter expansion

Read a string’s character length

Bash Scripts: Bash parameter length counts characters under the current locale.

Bash Scripts✓ Tested