FIND YOUR NEXT FEW LINES

Results for “Records & reliable control flow”

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

215 snippets foundClear filters
Arduino / CTiming & control

Blink without blocking the loop

Use elapsed millis time instead of delay for a repeating action.

millis✓ Tested
CSmall algorithms & bit operations

Calculate a least common multiple using a GCD

C: Divide before multiplying to reduce the risk of intermediate overflow.

C✓ Tested
C++Numeric parsing & calculations

Calculate a two-dimensional vector length

C++: hypot avoids unnecessary intermediate overflow in the sum of squares.

C++✓ Tested
JavaPrecise numeric calculations

Calculate beyond the long integer range

Java: Use BigInteger when a fixed-width primitive type would overflow.

Java✓ Tested
C++Text validation & parsing

Check a literal suffix in C++17

C++: Check lengths before subtracting to avoid an unsigned underflow.

C++✓ Tested
Docker / ComposeCompose service options

Choose a service’s internal hostname

Docker / Compose: hostname controls the name reported inside the container.

Docker / Compose✓ Tested
PowerShellFunctions & control

Choose an action with switch

Map a small command value to a result.

switch✓ Tested
CSSPositioning & stacking

Choose which overlapping box receives a pointer

CSS: Z-index controls the stack level of these positioned sibling elements.

CSS✓ Tested
GitRemotes & additional checkouts

Clone a local bare repository

Git: A local remote provides the same clone workflow without any network dependency.

Git✓ Tested
jQueryForm serialization & state

Collect repeated form field names

jQuery: serializeArray preserves multiple values as name-value records.

jQuery✓ Tested
HTMLForm behavior

Collect several checked values under one name

HTML: Only checked named checkboxes become successful form controls.

HTML✓ Tested
Arduino / CTiming & control

Compare elapsed time across timer rollover

Use unsigned subtraction when a millisecond counter wraps.

rollover✓ Tested