FIND YOUR NEXT FEW LINES

Results for “json_valid”

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

247 snippets foundClear filters
PowerShellFunctions & parameter validation

Run cleanup after a caught exception

PowerShell: Use finally for cleanup that must occur after either success or failure.

PowerShell✓ Tested
PowerShellStructured formats & encodings

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
ReactForms & validation

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
JavaText validation & formatting

Treat dynamic regex input as literal text

Java: Use Pattern.quote so metacharacters in a search term lose their special meaning.

Java✓ Tested
C++Text validation & parsing

Trim surrounding ASCII whitespace

C++: Find the first and last non-whitespace bytes before taking a substring.

C++✓ Tested
GoErrors & validation

Wrap an error with context

Wrap an error with context using a complete Go program with explicit sample inputs.

Go✓ Tested
SQLSchema design & transactions

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
SQL ServerSchema design & transactions

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
PostgresSchema design & transactions

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
SQLiteSchema design & transactions

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
CStrings & byte buffers

Check a literal filename suffix

C: Check lengths before subtracting so a short input cannot produce an invalid pointer.

C✓ Tested
CStrings & byte buffers

Check a literal string prefix

C: strncmp compares at most the prefix length; both inputs must be valid strings.

C✓ Tested