Results for “or”
Small, practical examples. Search by task or narrow things down below.
Repeat a task with a counted loop
Repeat a task with a counted loop using a complete Go program with explicit sample inputs.
Go✓ Tested
Repeat an action a fixed number of times
Use a counter and delay for a simple finite sequence.
for loop✓ Tested
Repeat text a fixed number of times
Java: Use String.repeat with a nonnegative repetition count.
Java✓ Tested
Represent a decimal quantity with a scaled integer
Arduino / C: Integer hundredths avoid floating-point storage for fixed-precision values.
Arduino / C✓ Tested
Represent a finite set of states
Java: Use an enum to prevent arbitrary strings from representing application states.
Java✓ Tested
Require a minimum text length
Require a minimum text length with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Reset a nonnullable control to its initial value
Reset a nonnullable control to its initial value with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Resolve a deferred result
jQuery: done receives the value supplied to resolve.
jQuery✓ Tested
Resolve a relative URI against a base
C#: Use a base URI ending in a slash when the final path component represents a directory.
C#✓ Tested
Restrict a diff to one chosen path
Git: Use the double dash separator to distinguish a filename from revisions or options.
Git✓ Tested
Retrieve the smallest queued value first
Java: PriorityQueue poll removes the smallest value under the natural ordering.
Java✓ Tested
Return a value from a switch expression
Java: Use an exhaustive switch expression with a fallback for other input values.
Java✓ Tested