Results for “fold”
Small, practical examples. Search by task or narrow things down below.
Distinguish UTF-8 bytes from characters
Distinguish UTF-8 bytes from characters in a complete Rust program using the standard library.
Rust✓ Tested
Divide an ordered result into numbered buckets
SQLite: NTILE distributes rows across buckets; include a unique tie-breaker for deterministic assignment.
SQLite✓ Tested
Embed a struct for shared fields
Embed a struct for shared fields using a complete Go program with explicit sample inputs.
Go✓ Tested
Enable and use foreign keys
Turn on relationship enforcement for the connection.
foreign keys✓ Tested
Encode a struct with JSON field names
Encode a struct with JSON field names using a complete Go program with explicit sample inputs.
Go✓ Tested
Encode an integer as big-endian bytes
Encode an integer as big-endian bytes in a complete Rust program using the standard library.
Rust✓ Tested
Encode and decode a file with Base64
Linux Commands: Use GNU base64 for text transport of bytes and --decode for the reverse operation.
Linux Commands✓ Tested
Encode and decode Base64 text
Encode and decode Base64 text using a complete Go program with explicit sample inputs.
Go✓ Tested
Encode bytes as hexadecimal
Encode bytes as hexadecimal using a complete Go program with explicit sample inputs.
Go✓ Tested
Encode URL query parameters
Encode URL query parameters using a complete Go program with explicit sample inputs.
Go✓ Tested
Enforce a bounded numeric range
SQLite: A named CHECK constraint keeps numeric values inside an inclusive interval.
SQLite✓ Tested
Enforce a relationship between two columns
SQLite: A row-level CHECK can require a start value to be no greater than an end value.
SQLite✓ Tested