Results for “repeat”
Small, practical examples. Search by task or narrow things down below.
Cache repeated pure function calls
Python: Use lru_cache to avoid recomputing results for identical hashable arguments.
Python✓ Tested
Collapse repeated spaces
Linux Commands: Use tr -s when repeated occurrences of a character should become one.
Linux Commands✓ Tested
Collect repeated form field names
jQuery: serializeArray preserves multiple values as name-value records.
jQuery✓ Tested
Control the size of a repeated background tile
CSS: Background-size sets the rendered dimensions of each repeated background image.
CSS✓ Tested
Count repeated lines after sorting
Linux Commands: Group identical lines before uniq -c, then normalize its leading padding.
Linux Commands✓ Tested
Count repeated words
Count repeated words using a complete Go program with explicit sample inputs.
Go✓ Tested
Preserve line breaks while collapsing repeated spaces
CSS: Pre-line retains newlines but does not preserve all whitespace like pre-wrap does.
CSS✓ Tested
Repeat a command for several words
Bash Scripts: Repeat a command for several words with a small standalone Bash program.
Bash Scripts✓ Tested
Repeat a fixed number of times
Python: Use a counted loop to print three numbered steps.
Python✓ Tested
Repeat a fixed number of times
C#: Use a counted loop to print three numbered steps.
C#✓ Tested
Repeat a fixed number of times
Java: Use a counted loop to print three numbered steps.
Java✓ Tested
Repeat a fixed number of times
JavaScript: Use a counted loop to print three numbered steps.
JavaScript✓ Tested