Results for “required”
Small, practical examples. Search by task or narrow things down below.
Read CSV rows as dictionaries
Read a CSV file using its header row as dictionary keys, so each column can be accessed by name.
csv✓ Tested
Remove duplicate values
Use a JavaScript Set to preserve the first occurrence of each primitive value.
JavaScript✓ Tested
Remove duplicates from a list
Remove repeated hashable values while preserving the order in which they first appeared.
list✓ Tested
Replace all literal matches
Replace repeated substrings with JavaScript replaceAll.
JavaScript✓ Tested
Replace text in a string
Replace every occurrence of a substring and keep the result in a new string. The original string is unchanged.
string✓ Tested
Replace text with sed
Replace all occurrences of the substring old on each line and print the transformed text without changing the input file.
sed✓ Tested
Require a value with NOT NULL
SQL: Declare required fields at the database boundary, not only in application validation.
SQL✓ Tested
Require a value with NOT NULL
SQL Server: Declare required fields at the database boundary, not only in application validation.
SQL Server✓ Tested
Require a value with NOT NULL
Postgres: Declare required fields at the database boundary, not only in application validation.
Postgres✓ Tested
Require a value with NOT NULL
SQLite: Declare required fields at the database boundary, not only in application validation.
SQLite✓ Tested
Require every bit in a mask
Arduino / C: Masking followed by equality tests whether all required flags are set.
Arduino / C✓ Tested
Search for text in a file
Find matching lines with their line numbers, ignoring letter case and treating the pattern as literal text.
grep✓ Tested