FIND YOUR NEXT FEW LINES

Results for “value”

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

670 snippets foundClear filters
SQLiteReporting & grouped calculations

Turn known group values into columns

SQLite: Conditional aggregation gives a portable pivot when the category set is known.

SQLite✓ Tested
GoGetting Started

Understand default zero values

Understand default zero values using a complete Go program with explicit sample inputs.

Go✓ Tested
AngularSignals & state

Update a signal from its previous value

Update a signal from its previous value with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
GoGetting Started

Update a value through a pointer

Update a value through a pointer using a complete Go program with explicit sample inputs.

Go✓ Tested
RustMaps & sets

Update an existing map value

Update an existing map value in a complete Rust program using the standard library.

Rust✓ Tested
ReactGetting Started

Update state from its previous value

Update state from its previous value with a small React component and explicit browser behavior.

React✓ Tested
ReactContext & shared state

Use a context’s fallback value

Use a context’s fallback value with a small React component and explicit browser behavior.

React✓ Tested
Bash ScriptsVariables & text

Use a default value for an unset variable

Supply a fallback without changing the original variable.

parameter expansion✓ Tested
PowerShellStrings & literal text

Use a literal value in a regular expression

PowerShell: Regex.Escape prevents a literal dot or other metacharacter from changing the match.

PowerShell✓ Tested
C#Types & reliable control flow

Use a switch expression to classify a value

C#: Relational patterns express a small ordered range classification.

C#✓ Tested
Bash ScriptsParameter expansion

Use an alternate value only when a variable is nonempty

Bash Scripts: The colon-plus expansion returns its word only when the parameter has a nonempty value.

Bash Scripts✓ Tested
RustGetting Started

Use if to produce a value

Use if to produce a value in a complete Rust program using the standard library.

Rust✓ Tested