Results for “Collections & data structures”
Small, practical examples. Search by task or narrow things down below.
Load a small properties configuration
Java: Use a Reader to make the configuration character encoding explicit.
Java✓ Tested
Mark the language of a phrase inside a page
HTML: An element-level lang attribute identifies a language change within the document.
HTML✓ Tested
Measure a node after the first render
Measure a node after the first render with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Measure content, padding, and borders separately
jQuery: width, innerWidth, and outerWidth measure different parts of the box.
jQuery✓ Tested
Move a file to a new name
Java: Files.move changes the path and returns the destination Path.
Java✓ Tested
Normalize relative path components
Java: Path.normalize removes redundant dot components without accessing the filesystem.
Java✓ Tested
Offer a downloadable text file
HTML: The download attribute supplies a filename for this same-document data URL.
HTML✓ Tested
Pack and unpack a network-order integer
Python: Use an explicit byte order so the binary format is independent of the host architecture.
Python✓ Tested
Pair employees with their managers
SQL: Alias a table twice to represent two different roles in one relationship.
SQL✓ Tested
Pair employees with their managers
SQL Server: Alias a table twice to represent two different roles in one relationship.
SQL Server✓ Tested
Pair employees with their managers
Postgres: Alias a table twice to represent two different roles in one relationship.
Postgres✓ Tested
Pair employees with their managers
SQLite: Alias a table twice to represent two different roles in one relationship.
SQLite✓ Tested