FIND YOUR NEXT FEW LINES

Results for “by”

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

417 snippets foundClear filters
PythonMappings & sets

Find values shared by two collections

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

Python✓ Tested
SQLReporting & grouped calculations

Group by more than one field

SQL: Each distinct combination of grouping fields produces its own row.

SQL✓ Tested
SQL ServerReporting & grouped calculations

Group by more than one field

SQL Server: Each distinct combination of grouping fields produces its own row.

SQL Server✓ Tested
PostgresReporting & grouped calculations

Group by more than one field

Postgres: Each distinct combination of grouping fields produces its own row.

Postgres✓ Tested
SQLiteReporting & grouped calculations

Group by more than one field

SQLite: Each distinct combination of grouping fields produces its own row.

SQLite✓ Tested
PythonMappings & sets

Group records by a field

Python: Accumulate related values with defaultdict without checking whether each group exists.

Python✓ Tested
JavaStream transformations

Group strings by their length

Java: Choose a TreeMap supplier when group keys must have deterministic order.

Java✓ Tested
AngularGetting Started

Handle an event emitted by a child

Handle an event emitted by a child with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
JavaStream transformations

Index records by a unique key

Java: Use toMap with an explicit merge rule so duplicate keys have defined behavior.

Java✓ Tested
CDynamic memory & ownership

Initialize a byte buffer to zero

C: memset initializes each byte to the chosen unsigned-char value.

C✓ Tested
CStructures & function interfaces

Initialize structure fields by name

C: Designated initializers make field assignments independent of their declaration order.

C✓ Tested
Arduino / CGetting Started

Inspect a byte as hexadecimal

Arduino / C: Inspect a byte as hexadecimal on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested