Results for “json_valid”
Small, practical examples. Search by task or narrow things down below.
Run cleanup after a caught exception
PowerShell: Use finally for cleanup that must occur after either success or failure.
PowerShell✓ Tested
Serialize nested objects with an explicit depth
PowerShell: Select a sufficient depth so nested data is retained instead of converted into a descriptive string.
PowerShell✓ Tested
Track whether a form differs from its initial value
Track whether a form differs from its initial value with a small React component and explicit browser behavior.
React✓ Tested
Treat dynamic regex input as literal text
Java: Use Pattern.quote so metacharacters in a search term lose their special meaning.
Java✓ Tested
Trim surrounding ASCII whitespace
C++: Find the first and last non-whitespace bytes before taking a substring.
C++✓ Tested
Wrap an error with context
Wrap an error with context using a complete Go program with explicit sample inputs.
Go✓ Tested
Add an optional field to an existing table
SQL: A nullable column permits existing rows to remain valid while data is filled later.
SQL✓ Tested
Add an optional field to an existing table
SQL Server: A nullable column permits existing rows to remain valid while data is filled later.
SQL Server✓ Tested
Add an optional field to an existing table
Postgres: A nullable column permits existing rows to remain valid while data is filled later.
Postgres✓ Tested
Add an optional field to an existing table
SQLite: A nullable column permits existing rows to remain valid while data is filled later.
SQLite✓ Tested
Check a literal filename suffix
C: Check lengths before subtracting so a short input cannot produce an invalid pointer.
C✓ Tested
Check a literal string prefix
C: strncmp compares at most the prefix length; both inputs must be valid strings.
C✓ Tested