FIND YOUR NEXT FEW LINES

Results for “is”

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

1888 snippets foundClear filters
PythonIteration & sequences

Find the first matching value with a fallback

Python: Pass a generator and default to next to avoid building an intermediate list.

Python✓ Tested
CStrings & byte buffers

Find the first occurrence of a character

C: strchr returns a pointer into the input or NULL if the character is absent.

C✓ Tested
PowerShellArray operations

Find the index of an array item

PowerShell: Array.IndexOf returns -1 when the requested item is absent.

PowerShell✓ Tested
C++Ordering & set operations

Find the insertion position for a sorted value

C++: lower_bound returns the first position whose value is not less than the search key.

C++✓ Tested
PythonNumbers & calculations

Find the mean and median of readings

Python: Use statistics helpers to distinguish an arithmetic mean from a middle value.

Python✓ Tested
jQueryTraversal & selection

Find the nearest matching ancestor

Read a parent row attribute using jQuery closest.

jQuery✓ Tested
JavaScriptArray traversal & selection

Find the position of a matching item

JavaScript: findIndex returns -1 when the predicate matches nothing.

JavaScript✓ Tested
C#Collections & data structures

Find values common to two collections

C#: Intersect returns distinct values shared by the inputs.

C#✓ Tested
PythonMappings & sets

Find values shared by two collections

Python: Use set intersection and sort the result for deterministic display.

Python✓ Tested
CSSResponsive design

Fit as many columns as possible

Use auto-fit and minmax for a CSS grid that responds to its available width.

CSS✓ Tested
JavaScriptArray restructuring

Flatten a single nesting level

JavaScript: flat defaults to a depth of one and creates a new array.

JavaScript✓ Tested
JavaStream transformations

Flatten nested collections

Java: Use flatMap to concatenate nested Java lists into one stream.

Java✓ Tested