Results for “Encoding & structured values”
Small, practical examples. Search by task or narrow things down below.
Sum vector values
Use std::accumulate with a wide initial value.
C++✓ Tested
Take a limited number of iterator values
Python: Use islice to consume only the requested prefix of a potentially unbounded iterator.
Python✓ Tested
Test missing values with IS NULL
Find rows where an optional value is absent.
IS NULL✓ Tested
Test whether any or all values match
C#: Any and All short-circuit instead of materializing filtered collections.
C#✓ Tested
Transform array values
Use map to create a JavaScript array of squared values.
JavaScript✓ Tested
Turn known group values into columns
SQL: Conditional aggregation gives a portable pivot when the category set is known.
SQL✓ Tested
Turn known group values into columns
SQL Server: Conditional aggregation gives a portable pivot when the category set is known.
SQL Server✓ Tested
Turn known group values into columns
Postgres: Conditional aggregation gives a portable pivot when the category set is known.
Postgres✓ Tested
Turn known group values into columns
SQLite: Conditional aggregation gives a portable pivot when the category set is known.
SQLite✓ Tested
Understand default zero values
Understand default zero values using a complete Go program with explicit sample inputs.
Go✓ Tested
Validate a structured text identifier
HTML: The pattern attribute matches the entire nonempty input; required handles the empty case.
HTML✓ Tested
Wait for several deferred values
jQuery: when resolves only after every supplied deferred has resolved.
jQuery✓ Tested