Results for “Collections & data structures”
Small, practical examples. Search by task or narrow things down below.
Generate combinations across two collections
Python: Use product for a Cartesian product; this differs from selecting combinations within one collection.
Python✓ Tested
Group related values in nested structures
C: Nested members model a record that owns another simple record.
C✓ Tested
Include a nonvisible value in form data
HTML: A named hidden input contributes data without adding a visible editing control.
HTML✓ Tested
Increment a stored value in the database
SQL: An in-database arithmetic update avoids a separate application read-modify-write step.
SQL✓ Tested
Increment a stored value in the database
SQL Server: An in-database arithmetic update avoids a separate application read-modify-write step.
SQL Server✓ Tested
Increment a stored value in the database
Postgres: An in-database arithmetic update avoids a separate application read-modify-write step.
Postgres✓ Tested
Increment a stored value in the database
SQLite: An in-database arithmetic update avoids a separate application read-modify-write step.
SQLite✓ Tested
Initialize component data with ngOnInit
Initialize component data with ngOnInit with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Initialize shared data once
Initialize shared data once in a complete Rust program using the standard library.
Rust✓ Tested
Inject a data loader into a component
Inject a data loader into a component with a small React component and explicit browser behavior.
React✓ Tested
Inspect structured data with JsonPipe
Inspect structured data with JsonPipe with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Keep scratch data only for the container lifetime
Docker / Compose: Separate tmpfs mounts do not share data between container runs.
Docker / Compose✓ Tested