Results for “standard”
Small, practical examples. Search by task or narrow things down below.
Serialize an object to JSON
Serialize a small anonymous C# object with System.Text.Json.
C#✓ Tested
Set and retrieve an HTTP header
Set and retrieve an HTTP header using a complete Go program with explicit sample inputs.
Go✓ Tested
Set and test bit flags
Use unsigned masks to combine and test C flags.
C✓ Tested
Share immutable data with Arc
Share immutable data with Arc in a complete Rust program using the standard library.
Rust✓ Tested
Show the current directory
Print the absolute path of your current working directory before running commands that depend on relative paths.
directory✓ Tested
Show the first lines of a file
Read only the first three lines of a text file, useful for checking a header or previewing a large log.
head✓ Tested
Show the Linux distribution version
Read the distribution-provided operating system name and version from os-release.
os✓ Tested
Skip weekends when advancing dates
Python: Walk calendar dates and count only Monday through Friday.
Python✓ Tested
Sort a list
Sort a mutable Java list in natural ascending order.
Java✓ Tested
Sort a vector
Sort C++ integer values in ascending order.
C++✓ Tested
Sort a vector in ascending order
Sort a vector in ascending order in a complete Rust program using the standard library.
Rust✓ Tested
Sort and deduplicate lines
Sort lines alphabetically and remove duplicate lines in a predictable C locale.
sort✓ Tested