FIND YOUR NEXT FEW LINES

Results for “save”

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

1671 snippets foundClear filters
CDynamic memory & ownership

Check an array allocation size before multiplying

C: Compare the requested element count against SIZE_MAX divided by element size.

C✓ Tested
PowerShellCommands & execution context

Check an external process exit status explicitly

PowerShell: LASTEXITCODE reports a native child exit code independently of ordinary PowerShell cmdlet errors.

PowerShell✓ Tested
C++Numeric parsing & calculations

Check an upper integer bound before adding

C++: For these nonnegative values, compare against the maximum minus the addend first.

C++✓ Tested
JavaStream transformations

Check any and all stream elements

Java: Use short-circuiting match operations for predicates over a Java collection.

Java✓ Tested
JavaScriptArray traversal & selection

Check array membership with includes

JavaScript: includes uses SameValueZero comparison, which also matches NaN.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Check array membership with includes

TypeScript: includes uses SameValueZero comparison, which also matches NaN.

TypeScript✓ Tested
Bash ScriptsArray operations

Check exact array membership

Bash Scripts: Compare each element literally instead of searching a concatenated string.

Bash Scripts✓ Tested
PowerShellHashtables & object records

Check for a hashtable key before reading it

PowerShell: ContainsKey distinguishes a missing key from a key whose value happens to be null.

PowerShell✓ Tested
JavaScriptStrings

Check for a substring

Perform a case-sensitive JavaScript substring check.

JavaScript✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Check for an installed command

Bash Scripts: command -v checks command resolution without assuming a specific installation path.

Bash Scripts✓ Tested
jQueryForm serialization & state

Check native form validity before proceeding

jQuery: Use the native checkValidity API from the selected form.

jQuery✓ Tested
CNumeric parsing & arithmetic

Check positive integer addition before performing it

C: Check the upper boundary before adding two known nonnegative integers.

C✓ Tested