FIND YOUR NEXT FEW LINES

Results for “when”

Small, practical examples. Search by task or narrow things down below.

230 snippets foundClear filters
Linux CommandsFiles & permissions

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
JavaFile operations & binary data

Create and clean up a temporary file

Java: Create a unique file and remove it in finally even when the operation fails.

Java✓ Tested
PythonFiles & paths

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
SQLChange & combine data

Delete one matching row

Remove a selected record and inspect what remains.

DELETE✓ Tested
SQLGetting Started

Display a fallback for missing data

SQL: Return a supplied label when a column contains NULL.

SQL✓ Tested
SQL ServerGetting Started

Display a fallback for missing data

SQL Server: Return a supplied label when a column contains NULL.

SQL Server✓ Tested
PostgresGetting Started

Display a fallback for missing data

Postgres: Return a supplied label when a column contains NULL.

Postgres✓ Tested
SQLiteGetting Started

Display a fallback for missing data

SQLite: Return a supplied label when a column contains NULL.

SQLite✓ Tested
JavaPrecise numeric calculations

Display an integer as unsigned

Java: Use unsigned conversion methods when interpreting a fixed-width bit pattern.

Java✓ Tested
Arduino / CBinary values & packets

Encode a value as little-endian bytes

Arduino / C: Store the least significant byte first when the protocol requires it.

Arduino / C✓ Tested
PythonText validation & encoding

Encode and decode binary data as Base64

Python: Use Base64 when a text format must carry bytes; it is encoding, not encryption.

Python✓ Tested
CSSResponsive conditions & sizing

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