Results for “fields”
Small, practical examples. Search by task or narrow things down below.
Allocate and initialize a structure
C: Use a compound literal assignment to initialize all ordinary structure fields.
C✓ Tested
Describe an object with an interface
Require named fields on a reusable object shape.
interface✓ Tested
Format a known timestamp in UTC
C: gmtime converts to UTC calendar fields and strftime formats them.
C✓ Tested
Format a timestamp with to_char
Produce a fixed numeric date string.
to_char✓ Tested
Give an optional property a default
Handle missing object fields with nullish coalescing.
optional✓ Tested
Group by more than one field
SQL: Each distinct combination of grouping fields produces its own row.
SQL✓ Tested
Group by more than one field
SQL Server: Each distinct combination of grouping fields produces its own row.
SQL Server✓ Tested
Group by more than one field
Postgres: Each distinct combination of grouping fields produces its own row.
Postgres✓ Tested
Group by more than one field
SQLite: Each distinct combination of grouping fields produces its own row.
SQLite✓ Tested
Group mutually exclusive choices
Use the same name for HTML radio buttons and a fieldset legend.
HTML✓ Tested
Group related readings in a struct
Arduino / C: A struct keeps a sample’s fields together without dynamic allocation.
Arduino / C✓ Tested
Post URL-encoded form data
jQuery: post sends a data object as form-encoded fields by default.
jQuery✓ Tested