Results for “seq”
Small, practical examples. Search by task or narrow things down below.
Test any and all elements with predicates
C++: These algorithms stop as soon as their result is known.
C++✓ Tested
Transform a vector into a separate result
C++: Pre-size the output before writing through its iterator.
C++✓ Tested
Visit adjacent pairs
Python: Use itertools.pairwise to process neighboring items without indexing.
Python✓ Tested
Calculate a product with Aggregate
C#: Supply a seed to define the result for an empty sequence.
C#✓ Tested
Calculate a small factorial iteratively
C: Multiply a bounded sequence using an unsigned accumulator.
C✓ Tested
Choose Bash with pipefail for build commands
Docker / Compose: SHELL changes the interpreter for subsequent shell-form instructions.
Docker / Compose✓ Tested
Concatenate arrays without mutating either input
JavaScript: concat creates a shallow combined sequence.
JavaScript✓ Tested
Concatenate arrays without mutating either input
TypeScript: concat creates a shallow combined sequence.
TypeScript✓ Tested
Count five LED flashes with a for loop
Arduino / C: Repeat an LED action a known number of times and print the current count.
Arduino / C✓ Tested
Create a reusable one-to-many lookup
C#: ToLookup groups values by key and returns an empty sequence for an unknown key.
C#✓ Tested
Create an ordered list
Represent a sequence of steps using an HTML ordered list.
HTML✓ Tested
Decode a percent-encoded URL component
JavaScript: decodeURIComponent reverses percent encoding and throws for malformed sequences.
JavaScript✓ Tested