[Edu-sig] When am I the same age as my dog?
kirby.urner at gmail.com
Wed Aug 8 23:43:17 CEST 2007
I may have posted about this awhile back, but it
came up as a real question for a man wanting to
party the day his dog caught up and passed him
in age, assuming one human year = seven dog
It makes a fun Python program as it involves dates,
which are notoriously problematic. Hint: Julian dates
might come in handy, plus don't forget leap years.
Another posing of the problem:
Every day I live counts as 1 day, every day a dog lives
counts as 7. Given a dog born later than myself (date),
and my birthday (date), on which day will my dog and
I have the same number of days to our credit (date)?
date samecount (
date dog_bday, date my_bday
Note: my newest gig involves teaching SQL using Python
in shell mode to start (import MySQLdb **), per my standard
This courseware is proprietary by mutual consent, so I
won't be saying much more about it here (or anywhere).
Just more of the usual day job.
** typical student/teacher interface:
kirby at dell:~$ ssh [xxx]
Last login: Wed Aug 8 11:33:46 2007 from [yyy]
[prompt ~]$ python2.5
Python 2.5.1 (r251:54863, Jul 17 2007, 14:30:01)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
['BINARY', 'Binary', 'Connect', 'Connection', 'DATE', 'DATETIME',
'DBAPISet', 'DataError', 'DatabaseError', 'Date', 'DateFromTicks',
'Error', 'FIELD_TYPE', 'ImmutableSet', 'IntegrityError',
'InterfaceError', 'InternalError', 'MySQLError', 'NULL', 'NUMBER',
'NotSupportedError', 'OperationalError', 'ProgrammingError', 'ROWID',
'STRING', 'TIME', 'TIMESTAMP', 'Time', 'TimeFromTicks', 'Timestamp',
'TimestampFromTicks', 'Warning', '__all__', '__author__',
'__builtins__', '__doc__', '__file__', '__loader__', '__name__',
'__path__', '__revision__', '__version__', '_mysql', 'apilevel',
'connect', 'connection', 'constants', 'debug', 'escape',
'escape_dict', 'escape_sequence', 'escape_string', 'get_client_info',
'paramstyle', 'release', 'result', 'server_end', 'server_init',
'string_literal', 'thread_safe', 'threadsafety', 'times',
More information about the Edu-sig