Results for “Collections & data structures”
Small, practical examples. Search by task or narrow things down below.
Display a fallback for missing data
SQL: Return a supplied label when a column contains NULL.
SQL✓ Tested
Display a fallback for missing data
SQL Server: Return a supplied label when a column contains NULL.
SQL Server✓ Tested
Display a fallback for missing data
Postgres: Return a supplied label when a column contains NULL.
Postgres✓ Tested
Display a fallback for missing data
SQLite: Return a supplied label when a column contains NULL.
SQLite✓ Tested
Display a slice of paginated data
Display a slice of paginated data with a small React component and explicit browser behavior.
React✓ Tested
Encode and decode binary data as Base64
Python: Use Base64 when a text format must carry bytes; it is encoding, not encryption.
Python✓ Tested
Export committed files without the Git metadata directory
Git: Git archive creates a snapshot of tracked committed files only.
Git✓ Tested
Find differences between two collections
PowerShell: Compare-Object marks reference-only values with a left arrow and difference-only values with a right arrow.
PowerShell✓ Tested
Find values shared by two collections
Python: Use set intersection and sort the result for deterministic display.
Python✓ Tested
Flatten nested collections
Java: Use flatMap to concatenate nested Java lists into one stream.
Java✓ Tested
Flatten nested collections
Flatten nested collections in a complete Rust program using the standard library.
Rust✓ Tested
Flatten nested collections with SelectMany
C#: Concatenate the items from several sequences into one sequence.
C#✓ Tested