[CentralOH] coPy] 2016-03-28 會議 Scribbles 落書/惡文?: xrandr, leap day challenge; new challenge; raspberry pi 0 sense hat; C versus Python; Unix Philosophy camera, macro seek thermal
R P Herrold
herrold at owlriver.com
Fri Apr 1 11:06:22 EDT 2016
On Tue, 29 Mar 2016, jep200404 at columbus.rr.com wrote:
> ###############################################################################
>
> Eric Floehr presented the entries for last month's challenge to write
> Python code to figure out when the next COhPy meeting will be on a leap day.
>
> https://github.com/efloehr/cohpy_leapday_challenge
>
> There are many little good details to learn from the entries.
> calendar.MONDAY is much much better than magic number 0!!!
> There was also some spectacularly ugly code that works.
site seems to have moved to:
https://github.com/cohpy/challenge-201602-leapday
TIMTOWTDI a shell solution
[herrold at centos-7 cohpy]$ ./leap-day.sh
next Leap Monday EOM meeting is: 2/29/2044
[herrold at centos-7 cohpy]$ cat ./leap-day.sh
#!/bin/sh
# https://github.com/cohpy/challenge-201602-leapday
#
# COhPy meets the last Monday of the month. This year,
# 2016, COhPy meets on Leap Day. When will the next Leap
# Day meeting of COhPy occur?
#
DONE=""
for i in `seq 2016 4 3000 `; do
[ "x${DONE}" = "x" ] && {
DOW=` date --date="2/29/${i}" +%a`
[ "x${DOW}" = "xMon" -a 0${i} -gt 2016 ] && {
export DONE="y"
echo "next Leap Monday EOM meeting is: 2/29/${i} "
}
}
done
[herrold at centos-7 cohpy]$
-- Russ
More information about the CentralOH
mailing list