FIND YOUR NEXT FEW LINES

Results for “run”

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

2246 snippets foundClear filters
GoGetting Started

Test whether a number is even

Test whether a number is even using a complete Go program with explicit sample inputs.

Go✓ Tested
PowerShellArray operations

Test whether an array contains a value

PowerShell: The contains operator compares complete items rather than matching substrings.

PowerShell✓ Tested
CSmall algorithms & bit operations

Test whether an unsigned value is a power of two

C: A nonzero power of two has exactly one set bit.

C✓ Tested
C#LINQ transformations

Test whether any or all values match

C#: Any and All short-circuit instead of materializing filtered collections.

C#✓ Tested
GitBranches & ancestry

Test whether one revision is an ancestor of another

Git: merge-base --is-ancestor reports its answer through the exit status.

Git✓ Tested
GitInspecting the working tree

Test whether tracked working files changed

Git: A quiet diff returns status one for differences, so handle it in a conditional.

Git✓ Tested
CStructures & function interfaces

Track which union member is currently valid

C: An explicit tag tells callers which overlaid union value to read.

C✓ Tested
C++Ownership & optional values

Transfer unique ownership with move

C++: Moving a unique_ptr leaves the source empty and gives ownership to the destination.

C++✓ Tested
JavaScriptPromises & iteration protocols

Transform a resolved promise result

JavaScript: A then handler returns the value passed to the next promise in the chain.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Transform a resolved promise result

TypeScript: A then handler returns the value passed to the next promise in the chain.

TypeScript✓ Tested
RustGetting Started

Transform a value by shadowing

Transform a value by shadowing in a complete Rust program using the standard library.

Rust✓ Tested
C++Sequence algorithms

Transform a vector into a separate result

C++: Pre-size the output before writing through its iterator.

C++✓ Tested