Results for “when”
Small, practical examples. Search by task or narrow things down below.
Create an empty file
Linux Commands: Use touch to create a file when absent; an existing file keeps its contents but gets updated timestamps.
Linux Commands✓ Tested
Create and clean up a temporary file
Java: Create a unique file and remove it in finally even when the operation fails.
Java✓ Tested
Create nested folders
Create a folder and any missing parent folders in one call. Running the code again is safe when the folder already exists.
directory✓ Tested
Delete one matching row
Remove a selected record and inspect what remains.
DELETE✓ Tested
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 an integer as unsigned
Java: Use unsigned conversion methods when interpreting a fixed-width bit pattern.
Java✓ Tested
Encode a value as little-endian bytes
Arduino / C: Store the least significant byte first when the protocol requires it.
Arduino / C✓ 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
Enhance a layout above a minimum viewport width
CSS: A mobile-first min-width query adds columns when enough horizontal space is available.
CSS✓ Tested