FIND YOUR NEXT FEW LINES

Results for “Encoding & structured values”

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

391 snippets foundClear filters
PowerShellFunctions & parameter validation

Restrict a function parameter to known choices

PowerShell: ValidateSet rejects unsupported values before the function body executes.

PowerShell✓ Tested
JavaRecords & reliable control flow

Return a value from a switch expression

Java: Use an exhaustive switch expression with a fallback for other input values.

Java✓ Tested
PostgresRows & writes

Return an inserted row

Read generated data directly from INSERT.

RETURNING✓ Tested
PythonNumbers & calculations

Round decimal amounts explicitly

Python: Build Decimal values from strings and choose a rounding rule explicitly.

Python✓ Tested
C++Numbers & algorithms

Search a sorted vector

Use binary_search after ensuring C++ values are sorted.

C++✓ Tested
SQLSelect & filter

Select an inclusive range

Find rows with values between two endpoints.

BETWEEN✓ Tested
PythonIteration & sequences

Separate records into two lists

Python: Build two explicit partitions so callers can use both matching and rejected values.

Python✓ Tested
jQueryForm serialization & state

Set several selected options

jQuery: Passing an array to val selects matching values in a multiple select.

jQuery✓ Tested
C++Collections

Sort a vector

Sort C++ integer values in ascending order.

C++✓ Tested
JavaScriptUTC date operations

Sort timestamp strings by their parsed instants

JavaScript: Compare epoch values explicitly when date strings may contain different offsets.

JavaScript✓ Tested
TypeScriptUTC date operations

Sort timestamp strings by their parsed instants

TypeScript: Compare epoch values explicitly when date strings may contain different offsets.

TypeScript✓ Tested
JavaStrings

Split comma-separated text

Split a simple comma-separated string into individual Java values.

Java✓ Tested