FIND YOUR NEXT FEW LINES

Results for “as”

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

2533 snippets foundClear filters
TypeScriptSafe data handling

Validate an unknown value with a type guard

Check a field before treating unknown data as a typed object.

unknown✓ Tested
HTMLInput constraints

Validate the shape of an absolute URL

HTML: A URL input checks syntax, not whether a resource exists or is safe.

HTML✓ Tested
GoErrors & validation

Validate UTF-8 bytes

Validate UTF-8 bytes using a complete Go program with explicit sample inputs.

Go✓ Tested
Linux CommandsArchive integrity & packaging

Verify a file against a checksum manifest

Linux Commands: Use sha256sum -c with a manifest obtained from a trusted source.

Linux Commands✓ Tested
PythonIteration & sequences

Visit adjacent pairs

Python: Use itertools.pairwise to process neighboring items without indexing.

Python✓ Tested
PythonGetting Started

Visit every item in a collection

Python: Print each element in the collection’s original order.

Python✓ Tested
JavaGetting Started

Visit every item in a collection

Java: Print each element in the collection’s original order.

Java✓ Tested
TypeScriptGetting Started

Visit every item in a collection

TypeScript: Print each element in the collection’s original order.

TypeScript✓ Tested
C++Getting Started

Visit every item in a collection

C++: Print each element in the collection’s original order.

C++✓ Tested
CGetting Started

Visit every item in a collection

C: Print each element in the collection’s original order.

C✓ Tested
Arduino / CGetting Started

Visit every reading in a fixed array

Arduino / C: Visit every reading in a fixed array on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
JavaFile operations & binary data

Visit files recursively

Java: Close the stream returned by Files.walk and sort relative paths for stable output.

Java✓ Tested