Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

afni_friends.c

Go to the documentation of this file.
00001 #include <stdlib.h>
00002 #include <time.h>
00003 #include <stdio.h>
00004 
00005 /*-------------------------------------------------------------------------*/
00006 /*! What we might thank people for. */
00007 
00008 static char * afni_helptypes[] = {
00009    "advice and help"                ,  /* mask =   1 */
00010    "much encouragement"             ,  /* mask =   2 */
00011    "many suggestions"               ,  /* mask =   4 */
00012    "useful feedback"                ,  /* mask =   8 */
00013    "\"quick\" questions"            ,  /* mask =  16 */
00014    "inspiration"                    ,  /* mask =  32 */
00015    "great efforts"                  ,  /* mask =  64 */
00016    "caloric input"                  ,  /* mask = 128 */
00017    "awe-inspiring beer consumption" ,  /* mask = 256 */
00018    "awe-inspiring caffeine binging" ,  /* mask = 512 */
00019    "you-know-what"                     /* mask =1024 */
00020 } ;
00021 
00022 /*-- special codes --*/
00023 
00024 #define YOU_KNOW_WHAT 10
00025 #define INSPIRATION    5
00026 #define KLOSEK         0   /* person index below */
00027 
00028 #define NUM_HELPTYPES (sizeof(afni_helptypes)/sizeof(char *))
00029 
00030 typedef struct { char *name ; int helpmask ; } AFNI_friend ;
00031 
00032 /*! Who we might thank. */
00033 
00034 static AFNI_friend afni_friends[] = {
00035   { "MM Klosek"      , ( 1 | 2              | 32                 | 1024 ) } ,
00036   { "JR Binder"      , ( 1 |     4 | 8 | 16                             ) } ,
00037   { "EA DeYoe"       , ( 1 |     4 | 8                                  ) } ,
00038   { "JS Hyde"        , ( 1 | 2              | 32                        ) } ,
00039   { "SM Rao"         , ( 1 |     4 | 8 | 16           | 128             ) } ,
00040   { "EA Stein"       , ( 1 | 2 | 4 | 8 | 16           | 128             ) } ,
00041   { "A Jesmanowicz"  , (             8 |      32                        ) } ,
00042   { "MS Beauchamp"   , ( 1 | 2 | 4 | 8 | 16 | 32      | 128             ) } ,
00043   { "JA Bobholz"     , (             8 | 16 | 32      | 128             ) } ,
00044   { "JA Frost"       , (             8 | 16                             ) } ,
00045   { "J Kummer"       , (         4 | 8      | 32                        ) } ,
00046   { "BD Ward"        , (         4 | 8           | 64       | 512       ) } ,
00047   { "S Marrett"      , (             8 | 16                             ) } ,
00048   { "T Holroyd"      , (             8 | 16                             ) } ,
00049   { "KM Donahue"     , (             8 | 16                             ) } ,
00050   { "PA Bandettini"  , (                 16                 | 512       ) } ,
00051   { "AS Bloom"       , ( 1 | 2         | 16                             ) } ,
00052   { "T Ross"         , (         4 | 8 | 16 | 32                        ) } ,
00053   { "H Garavan"      , (         4 | 8 | 16                 | 256       ) } ,
00054   { "SJ Li"          , (     2                                          ) } ,
00055   { "M Huerta"       , (     2                                          ) } ,
00056   { "ZS Saad"        , (     2 | 4 | 8 | 16      | 64 | 128             ) } ,
00057   { "K Ropella"      , (     2                                          ) } ,
00058   { "B Knutson"      , (                 16 |           128             ) } ,
00059   { "B Biswal"       , (                 16                             ) } ,
00060   { "RM Birn"        , (             8 | 16 |           128 | 512       ) } ,
00061   { "V Roopchansingh", (         4 | 8 | 16      | 64                   ) } ,
00062   { "J Ratke"        , (                 16                             ) } ,
00063   { "PSF Bellgowan"  , (             8 | 16                             ) } ,
00064   { "S Durgerian"    , (             8 | 16                             ) } ,
00065   { "M Belmonte"     , (             8 |           64                   ) } ,
00066   { "K Bove-Bettis"  , (             8 | 16 |           128             ) } ,
00067   { "E Kapler"       , (                                128             ) } ,
00068   { "R Doucette"     , (                           64 | 128             ) } ,
00069   { "K Kuhns"        , (                           64 | 128             ) } ,
00070   { "RC Reynolds"    , (                           64 | 128 | 512       ) } ,
00071   { "PP Christidis"  , (                           64 | 128 | 512       ) } ,
00072   { "G Fong"         , (                 16 |           128             ) } ,
00073   { "LR Frank"       , (             8 | 16                             ) } ,
00074   { "R Desimone"     , (     2                                          ) } ,
00075   { "L Ungerleider"  , (     2                                          ) } ,
00076   { "KR Hammett"     , (             8 |           64                   ) } ,
00077   { "A Clark"        , (                           64 |       512       ) } ,
00078   { "DS Cohen"       , ( 1 | 2                                          ) } ,
00079   { "DA Jacobson"    , ( 1 | 2              | 32                        ) }
00080 } ;
00081 
00082 #define NUM_FRIENDS (sizeof(afni_friends)/sizeof(AFNI_friend))
00083 
00084 /*---------------------------------------------------------------------*/
00085 /*! Return a "thanks" string (static storage - don't free it). */
00086 
00087 char * AFNI_get_friend(void)
00088 {
00089    static char buf[256] ; int nf , nh , hmask , qq=0 ;
00090    nf = lrand48() % NUM_FRIENDS ;
00091    do{
00092      nh = lrand48() % NUM_HELPTYPES ; hmask = 1 << nh ; qq++ ;
00093    } while( qq < 73 && (hmask & afni_friends[nf].helpmask) == 0 ) ;
00094 
00095    if( nh == YOU_KNOW_WHAT && nf != KLOSEK ) nh = INSPIRATION; /* only Gosia */
00096 
00097    sprintf( buf  ,
00098             "Thanks go to %s for %s" ,
00099             afni_friends[nf].name , afni_helptypes[nh] ) ;
00100    return buf ;
00101 }
00102 
00103 /*------------------------------------------------------------------------------*/
00104 /* 25 Nov 2002: this date in history! */
00105 
00106 #define JAN  1
00107 #define FEB  2
00108 #define MAR  3
00109 #define APR  4
00110 #define MAY  5
00111 #define JUN  6
00112 #define JUL  7
00113 #define AUG  8
00114 #define SEP  9
00115 #define OCT 10
00116 #define NOV 11
00117 #define DEC 12
00118 
00119 /*! The struct storing date trivia. */
00120 
00121 typedef struct { int mon,day; char *label; } mday ;
00122 
00123 
00124 /*! max # trivia elements allowed per date */
00125 
00126 #define NTMAX 9
00127 
00128 /*! The date trivia array. */
00129 
00130 static mday holiday[] = {
00131    {JAN, 1,"Anniversary of Emancipation Proclamation"                } ,  /* WW */
00132    {JAN, 1,"New Year's Day"                                          } ,
00133    {JAN, 1,"Lorenzo de Medici's birthday"                            } ,
00134    {JAN, 1,"Paul Revere's birthday"                                  } ,
00135    {JAN, 1,"Cameroon Independence Day"                               } ,
00136    {JAN, 1,"Haiti Independence Day"                                  } ,
00137    {JAN, 1,"Western Samoa Independence Day"                          } ,
00138    {JAN, 1,"Sudan Independence Day"                                  } ,
00139    {JAN, 2,"Isaac Asimov's birthday"                                 } ,
00140    {JAN, 3,"John Ronald Reuel Tolkien's birthday"                    } ,
00141    {JAN, 3,"Anniversary of Battle of Princeton"                      } ,
00142    {JAN, 4,"Burma Independence Day"                                  } ,
00143    {JAN, 5,"King Juan Carlos I's birthday"                           } ,
00144    {JAN, 5,"Konrad Adenauer's birthday"                              } ,
00145    {JAN, 6,"Sherlock Holmes' birthday"                               } ,
00146    {JAN, 6,"Jeanne d'Arc's birthday"                                 } ,
00147    {JAN, 7,"Millard Fillmore's birthday"                             } ,
00148    {JAN, 8,"Stephen Hawking's birthday"                              } ,
00149    {JAN, 8,"Elvis Presley's birthday"                                } ,
00150    {JAN, 9,"Richard Nixon's birthday"                                } ,
00151    {JAN,10,"Donald Knuth's birthday"                                 } ,
00152    {JAN,11,"Alexander Hamilton's birthday"                           } ,
00153    {JAN,11,"Chad Independence Day"                                   } ,
00154    {JAN,13,"Anniversary of Zola's J'Accuse"                          } ,
00155    {JAN,14,"Albert Schweitzer's birthday"                            } ,
00156    {JAN,14,"Alfred Tarski's birthday"                                } ,
00157    {JAN,14,"Anniversary of Simpson's premiere"                       } ,
00158    {JAN,15,"Martin Luther King Jr's birthday"                        } ,
00159    {JAN,15,"Chuck Berry's birthday"                                  } ,
00160    {JAN,16,"David Lloyd George's birthday"                           } ,
00161    {JAN,16,"Anniversary of Prohibition's start"                      } ,
00162    {JAN,17,"Benjamin Franklin's birthday"                            } ,
00163    {JAN,17,"Muhammad Ali's birthday"                                 } ,
00164    {JAN,17,"James Earl Jones' birthday"                              } ,
00165    {JAN,17,"Latvia's Zirgu Diena"                                    } ,
00166    {JAN,18,"Cary Grants' birthday"                                   } ,
00167    {JAN,18,"Daniel Webster's birthday"                               } ,
00168    {JAN,19,"Edgar Allen Poe's birthday"                              } ,
00169    {JAN,20,"Anniversary of end of American Revolution"               } ,
00170    {JAN,20,"George Burns' birthday"                                  } ,
00171    {JAN,23,"David Hilbert's birthday"                                } ,
00172    {JAN,23,"Humphrey Bogart's birthday"                              } ,
00173    {JAN,23,"National Pie Day (USA)"                                  } ,
00174    {JAN,24,"Anniversary of beer in cans"                             } ,
00175    {JAN,24,"Emperor Hadrian's birthday"                              } ,
00176    {JAN,25,"Somerset Maugham's birthday"                             } ,
00177    {JAN,26,"Anniversary of First Fleet to Botany Bay"                } ,
00178    {JAN,27,"Charles Dodgson's (Lewis Carroll) birthday"              } ,
00179    {JAN,27,"Wolfgang Amadeus Mozart's birthday"                      } ,
00180    {JAN,28,"Anniversary of Challenger explosion"                     } ,
00181    {JAN,29,"WC Fields' birthday"                                     } ,
00182    {JAN,30,"Franklin Delano Roosevelt's birthday"                    } ,
00183    {JAN,31,"Queen Beatrix's birthday"                                } ,
00184    {JAN,31,"Jackie Robinson's birthday"                              } ,
00185    {JAN,31,"Nauru Independence Day"                                  } ,
00186 
00187    {FEB, 1,"Clark Gable's birthday"                                  } , /* WW */
00188    {FEB, 2,"Charles Maurice de Talleyrand's birthday"                } ,
00189    {FEB, 2,"Tom Smothers' birthday"                                  } ,
00190    {FEB, 3,"The Day the Music Died"                                  } ,
00191    {FEB, 4,"Charles Lindbergh's birthday"                            } ,
00192    {FEB, 4,"Sri Lanka Independence Day"                              } ,
00193    {FEB, 4,"Tadeusz Kosciusko's birthday"                            } ,
00194    {FEB, 4,"Charles Lindbergh's birthday"                            } ,
00195    {FEB, 5,"Hank Aaron's birthday"                                   } ,
00196    {FEB, 6,"Babe Ruth's birthday"                                    } ,
00197    {FEB, 6,"Ronald Reagan's birthday"                                } ,
00198    {FEB, 6,"New Zealand Day"                                         } ,
00199    {FEB, 7,"Thomas More's birthday"                                  } ,
00200    {FEB, 7,"Grenada Independence Day"                                } ,
00201    {FEB, 7,"Charles Dickens' birthday"                               } ,
00202    {FEB, 7,"Dmitri Mendeleev's birthday"                             } ,
00203    {FEB, 8,"William Tecumseh Sherman's birthday"                     } ,
00204    {FEB, 8,"Jules Verne's birthday"                                  } ,
00205    {FEB,10,"St. Scholastica's day"                                   } ,
00206    {FEB,10,"Anniversary of Treaty of Paris, 1763"                    } ,
00207    {FEB,11,"Josiah Willard Gibb's birthday"                          } ,
00208    {FEB,11,"Thomas Edison's birthday"                                } ,
00209    {FEB,11,"Iran National Day"                                       } ,
00210    {FEB,12,"Abraham Lincoln's birthday"                              } ,
00211    {FEB,12,"Charles Darwin's birthday"                               } ,
00212    {FEB,13,"Kim Novak's birthday"                                    } ,
00213    {FEB,14,"Saint Valentine's Day"                                   } ,
00214    {FEB,15,"Anniversary of AFNI's release!"                          } ,
00215    {FEB,15,"Galileo Galilei's birthday"                              } ,
00216    {FEB,18,"Gambia Independence Day"                                 } ,
00217    {FEB,19,"Nikolaus Kopernikus' birthday"                           } ,
00218    {FEB,20,"Anniversary of John Glenn's spaceflight"                 } ,
00219    {FEB,21,"Anniversary of start of the Battle of Verdun"            } ,
00220    {FEB,22,"George Washington's birthday"                            } ,
00221    {FEB,22,"Frederic Chopin's birthday"                              } ,
00222    {FEB,24,"St. Ethelbert's day"                                     } ,
00223    {FEB,25,"Auguste Renoir's birthday"                               } ,
00224    {FEB,27,"Dominican Republic Independence Day"                     } ,
00225    {FEB,27,"Anniversary of Lincoln's Cooper Union Speech"            } ,
00226    {FEB,27,"John Steinbeck's birthday"                               } ,
00227    {FEB,28,"Linus Pauling's birthday"                                } ,
00228    {FEB,29,"Herman Hollerith's birthday"                             } ,
00229    {FEB,29,"W E B Dubois' birthday"                                  } ,
00230 
00231    {MAR, 1,"Santiago Ramon y Cajal's birthday"                       } ,
00232    {MAR, 2,"Samuel Houston's birthday"                               } ,
00233    {MAR, 3,"Georg Cantor's birthday"                                 } ,
00234    {MAR, 3,"Morocco National Day"                                    } ,
00235    {MAR, 4,"Casimir Pulaski's birthday"                              } ,
00236    {MAR, 5,"Anniversary of Boston Massacre"                          } ,
00237    {MAR, 6,"Michelangelo Buonarroti's birthday"                      } ,
00238    {MAR, 8,"Kenneth Grahame's birthday"                              } ,
00239    {MAR,12,"Kemal Ataturk's birthday"                                } ,
00240    {MAR,12,"Mauritius  Independence Day"                             } ,
00241    {MAR,14,"Albert Einstein's birthday"                              } ,
00242    {MAR,15,"The Ides of March"                                       } ,
00243    {MAR,16,"James Madison's birthday"                                } ,
00244    {MAR,17,"Saint Patrick's Day"                                     } ,
00245    {MAR,19,"Saint Joseph's Day"                                      } ,
00246    {MAR,19,"Liechtenstein National Day"                              } ,
00247    {MAR,20,"Anniversary of Uncle Tom's Cabin"                        } ,
00248    {MAR,21,"Jean Baptiste Joseph Fourier's birthday"                 } ,
00249    {MAR,23,"Emmy Noether's birthday"                                 } ,
00250    {MAR,23,"Pakistan Day"                                            } ,
00251    {MAR,24,"Anniversary of Kosciusko's Oath to Nation"               } ,
00252    {MAR,25,"Anniversary of Downfall of Sauron"                       } ,
00253    {MAR,25,"Greece Independence Day"                                 } ,
00254    {MAR,25,"Old English New Year's Day"                              } ,
00255    {MAR,26,"Bangladesh Independence Day"                             } ,
00256    {MAR,26,"Robert Frost's birthday"                                 } ,
00257    {MAR,28,"Pierre Simon de Laplace's birthday"                      } ,
00258    {MAR,30,"Vincent van Gogh's birthday"                             } ,
00259    {MAR,31,"Rene Descartes' birthday"                                } ,
00260 
00261    {APR, 1,"April Fool's Day"                                        } ,
00262    {APR, 2,"Charlemagne's birthday"                                  } ,
00263    {APR, 3,"Stanislaw Ulam's birthday"                               } ,
00264    {APR, 4,"Anniversary of founding of NATO"                         } ,
00265    {APR, 4,"Hungary Liberation Day"                                  } ,
00266    {APR, 4,"Senegal Independence Day"                                } ,
00267    {APR, 4,"Yamamoto Isoroku's birthday"                             } ,
00268    {APR, 8,"Siddhartha Gautama's birthday"                           } ,
00269    {APR, 9,"Anniversary of Lee's surrender at Appomattox"            } ,
00270    {APR,10,"Anniversary of loss of USS Thresher"                     } ,
00271    {APR,11,"Dean Acheson's birthday"                                 } ,
00272    {APR,12,"Anniversary of Yuri Gagarin's spaceflight"               } ,
00273    {APR,13,"Thomas Jefferson's birthday"                             } ,
00274    {APR,14,"Anniversary of Lincoln's assasination"                   } ,
00275    {APR,15,"Anniversary of sinking of Titanic"                       } ,
00276    {APR,15,"Arnold Toynbee's birthday"                               } ,
00277    {APR,15,"Leonhard Euler's birthday"                               } ,
00278    {APR,16,"Jerzy Neyman's birthday"                                 } ,
00279    {APR,17,"Syria Independence Day"                                  } ,
00280    {APR,18,"Anniversary of Paul Revere's Ride"                       } ,
00281    {APR,19,"Anniversary of Warsaw Ghetto Uprising"                   } ,
00282    {APR,21,"Queen Elizabeth II's birthday"                           } ,
00283    {APR,22,"Earth Day"                                               } ,
00284    {APR,22,"Sir Michael Atiyah's birthday"                           } ,
00285    {APR,23,"Saint George's Day"                                      } ,
00286    {APR,24,"Henri Philippe Petain's birthday"                        } ,
00287    {APR,25,"Oliver Cromwell's birthday"                              } ,
00288    {APR,25,"Ross Lockridge's birthday"                               } ,
00289    {APR,25,"Felix Klein's birthday"                                  } ,
00290    {APR,26,"William Shakespeare's birthday"                          } ,
00291    {APR,26,"Ludwig Wittgenstein's birthday"                          } ,
00292    {APR,26,"David Hume's birthday"                                   } ,
00293    {APR,27,"Ulysses Grant's birthday"                                } ,
00294    {APR,27,"Sierra Leone Independence Day"                           } ,
00295    {APR,27,"Togo Independence Day"                                   } ,
00296    {APR,28,"Kurt Goedel's birthday"                                  } ,
00297    {APR,28,"Bahai Feast of Jamal"                                    } ,
00298    {APR,29,"Duke Ellington's birthday"                               } ,
00299    {APR,29,"Henri Poincare's birthday"                               } ,
00300    {APR,30,"Karl Friedrich Gauss's birthday"                         } ,
00301    {APR,30,"Walpurgisnacht"                                          } ,
00302 
00303    {MAY, 1,"Emperor Claudius's birthday"                             } ,
00304    {MAY, 1,"Herman Melville's birthday"                              } ,
00305    {MAY, 2,"Baron Von Richtofen's birthday"                          } ,
00306    {MAY, 3,"Anniversary of Polish Constitution"                      } ,
00307    {MAY, 3,"Nicolo Machiavelli's birthday"                           } ,
00308    {MAY, 3,"Golda Meir's birthday"                                   } ,
00309    {MAY, 4,"Audrey Hepburn's birthday"                               } ,
00310    {MAY, 5,"Henryk Sienkiewicz's birthday"                           } ,
00311    {MAY, 6,"Anniversary of Hindenburg explosion"                     } ,
00312    {MAY, 7,"Anniversary of sinking of Lusitania"                     } ,
00313    {MAY, 8,"VE Day"                                                  } ,
00314    {MAY, 8,"Harry S Truman's birthday"                               } ,
00315    {MAY, 9,"John Brown's birthday"                                   } ,
00316    {MAY, 9,"Anton Cermak's birthday"                                 } ,
00317    {MAY,10,"Gustav Stresemann's birthday"                            } ,
00318    {MAY,10,"Fred Astaire's birthday"                                 } ,
00319    {MAY,11,"Laos Constitution Day"                                   } ,
00320    {MAY,11,"Richard Feynman's birthday"                              } ,
00321    {MAY,12,"Florence Nightingale's birthday"                         } ,
00322    {MAY,13,"Anniversary of Jamestown settlement"                     } ,
00323    {MAY,14,"Paraguay Independence Day"                               } ,
00324    {MAY,15,"Israel Independence Day"                                 } ,
00325    {MAY,16,"Maria Gaetana Agnesi's birthday"                         } ,
00326    {MAY,17,"Norway National Day"                                     } ,
00327    {MAY,18,"John Paul II's birthday"                                 } ,
00328    {MAY,18,"Bertrand Russell's birthday"                             } ,
00329    {MAY,19,"Malcom X's birthday"                                     } ,
00330    {MAY,20,"John Stuart Mill's birthday"                             } ,
00331    {MAY,20,"Cuba Independence Day"                                   } ,
00332    {MAY,21,"Andrei Sakharov's birthday"                              } ,
00333    {MAY,22,"Arthur Conan Doyle's birthday"                           } ,
00334    {MAY,23,"John Bardeen's birthday"                                 } ,
00335    {MAY,24,"Oliver Cromwell's birthday"                              } ,
00336    {MAY,25,"Argentina Revolution Day"                                } ,
00337    {MAY,25,"Jordan Independence Day"                                 } ,
00338    {MAY,26,"Guyana Independence Day"                                 } ,
00339    {MAY,27,"Wild Bill Hickock's birthday"                            } ,
00340    {MAY,28,"Ian Fleming's birthday"                                  } ,
00341    {MAY,29,"John F Kennedy's birthday"                               } ,
00342    {MAY,29,"Harry Bateman's birthday"                                } ,
00343    {MAY,30,"St. Jeanne d'Arc's day"                                  } ,
00344    {MAY,31,"Walt Whitman's birthday"                                 } ,
00345    {MAY,31,"South Africa Republic Day"                               } ,
00346 
00347    {JUN, 1,"Marilyn Monroe's birthday"                               } ,
00348    {JUN, 1,"Tunisia National Day"                                    } ,
00349    {JUN, 2,"Italy National Day"                                      } ,
00350    {JUN, 4,"Anniversary of Battle of Midway"                         } ,
00351    {JUN, 5,"John Maynard Keynes' birthday"                           } ,
00352    {JUN, 5,"Seychelles Independence Day"                             } ,
00353    {JUN, 6,"D-Day"                                                   } ,
00354    {JUN, 7,"Imre Nagy's birthday"                                    } ,
00355    {JUN, 8,"Frank Lloyd Wright's birthday"                           } ,
00356    {JUN, 9,"Anniversary of Donald Duck's debut"                      } ,
00357    {JUN,10,"Portugal National Day"                                   } ,
00358    {JUN,11,"Ben Jonson's birthday"                                   } ,
00359    {JUN,11,"John Constable's birthday"                               } ,
00360    {JUN,12,"Philippines Independence Day"                            } ,
00361    {JUN,13,"Winfield Scott's birthday"                               } ,
00362    {JUN,13,"William Butler Yeats' birthday"                          } ,
00363    {JUN,14,"Harriet Beecher Stowe's birthday"                        } ,
00364    {JUN,14,"Alois Alzheimer's birthday"                              } ,
00365    {JUN,15,"Anniversary of Magna Carta"                              } ,
00366    {JUN,15,"Anniversary of US-British 'Pig War'"                     } ,
00367    {JUN,16,"Geronimo's birthday"                                     } ,
00368    {JUN,17,"Anniversary of Battle of Bunker's Hill"                  } ,
00369    {JUN,17,"Iceland Republic Day"                                    } ,
00370    {JUN,19,"Juneteenth"                                              } ,
00371    {JUN,19,"Kuwait National Day"                                     } ,
00372    {JUN,20,"Anniversary of Oxford University"                        } ,
00373    {JUN,21,"Alexander the Great's birthday"                          } ,
00374    {JUN,22,"Anniversary of saxophone invention"                      } ,
00375    {JUN,23,"Alan Turing's birthday"                                  } ,
00376    {JUN,23,"Luxembourg Grand Duke Day"                               } ,
00377    {JUN,25,"Anniversary of Battle of the Little Big Horn"            } ,
00378    {JUN,25,"Mozambique Independence Day"                             } ,
00379    {JUN,26,"Malagasy Republic Independence Day"                      } ,
00380    {JUN,27,"Djibouti Independence Day"                               } ,
00381 
00382    {JUL, 1,"Canada Day"                                              } ,  /* WW */
00383    {JUL, 1,"Anniversary of Battle of the Somme"                      } ,
00384    {JUL, 1,"Gottfried Wilhelm Leibniz's birthday"                    } ,
00385    {JUL, 1,"Burundi Independence Day"                                } ,
00386    {JUL, 1,"Ghana Republic Day"                                      } ,
00387    {JUL, 1,"Rwanda Independence Day"                                 } ,
00388    {JUL, 1,"Somalia Independence Day"                                } ,
00389    {JUL, 2,"Anniversary of American Independence"                    } ,
00390    {JUL, 2,"Thurgood Marshall's birthday"                            } ,
00391    {JUL, 2,"Hans Bethe's birthday"                                   } ,
00392    {JUL, 3,"Franz Kafka's birthday"                                  } ,
00393    {JUL, 4,"Anniversary of Declaration of Independence"              } ,
00394    {JUL, 4,"Anniversary of Vickburg's surrender"                     } ,
00395    {JUL, 4,"Rube Goldberg's birthday"                                } ,
00396    {JUL, 5,"Anniversary of Newton's Principia"                       } ,
00397    {JUL, 5,"Anniversary of introduction of bikini"                   } ,
00398    {JUL, 5,"Venezuela Independence Day"                              } ,
00399    {JUL, 6,"Malawi Independence Day"                                 } ,
00400    {JUL, 7,"Satchel Paige's birthday"                                } ,
00401    {JUL, 7,"Robert Heinlein's birthday"                              } ,
00402    {JUL, 9,"Argentina Independence Day"                              } ,
00403    {JUL, 9,"Palau Constitution Day"                                  } ,
00404    {JUL,10,"Bahamas Independence Day"                                } ,
00405    {JUL,11,"Mongolia Revolution Day"                                 } ,
00406    {JUL,12,"Sao Tome & Principe Independence Day"                    } ,
00407    {JUL,13,"Gaius Julius Caesar's birthday"                          } ,
00408    {JUL,14,"Bastille Day"                                            } ,
00409    {JUL,14,"Iraq Republic Day"                                       } ,
00410    {JUL,14,"Gerald Ford's birthday"                                  } ,
00411    {JUL,15,"Anniversary of Battle of Grunwald"                       } ,
00412    {JUL,16,"Anniversary of 1st atomic explosion"                     } ,
00413    {JUL,16,"Anniversary of Apollo 11's launch"                       } ,
00414    {JUL,17,"Anniversary of Disneyland's opening"                     } ,
00415    {JUL,17,"South Korea Constitution Day"                            } ,
00416    {JUL,18,"John Glenn's birthday"                                   } ,
00417    {JUL,18,"Nelson Mandela's birthday"                               } ,
00418    {JUL,18,"Spain National Day"                                      } ,
00419    {JUL,19,"George McGovern's birthday"                              } ,
00420    {JUL,19,"Edgar Degas' birthday"                                   } ,
00421    {JUL,20,"Anniversary of Apollo 11 Moon landing"                   } ,
00422    {JUL,20,"Edmund Hillary's birthday"                               } ,
00423    {JUL,20,"Columbia Independence Day"                               } ,
00424    {JUL,21,"Belgium Independence Day"                                } ,
00425    {JUL,21,"Martyr's Day in Bolivia"                                 } ,
00426    {JUL,22,"Friedrich Bessel's birthday"                             } ,
00427    {JUL,22,"Gregor Mendel's birthday"                                } ,
00428    {JUL,23,"Raymond Chandler's birthday"                             } ,
00429    {JUL,23,"Egypt National Day"                                      } ,
00430    {JUL,24,"Simon Bolivar's birthday"                                } ,
00431    {JUL,24,"Anniversary of Apollo 11's return to Earth"              } ,
00432    {JUL,24,"Amelia Earhart's birthday"                               } ,
00433    {JUL,25,"Arthur Balfour's birthday"                               } ,
00434    {JUL,26,"Maldives Independence Day"                               } ,
00435    {JUL,26,"George Bernard Shaw's birthday"                          } ,
00436    {JUL,28,"Gerard Manley Hopkin's birthday"                         } ,
00437    {JUL,28,"Peru Independence Day"                                   } ,
00438    {JUL,29,"Alexis de Tocqueville's birthday"                        } ,
00439    {JUL,29,"Sigmund Romberg's birthday"                              } ,
00440    {JUL,30,"Anniversary of Amistad uprising"                         } ,
00441    {JUL,30,"Vanuatu Independence Day"                                } ,
00442    {JUL,30,"Arnold Schwarzenegger's birthday"                        } ,
00443    {JUL,31,"Anniversary of Battle of Passchendaele"                  } ,
00444    {JUL,31,"Primo Levi's birthday"                                   } ,
00445    {JUL,31,"Joanne Kathleen Rowling's birthday"                      } ,
00446 
00447    {AUG, 1,"Anniversary of Warsaw Uprising"                          } ,
00448    {AUG, 1,"Dahomey Independence Day"                                } ,
00449    {AUG, 1,"Switzerland Confederation Day"                           } ,
00450    {AUG, 1,"Jerry Garcia's birthday"                                 } ,
00451    {AUG, 2,"Anniversary of Battle of Cannae"                         } ,
00452    {AUG, 4,"Percy Bysshe Shelley's birthday"                         } ,
00453    {AUG, 5,"Upper Volta Independence Day"                            } ,
00454    {AUG, 5,"Neil Armstrong's birthday"                               } ,
00455    {AUG, 6,"Bolivia Independence Day"                                } ,
00456    {AUG, 6,"Alexander Fleming's birthday"                            } ,
00457    {AUG, 7,"Ivory Coast Independence Day"                            } ,
00458    {AUG, 8,"P A M Dirac's birthday"                                  } ,
00459    {AUG, 9,"Anniversary of Richard Nixon's resignation"              } ,
00460    {AUG, 9,"Singapore National Day"                                  } ,
00461    {AUG,10,"Ecuador Independence Day"                                } ,
00462    {AUG,11,"Anniversary of Alcatraz Prison"                          } ,
00463    {AUG,11,"Anniversary of Battle of Thermopylae"                    } ,
00464    {AUG,12,"Erwin Schrodinger's birthday"                            } ,
00465    {AUG,14,"Pakistan Independence Day"                               } ,
00466    {AUG,15,"Napoleon's birthday"                                     } ,
00467    {AUG,15,"India Independence Day"                                  } ,
00468    {AUG,16,"Cyprus Independence Day"                                 } ,
00469    {AUG,17,"Pierre de Fermat's birthday"                             } ,
00470    {AUG,17,"Gabon Independence Day"                                  } ,
00471    {AUG,17,"Indonesia Independence Day"                              } ,
00472    {AUG,18,"Afghanistan Independence Day"                            } ,
00473    {AUG,19,"Gene Roddenberry's birthday"                             } ,
00474    {AUG,20,"Waclaw Sierpinski's birthday"                            } ,
00475    {AUG,22,"Anniversary of Battle of Bosworth Field"                 } ,
00476    {AUG,23,"Rumania Liberation Day"                                  } ,
00477    {AUG,23,"Gene Kelley's birthday"                                  } ,
00478    {AUG,24,"William Wilberforce's birthday"                          } ,
00479    {AUG,25,"Uruguay Independence Day"                                } ,
00480    {AUG,26,"Anniversary of 19th Amendment's adoption"                } ,
00481    {AUG,27,"Confucius' birthday"                                     } ,
00482    {AUG,27,"Charles Gates Dawes' birthday"                           } ,
00483    {AUG,30,"Olga Taussky-Todd's birthday"                            } ,
00484    {AUG,31,"Anniversary of Solidarity's creation"                    } ,
00485    {AUG,31,"Trinidad & Tobago Independence Day"                      } ,
00486 
00487    {SEP, 1,"Anniversary of Nazi invasion of Poland"                  } ,
00488    {SEP, 2,"VJ Day"                                                  } ,
00489    {SEP, 2,"Queen Liliuokalani's birthday"                           } ,
00490    {SEP, 3,"Qatar Independence Day"                                  } ,
00491    {SEP, 3,"San Marino Anniversary of Founding"                      } ,
00492    {SEP, 3,"Anniversary of Treaty of Paris, 1783"                    } ,
00493    {SEP, 6,"Swaziland Independence Day"                              } ,
00494    {SEP, 7,"Queen Elizabeth I's birthday"                            } ,
00495    {SEP, 7,"Brazil Independence Day"                                 } ,
00496    {SEP, 7,"Sinclair Lewis's birthday"                               } ,
00497    {SEP, 7,"Buddy Holly's birthday"                                  } ,
00498    {SEP, 7,"Anniversary of Battle of Borodino"                       } ,
00499    {SEP, 7,"Luigi Galvani's birthday"                                } ,
00500    {SEP, 8,"Anniversary of Star Trek TV debut"                       } ,
00501    {SEP, 8,"Andorra National Festival"                               } ,
00502    {SEP, 9,"Bulgaria Liberation Day"                                 } ,
00503    {SEP,12,"Anniversary of Battle of Vienna"                         } ,
00504    {SEP,14,"Jan Masaryk's birthday"                                  } ,
00505    {SEP,15,"Costa Rica Independence Day"                             } ,
00506    {SEP,15,"El Salvador Independence Day"                            } ,
00507    {SEP,15,"Guatemala Independence Day"                              } ,
00508    {SEP,15,"Honduras Independence Day"                               } ,
00509    {SEP,15,"Nicaragua Independence Day"                              } ,
00510    {SEP,16,"Malaysia Independence Day"                               } ,
00511    {SEP,16,"Papua New Guinea Independence Day"                       } ,
00512    {SEP,17,"Anniversary of signing of American Constitution"         } ,
00513    {SEP,17,"Georg Bernhard Riemann's birthday"                       } ,
00514    {SEP,17,"Anniversary of Battle of Antietam"                       } ,
00515    {SEP,17,"Anniversary of Soviet invasion of Poland"                } ,
00516    {SEP,18,"Mexico Independence Day"                                 } ,
00517    {SEP,19,"Anniversary of Battle of Saratoga"                       } ,
00518    {SEP,20,"Anniversary of Battle of Chalons"                        } ,
00519    {SEP,21,"Chile Independence Day"                                  } ,
00520    {SEP,21,"Belize Independence Day"                                 } ,
00521    {SEP,21,"Malta Independence Day"                                  } ,
00522    {SEP,22,"Bilbo & Frodo Baggin's birthday"                         } ,
00523    {SEP,22,"Mali Republic Day"                                       } ,
00524    {SEP,23,"Saudi Arabia National Day"                               } ,
00525    {SEP,23,"Emperor Augustus Caesar's birthday"                      } ,
00526    {SEP,26,"Yemen National Day"                                      } ,
00527    {SEP,27,"Anniversary of founding of Jesuit Order"                 } ,
00528    {SEP,29,"Lech Walesa's birthday"                                  } ,
00529    {SEP,30,"Botswana Independence Day"                               } ,
00530 
00531    {OCT, 1,"Nigeria Independence Day"                                } ,
00532    {OCT, 2,"Guinea Independence Day"                                 } ,
00533    {OCT, 2,"Anniversary of Saladin's capture of Jerusalem"           } ,
00534    {OCT, 2,"Groucho Marx's birthday"                                 } ,
00535    {OCT, 3,"Anniversary of reunification of Germany"                 } ,
00536    {OCT, 6,"Anniversary of attack on Frodo at Weathertop"            } ,
00537    {OCT, 9,"Alfred Dreyfus's birthday"                               } ,
00538    {OCT,10,"Anniversary of Battle of Tours"                          } ,
00539    {OCT,12,"Columbus Day"                                            } ,
00540    {OCT,14,"Dwight Eisenhower's birthday"                            } ,
00541    {OCT,15,"Pelham Grenville Wodehouse's birthday"                   } ,
00542    {OCT,16,"National Boss Day"                                       } ,
00543    {OCT,19,"Anniversary of Cornwallis' surrender at Yorktown"        } ,
00544    {OCT,21,"Anniversary of Battle of Trafalgar"                      } ,
00545    {OCT,24,"Anniversary of founding of United Nations"               } ,
00546    {OCT,24,"Zambia Independence Day"                                 } ,
00547    {OCT,25,"Saint Crispin's (or Crispian's) Day"                     } ,
00548    {OCT,25,"Evariste Galois' birthday"                               } ,
00549    {OCT,26,"Anniversary of Gunfight at the OK Corral"                } ,
00550    {OCT,27,"Theodore Roosevelt's birthday"                           } ,
00551    {OCT,27,"John Cleese's birthday"                                  } ,
00552    {OCT,28,"Anniversary of Battle of Milvian Bridge"                 } ,
00553    {OCT,29,"Turkey Republic Day"                                     } ,
00554    {OCT,29,"Anniversary of Black Tuesday"                            } ,
00555    {OCT,30,"Anniversary of the War of the Worlds!"                   } ,
00556    {OCT,31,"Halloween"                                               } ,
00557    {OCT,31,"John Keats' birthday"                                    } ,
00558    {OCT,31,"Karl Weierstrass's birthday"                             } ,
00559 
00560    {NOV, 1,"All Saint's Day"                                         } ,  /* WW */
00561    {NOV, 1,"Anniversary of Great Lisbon Earthquake"                  } ,
00562    {NOV, 2,"Marie Antoinette's birthday"                             } ,
00563    {NOV, 2,"Anniversary of Balfour Declaration"                      } ,
00564    {NOV, 2,"Daniel Boone's birthday"                                 } ,
00565    {NOV, 3,"Panama Independence Day"                                 } ,
00566    {NOV, 3,"Dominica Independence Day"                               } ,
00567    {NOV, 4,"Art Carney's birthday"                                   } ,
00568    {NOV, 5,"Guy Fawkes Day"                                          } ,
00569    {NOV, 5,"National Donut Day!"                                     } ,
00570    {NOV, 6,"John Philip Sousa's birthday"                            } ,
00571    {NOV, 6,"Dominican Republic Constitution Day"                     } ,
00572    {NOV, 7,"Maria Sklodowska Curie's birthday"                       } ,
00573    {NOV, 7,"Lise Meitner's birthday"                                 } ,
00574    {NOV, 8,"Anniversary of discovery of X-rays"                      } ,
00575    {NOV, 8,"Anniversary of Louvre museum opening"                    } ,
00576    {NOV, 8,"Edmond Halley's birthday"                                } ,
00577    {NOV, 8,"Bram Stoker's birthday"                                  } ,
00578    {NOV, 8,"Felix Haussdorf's birthday"                              } ,
00579    {NOV, 8,"Katherine Hepburn's birthday"                            } ,
00580    {NOV, 9,"Benjamin Banneker's birthday"                            } ,
00581    {NOV, 9,"Cambodia Independence Day"                               } ,
00582    {NOV,10,"Martin Luther's birthday"                                } ,
00583    {NOV,11,"Veteran's & Remembrance Day"                             } ,
00584    {NOV,11,"Poland Independence Day"                                 } ,
00585    {NOV,12,"Sun Yat Sen's birthday"                                  } ,
00586    {NOV,12,"Elizabeth Cady Stanton's birthday"                       } ,
00587    {NOV,12,"Auguste Rodin's birthday"                                } ,
00588    {NOV,12,"Comoros Independence Day"                                } ,
00589    {NOV,13,"Saint Augustine's birthday"                              } ,
00590    {NOV,13,"James Clerk Maxwell's birthday"                          } ,
00591    {NOV,13,"Robert Louis Stevenson's birthday"                       } ,
00592    {NOV,14,"Claude Monet's birthday"                                 } ,
00593    {NOV,16,"James Bonds' birthday"                                   } ,
00594    {NOV,16,"d'Alembert's birthday"                                   } ,
00595    {NOV,17,"Korbinian Brodmann's birthday"                           } ,
00596    {NOV,18,"Ignacy Paderewski's birthday"                            } ,
00597    {NOV,19,"Anniversary of Gettysburg Address"                       } ,
00598    {NOV,19,"Monaco National Fete"                                    } ,
00599    {NOV,20,"Edwin Hubble's birthday"                                 } ,
00600    {NOV,21,"Francois-Marie Arouet's birthday"                        } ,
00601    {NOV,22,"Anniversary of Kennedy's assasination"                   } ,
00602    {NOV,22,"Lebanon Independence Day"                                } ,
00603    {NOV,22,"Charles de Gaulle's birthday"                            } ,
00604    {NOV,23,"Anniversary of Dr Who's debut"                           } ,
00605    {NOV,23,"Billy the Kid's birthday"                                } ,
00606    {NOV,23,"Boris Karloff's birthday"                                } ,
00607    {NOV,23,"Harpo Marx's birthday"                                   } ,
00608    {NOV,24,"Baruch Spinoza's birthday"                               } ,
00609    {NOV,24,"Anniversary of Tasmania's discovery"                     } ,
00610    {NOV,24,"Anniversary of Darwin's The Origin of Species"           } ,
00611    {NOV,25,"Pope John XXIII's birthday"                              } ,
00612    {NOV,25,"Joe DiMaggio's birthday"                                 } ,
00613    {NOV,25,"Suriname Independence Day"                               } ,
00614    {NOV,26,"Anniversary of Casablanca's debut"                       } ,
00615    {NOV,26,"Norbert Wiener's birthday"                               } ,
00616    {NOV,26,"National Cake Day"                                       } ,
00617    {NOV,27,"Anniversary of First Crusade's start"                    } ,
00618    {NOV,27,"Chaim Weizmann's birthday"                               } ,
00619    {NOV,27,"Aleksander Dubcek's birthday"                            } ,
00620    {NOV,28,"Mauritania Independence Day"                             } ,
00621    {NOV,29,"Clive Staples Lewis's birthday"                          } ,
00622    {NOV,29,"Jacques Chirac's birthday"                               } ,
00623    {NOV,30,"Samuel Clemens' birthday"                                } ,
00624    {NOV,30,"Winston Churchill's birthday"                            } ,
00625    {NOV,30,"Barbados Independence Day"                               } ,
00626    {NOV,30,"Saint Andrew's Day"                                      } ,
00627    {NOV,30,"Barbados Independence Day"                               } ,
00628 
00629    {DEC, 1,"Anniversary of Rosa Parks' arrest"                       } ,  /* WW */
00630    {DEC, 1,"Woody Allen's birthday"                                  } ,
00631    {DEC, 1,"National Pie Day"                                        } ,
00632    {DEC, 1,"Central African Republic National Day"                   } ,
00633    {DEC, 2,"Anniversary of Monroe Doctrine"                          } ,
00634    {DEC, 2,"Georges Seurat's birthday"                               } ,
00635    {DEC, 2,"Anniversary of Napoleon's coronation"                    } ,
00636    {DEC, 2,"Anniversary of Battle of Austerlitz"                     } ,
00637    {DEC, 3,"Joseph Konrad's birthday"                                } ,
00638    {DEC, 3,"Anniversary of Galileo's telescope"                      } ,
00639    {DEC, 4,"Crazy Horse's birthday"                                  } ,
00640    {DEC, 4,"National Cookie Day"                                     } ,
00641    {DEC, 5,"Anniversary of Prohibition's end"                        } ,
00642    {DEC, 5,"George Armstrong Custer's birthday"                      } ,
00643    {DEC, 5,"Werner Karl Heisenberg's birthday"                       } ,
00644    {DEC, 6,"Spanish Constitution Day"                                } ,
00645    {DEC, 6,"Finland Independence Day"                                } ,
00646    {DEC, 7,"Anniversary of Battle of Pearl Harbor"                   } ,
00647    {DEC, 7,"Ivory Coast National Day"                                } ,
00648    {DEC, 8,"Jacques Hadamard's birthday"                             } ,
00649    {DEC, 8,"Jim Morrison's birthday"                                 } ,
00650    {DEC, 8,"Anniversary of Syllabus Errorum"                         } ,
00651    {DEC, 8,"Anniversary of US Declaration of War on Japan"           } ,
00652    {DEC, 9,"John Milton's birthday"                                  } ,
00653    {DEC, 9,"Anniversary of Lech Walesa's election"                   } ,
00654    {DEC, 9,"Tanzania Independence Day"                               } ,
00655    {DEC,10,"Ada Lovelace's birthday"                                 } ,
00656    {DEC,10,"Anniversary of Spanish-American War's end"               } ,
00657    {DEC,10,"Anniversary of Grateful Dead's first concert"            } ,
00658    {DEC,10,"Emily Dickinson's birthday"                              } ,
00659    {DEC,10,"Anniversary of Female Suffrage in Wyoming"               } ,
00660    {DEC,11,"Robert Koch's birthday"                                  } ,
00661    {DEC,11,"Upper Volta Republic Day"                                } ,
00662    {DEC,11,"Aleksander Solzhenitsyn's birthday"                      } ,
00663    {DEC,11,"Max Born's birthday"                                     } ,
00664    {DEC,12,"Frank Sinatra's birthday"                                } ,
00665    {DEC,12,"Kenya Independence Day"                                  } ,
00666    {DEC,12,"William Lloyd Garrison's birthday"                       } ,
00667    {DEC,12,"Edvard Munch's birthday"                                 } ,
00668    {DEC,13,"Werner von Siemens's birthday"                           } ,
00669    {DEC,14,"Tycho Brahe's birthday"                                  } ,
00670    {DEC,14,"Nostradamus's birthday"                                  } ,
00671    {DEC,14,"Jimmy Doolittle's birthday"                              } ,
00672    {DEC,15,"Anniversary of adoption of US Bill of Rights"            } ,
00673    {DEC,15,"Anniversary of Gone With the Wind debut"                 } ,
00674    {DEC,16,"Anniversary of Boston Tea Party"                         } ,
00675    {DEC,16,"Jane Austen's birthday"                                  } ,
00676    {DEC,16,"Beethoven's birthday"                                    } ,
00677    {DEC,16,"Arthur C Clarke's birthday"                              } ,
00678    {DEC,17,"Anniversary of Wright brother's flight"                  } ,
00679    {DEC,17,"Roman Saturnalia!"                                       } ,
00680    {DEC,18,"Anniversary of 13 Amendment's adoption"                  } ,
00681    {DEC,18,"Niger Independence Day"                                  } ,
00682    {DEC,19,"William Pitt's (the younger) birthday"                   } ,
00683    {DEC,20,"Robert Menzies' birthday"                                } ,
00684    {DEC,20,"Anniversary of Louisiana Purchase"                       } ,
00685    {DEC,21,"Anniversary of Pilgrim's landing"                        } ,
00686    {DEC,21,"Thomas Becket's birthday"                                } ,
00687    {DEC,21,"Jan Lukasiewicz' birthday"                               } ,
00688    {DEC,21,"Nepal Independence Day"                                  } ,
00689    {DEC,22,"Srinivasa Ramanujan's birthday"                          } ,
00690    {DEC,23,"Emperoro Akihito's birthday"                             } ,
00691    {DEC,24,"Adam Mickiewicz's birthday"                              } ,
00692    {DEC,24,"Ignatius Loyola's birthday"                              } ,
00693    {DEC,24,"Kit Carson's birthday"                                   } ,
00694    {DEC,24,"Christmas Eve"                                           } ,
00695    {DEC,25,"Christmas Day"                                           } ,
00696    {DEC,25,"Sir Isaac Newton's birthday"                             } ,
00697    {DEC,25,"Clara Barton's birthday"                                 } ,
00698    {DEC,25,"Rod Serling's birthday"                                  } ,
00699    {DEC,25,"Anwar Sadat's birthday"                                  } ,
00700    {DEC,25,"Anniversary of Washingon's crossing the Delaware"        } ,
00701    {DEC,26,"Charles Babbage's birthday"                              } ,
00702    {DEC,26,"Boxing Day"                                              } ,
00703    {DEC,27,"Johannes Kepler's birthday"                              } ,
00704    {DEC,27,"Louis Pasteur's birthday"                                } ,
00705    {DEC,28,"Arthur Eddington's birthday"                             } ,
00706    {DEC,28,"John von Neumann's birthday"                             } ,
00707    {DEC,28,"Linus Torvalds' birthday"                                } ,
00708    {DEC,29,"William Gladstone's birthday"                            } ,
00709    {DEC,30,"Tiger Woods' birthday"                                   } ,
00710    {DEC,30,"Rudyard Kipling's birthday"                              } ,
00711    {DEC,31,"New Year's Eve"                                          } ,
00712    {DEC,31,"George Marshall's birthday"                              } ,
00713 
00714  {0,0,NULL} } ;  /* the last element, a flag to stop searching */
00715 
00716 /*------------------------------------------------------------------------------*/
00717 /*! Return today's date trivia string. */
00718 
00719 char * AFNI_get_date_trivia(void)
00720 {
00721    time_t tt ;
00722    struct tm *lt ;
00723    int ii , ntar ;
00724    char *tar[NTMAX] ;
00725 
00726    tt = time(NULL) ;         /* seconds since 01 Jan 1970 */
00727    lt = localtime( &tt ) ;   /* break into pieces */
00728 
00729    /**** find this month and day in the trivia list, if present ****/
00730 
00731    for( ii=ntar=0 ; ntar < NTMAX && holiday[ii].day != 0 ; ii++ )
00732      if( holiday[ii].mon == lt->tm_mon+1 && holiday[ii].day == lt->tm_mday )
00733        tar[ntar++] = holiday[ii].label ;
00734 
00735    /**** Special days not on fixed dates ****/
00736 
00737    /* Day of month = 13 and weekday = Friday */
00738 
00739    if( ntar < NTMAX && lt->tm_mday == 13 && lt->tm_wday == 5 )
00740       tar[ntar++] = "Friday the 13th" ;
00741 
00742    /* 1st Monday in September */
00743 
00744    if( ntar < NTMAX && lt->tm_mon+1 == SEP && lt->tm_wday == 1 && lt->tm_mday <= 7 )
00745       tar[ntar++] = "Labor Day (USA)" ;
00746 
00747    /* 4th Thursday in November */
00748 
00749    if( ntar < NTMAX && lt->tm_mon+1 == NOV && lt->tm_wday == 4 &&
00750                        lt->tm_mday <= 28 && lt->tm_mday >= 22 )
00751       tar[ntar++] = "Thanksgiving (USA)" ;
00752 
00753    /* 1st Monday in October */
00754 
00755    if( ntar < NTMAX && lt->tm_mon+1 == OCT && lt->tm_wday == 1 && lt->tm_mday <= 7 )
00756       tar[ntar++] = "Opening of Supreme Court (USA)" ;
00757 
00758    /* 1st Tuesday after 1st Monday in November */
00759 
00760    if( ntar < NTMAX && lt->tm_mon+1 == NOV && lt->tm_wday == 2 &&
00761                        lt->tm_mday >= 2 && lt->tm_mday <= 8 )
00762       tar[ntar++] = "Election Day (USA)" ;
00763 
00764    /**** select which one to return ***/
00765 
00766    if( ntar == 1 ){
00767      return tar[0] ;
00768    } else if( ntar > 1 ){
00769      static int iold=-1 ;
00770      ii = (lrand48()>>8) % ntar ;
00771      if( ii == iold ) ii = (ii+1)%ntar ;
00772      iold = ii ; return tar[ii] ;
00773    }
00774 
00775    /* default trivia */
00776 
00777    return "[Elen sila lumenn' omentielvo]" ;
00778 }
 

Powered by Plone

This site conforms to the following standards: