Re: Only one Friday 13th coming in 2016

2015-12-23 Thread Bill Duncan
Dang! I love this list. Looks like I haven't done a "man cal" for many years. I didn't know about "ncal".. lol. I remember there was a note in the old Version 7 manuals about reading the man pages periodically.. Thanks Ken! On Tue, Dec 22, 2015 at 10:59:18AM -0900, Ken Irving wrote: > On

Re: Only one Friday 13th coming in 2016

2015-12-22 Thread Ken Irving
On Tue, Dec 22, 2015 at 04:04:16AM +0100, Ángel González wrote: > Bill Duncan wrote: > > Remember that while there are 14 patterns of years, leap years don't > > impact Friday the 13th for January/February.. > > > > This isn't an exhaustive analysis, but a quick check for 300 years > > didn't

Re: Only one Friday 13th coming in 2016

2015-12-22 Thread Greg Wooledge
On Tue, Dec 22, 2015 at 04:04:16AM +0100, Ángel González wrote: > Aren't you making things more complex than needed, with so much pipes > and awk? > > date(1) is your friend: > > For instance: >  $ for y in {1900..2199} ; do echo -n "$y "; for m in {1..12}; do date +%A -d > $y-$m-13; done |

Re: Only one Friday 13th coming in 2016

2015-12-22 Thread Stephane Chazelas
2015-12-22 08:16:28 -0500, Greg Wooledge: [...] > t=946702800 # Start at Sat Jan 1 12:00:00 EST 2000 > endyear=2036 > > while true; do > printf -v year '%(%Y)T' "$t" > ((year > endyear)) && break > printf -v day '%(%d)T' "$t" > printf -v dow '%(%w)T' "$t" > if [[ $day = 13 && $dow

Re: Only one Friday 13th coming in 2016

2015-12-22 Thread Ralf Goertz
Am Tue, 22 Dec 2015 08:16:28 -0500 schrieb Greg Wooledge : > On Tue, Dec 22, 2015 at 04:04:16AM +0100, Ángel González wrote: > > Aren't you making things more complex than needed, with so much > > pipes and awk? > > > > date(1) is your friend: > > > > For instance: > >  $

Re: Only one Friday 13th coming in 2016

2015-12-21 Thread Bill Duncan
Remember that while there are 14 patterns of years, leap years don't impact Friday the 13th for January/February.. This isn't an exhaustive analysis, but a quick check for 300 years didn't show any years without a Friday 13th.. ;-) $ for y in {1900..2199} ; do for m in {1..12};do cal $m $y|awk

Only one Friday 13th coming in 2016

2015-12-21 Thread Bill Duncan
We had 3 this year.. $ for y in {1950..2050} ; do for m in {1..12};do cal $m $y|awk 'FNR==1{m=$0}/^ 1/{print m}';done;done| awk '{a[$2]=a[$2]" "$1}END{for (i in a) print i,a[i]}'| sort| awk '{t=$1;$1="";a[$0]=a[$0]" "t}END{for (i in a) printf "%-24s %s\n", i, a[i]}' | sort | cat -n 1

Re: Only one Friday 13th coming in 2016

2015-12-21 Thread John McKown
Gee bit too much free time??? But it is interesting. On Sun, Dec 20, 2015 at 10:59 PM, Bill Duncan wrote: > We had 3 this year.. > > $ for y in {1950..2050} ; do for m in {1..12};do cal $m $y|awk > 'FNR==1{m=$0}/^ 1/{print m}';done;done| awk '{a[$2]=a[$2]" "$1}END{for (i >

Re: Only one Friday 13th coming in 2016

2015-12-21 Thread Ángel González
Bill Duncan wrote: > Remember that while there are 14 patterns of years, leap years don't > impact Friday the 13th for January/February.. > > This isn't an exhaustive analysis, but a quick check for 300 years > didn't show any years without a Friday 13th.. > > ;-) > > $ for y in {1900..2199} ;

Re: Only one Friday 13th coming in 2016

2015-12-21 Thread Greg Wooledge
On Mon, Dec 21, 2015 at 02:59:20PM +, Allodoxaphobia wrote: > Is the logic exhaustive ? -- in that it shows there > are no years with *no* Friday The 13Th's? The Gregorian calendar has 14 different year layouts: 7 non-leap-years beginning with Sunday through Saturday, and 7 leap-years

Re: Only one Friday 13th coming in 2016

2015-12-21 Thread Allodoxaphobia
On Sun, 20 Dec 2015 23:59:32 -0500, Bill Duncan wrote: > We had 3 this year.. > > $ for y in {1950..2050} ; do for m in {1..12};do cal $m $y|awk > 'FNR==1{m=$0}/^ 1/{print m}';done;done| awk '{a[$2]=a[$2]" "$1}END{for (i in > a) print i,a[i]}'| sort| awk '{t=$1;$1="";a[$0]=a[$0]" "t}END{for (i