Results for “Collections & data structures”
Small, practical examples. Search by task or narrow things down below.
Give a document a descriptive browser title
HTML: The title element supplies the browser document title independently of the visible heading.
HTML✓ Tested
Give a reusable record type a short name
C: A typedef names a structure type without changing its representation.
C✓ Tested
Group records into map entries
JavaScript: Initialize an array for a missing Map key before appending its values.
JavaScript✓ Tested
Group records into map entries
TypeScript: Initialize an array for a missing Map key before appending its values.
TypeScript✓ Tested
Handle malformed JSON input
Python: Catch JSONDecodeError without hiding unrelated programming errors.
Python✓ Tested
Implement a method on a struct
Implement a method on a struct in a complete Rust program using the standard library.
Rust✓ Tested
Include zero counts for missing relationships
SQL: Count the non-null child key after a left join so a missing relationship produces zero.
SQL✓ Tested
Include zero counts for missing relationships
SQL Server: Count the non-null child key after a left join so a missing relationship produces zero.
SQL Server✓ Tested
Include zero counts for missing relationships
Postgres: Count the non-null child key after a left join so a missing relationship produces zero.
Postgres✓ Tested
Include zero counts for missing relationships
SQLite: Count the non-null child key after a left join so a missing relationship produces zero.
SQLite✓ Tested
Initialize structure fields by name
C: Designated initializers make field assignments independent of their declaration order.
C✓ Tested
Inspect a user-defined network’s driver
Docker / Compose: The default driver for a local user-defined network is bridge.
Docker / Compose✓ Tested