Results for “all”
Small, practical examples. Search by task or narrow things down below.
Count the items in a collection
C++: Read the collection’s length instead of hard-coding the loop limit.
C++✓ Tested
Count the items in a collection
C: Read the collection’s length instead of hard-coding the loop limit.
C✓ Tested
Count word frequencies
Accumulate word counts in an ordered C++ map.
C++✓ Tested
Create a modified copy of an immutable record
C#: A with expression creates a shallow copy with selected changed properties.
C#✓ Tested
Create a network marked for internal connectivity
Docker / Compose: The internal option disables normal external routing for that network.
Docker / Compose✓ Tested
Create a runtime file during the build
Docker / Compose: RUN executes during the build while CMD executes when a container starts.
Docker / Compose✓ Tested
Create an index for an equality filter
SQL: A nonunique index can support lookups on a frequently filtered column.
SQL✓ Tested
Create an index for an equality filter
SQL Server: A nonunique index can support lookups on a frequently filtered column.
SQL Server✓ Tested
Create an index for an equality filter
Postgres: A nonunique index can support lookups on a frequently filtered column.
Postgres✓ Tested
Create an index for an equality filter
SQLite: A nonunique index can support lookups on a frequently filtered column.
SQLite✓ Tested
Create an index matching filter and ordering columns
SQL: Place the equality-filter column before the ordering column in this composite index.
SQL✓ Tested
Create an index matching filter and ordering columns
SQL Server: Place the equality-filter column before the ordering column in this composite index.
SQL Server✓ Tested