FIND YOUR NEXT FEW LINES

Results for “new”

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

88 snippets foundClear filters
GoErrors & validation

Return a descriptive validation error

Return a descriptive validation error using a complete Go program with explicit sample inputs.

Go✓ Tested
RustFunctions & data types

Wrap a value in a distinct type

Wrap a value in a distinct type in a complete Rust program using the standard library.

Rust✓ Tested
C#Data & dates

Add calendar days

Use DateOnly for a date without a time zone in C#.

C#✓ Tested
C#Files & paths

Append a line

Append UTF-8 text without replacing existing C# file contents.

C#✓ Tested
PythonFiles & paths

Append a line to a file

Add a new line to the end of a text file without replacing its existing contents. Append mode also creates the file if it does not exist.

file✓ Tested
PowerShellArray operations

Append an item to a small array

PowerShell: The plus-equals operator builds a new array; use a generic list for repeated large additions.

PowerShell✓ Tested
Linux CommandsArchive integrity & packaging

Archive filenames safely with null delimiters

Linux Commands: Use find -print0 with tar --null to preserve spaces and embedded newlines in filenames.

Linux Commands✓ Tested
Arduino / CGetting Started

Change an LED delay with a variable

Arduino / C: Assign a new value to a variable to change the next LED pulse duration.

Arduino / C✓ Tested
Linux CommandsSystem information

Check memory usage

Show memory and swap totals in human-readable units. The available column estimates memory usable by new applications.

memory✓ Tested
Arduino / CSerial communication

Collect a serial line in a fixed buffer

Read a short command without dynamic String allocation.

serial line✓ Tested
Docker / ComposeBuild images

Copy a file into an image

Include a small application file during the build.

Dockerfile✓ Tested
Bash ScriptsArray operations

Copy an array independently

Bash Scripts: A new array assignment copies element values rather than creating a shared reference.

Bash Scripts✓ Tested