Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,4 @@
long_year() {
cal 1 $1 | grep -q ' 3 *$' && return 0
cal 12 $1 | grep -q ' 26 *$'
}

View file

@ -0,0 +1,3 @@
long_year() {
expr $(date -d "$1-12-28" +%V) = 53 >/dev/null
}

View file

@ -0,0 +1,12 @@
dec31wd() {
# return weekday (time_t tm_wday, 0=Sunday) of December 31st of the given year
typeset -i y=$1
echo $(( (y + y / 4 - y / 100 + y / 400) % 7 ))
}
# the year is long if the year starts or ends on a Thursday (starts on a
# Thursday = the previous year ends on a Wednesday)
long_year() {
typeset -i y=$1
(( 4 == $(dec31wd $y) || 3 == $(dec31wd $(( y - 1 ))) ))
}

View file

@ -0,0 +1,5 @@
for y in $(seq 1995 2045); do
if long_year $y; then
echo $y
fi
done | column