FIND YOUR NEXT FEW LINES

Results for “z”

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

416 snippets foundClear filters
PythonDates & time zones

Determine whether a year is a leap year

Python: Use calendar.isleap rather than a simplified divisibility-by-four check.

Python✓ Tested
GoDates & times

Display an instant at a fixed offset

Display an instant at a fixed offset using a complete Go program with explicit sample inputs.

Go✓ Tested
jQueryForm serialization & state

Distinguish current state from initial markup

jQuery: prop reads the live checked state; attr reads the original checked attribute.

jQuery✓ Tested
CSSResponsive conditions & sizing

Enhance a layout above a minimum viewport width

CSS: A mobile-first min-width query adds columns when enough horizontal space is available.

CSS✓ Tested
Linux CommandsFinding & selecting files

Find files larger than a byte threshold

Linux Commands: Use the c suffix for exact byte units with GNU find size tests.

Linux Commands✓ Tested
JavaDates & time zones

Find the last day of a month

Java: Use YearMonth so leap years and month lengths are handled by the calendar library.

Java✓ Tested
JavaDates & time zones

Find the next chosen weekday

Java: TemporalAdjusters.next excludes the starting day even if it already has that weekday.

Java✓ Tested
PythonDates & time zones

Find the number of days in a month

Python: Use calendar.monthrange to account for leap years.

Python✓ Tested
JavaDates & time zones

Generate a half-open range of dates

Java: datesUntil includes the starting date and excludes the end date.

Java✓ Tested
PythonStructured data & serialization

Handle malformed JSON input

Python: Catch JSONDecodeError without hiding unrelated programming errors.

Python✓ Tested
CSSResponsive conditions & sizing

Hide interface controls in print layout

CSS: A print media query can retain article content while removing interactive controls.

CSS✓ Tested
CSSGetting Started

Include padding in an element’s width

CSS: Learn how to include padding in an element’s width in a complete browser example.

CSS✓ Tested