Results for “init”
Small, practical examples. Search by task or narrow things down below.
Represent a record with a dataclass
Python: Generate initialization and convert a typed record to a dictionary.
Python✓ Tested
Roll back a trial update
Group a change in a transaction and undo it.
transaction✓ Tested
Round downward and upward independently
C: floor and ceil round toward negative and positive infinity respectively.
C✓ Tested
Start a disclosure open while keeping it collapsible
HTML: The open attribute sets the initial details state without JavaScript.
HTML✓ Tested
Sum numeric values
Provide an initial accumulator for JavaScript reduce, including empty arrays.
JavaScript✓ Tested
Sum typed values with reduce
Accumulate numeric array elements.
reduce✓ Tested
Sum vector values
Use std::accumulate with a wide initial value.
C++✓ Tested
Understand setup() and loop()
Arduino / C: See initialization run once and the main loop run repeatedly.
Arduino / C✓ Tested
Update a running count
Python: Change a variable after its initial value has been assigned.
Python✓ Tested
Update a running count
C#: Change a variable after its initial value has been assigned.
C#✓ Tested
Update a running count
Java: Change a variable after its initial value has been assigned.
Java✓ Tested
Update a running count
JavaScript: Change a variable after its initial value has been assigned.
JavaScript✓ Tested