Results for “new”
Small, practical examples. Search by task or narrow things down below.
Return a descriptive validation error
Return a descriptive validation error using a complete Go program with explicit sample inputs.
Go✓ Tested
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
Add calendar days
Use DateOnly for a date without a time zone in C#.
C#✓ Tested
Append a line
Append UTF-8 text without replacing existing C# file contents.
C#✓ Tested
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
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
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
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
Check memory usage
Show memory and swap totals in human-readable units. The available column estimates memory usable by new applications.
memory✓ Tested
Collect a serial line in a fixed buffer
Read a short command without dynamic String allocation.
serial line✓ Tested
Copy a file into an image
Include a small application file during the build.
Dockerfile✓ Tested
Copy an array independently
Bash Scripts: A new array assignment copies element values rather than creating a shared reference.
Bash Scripts✓ Tested