FIND YOUR NEXT FEW LINES

Results for “value”

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

670 snippets foundClear filters
PythonCollections

Filter a list with a condition

Build a new list containing only the values that satisfy a condition using a list comprehension.

list✓ Tested
CArray transformations

Filter an array in place with a write index

C: Only retained values advance the write position.

C✓ Tested
C#Collections

Filter even numbers

Use LINQ Where to keep even C# values.

C#✓ Tested
JavaCollections

Filter even numbers

Use a Java stream to collect only even values.

Java✓ Tested
JavaScriptArrays

Filter even numbers

Create a JavaScript array containing only even values.

JavaScript✓ Tested
C#LINQ transformations

Find a matching item with a fallback

C#: Use the FirstOrDefault overload with an explicit default value.

C#✓ Tested
PowerShellHashtables & object records

Find differences between two collections

PowerShell: Compare-Object marks reference-only values with a left arrow and difference-only values with a right arrow.

PowerShell✓ 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
jQueryAnimation completion

Finish all queued animations immediately

jQuery: finish jumps current and queued animations to their final values.

jQuery✓ Tested
Bash ScriptsText parsing & arithmetic

Format a numeric label with leading zeroes

Bash Scripts: Use a constant printf format string and supply values as separate arguments.

Bash Scripts✓ Tested
CSmall algorithms & bit operations

Generate a bounded Fibonacci sequence

C: Keep only the two previous values instead of using exponential recursive calls.

C✓ Tested
PostgresDates & series

Generate a sequence of numbers

Create rows without a stored table.

generate_series✓ Tested