Friday, 29 February 2008 18:29 by
persona
The day started with me having a conversation with a friend about how they celebrated a co-worker's "eleventh" birthday, his co-worker saying he'd be 12 except that there was no February 29th in 2000.
For someone born on February 29th, he knows surprisingly little about leap years. But the statement did make me double-check the code I was writing at work for a calendar control.
For those of you who are wondering, the way to determine a leap year is as follows:
- Is the year is divisible by 400? Then it's a leap year.
- Is the year divisible by 100 (but not 400)? It's not a leap year.
- Is the year divisible by 4 (but not 100)? It's a leap year.
Or simply stated:
bool IsLeapYear(int year)
{
return ((year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)));
}
(Yes, I first wrote more verbose code of nested IF statements, then reworked it to take in order of logical expressions to reduce it to one line)
On a side note:
I didn't realize there were also Leap Year traditions. For instance, "in the English speaking world, it is a tradition that women may propose marriage only on leap years." "The first documentation of this practice dates back to 1288, when Scotland passed a law that allowed women to propose marriage to the man of their choice in that year. They also made it law that any man who declined a proposal in a leap year must pay a fine. The fine could range from a kiss to payment for a silk dress or a pair of gloves." - [about.com]. Does that mean it's time to go get me some silk dresses?
4d5ea5c0-1f25-457c-92eb-765e22d409a3|0|.0
Thursday, 14 February 2008 22:27 by
persona
... if you attend a live concert and think the band's instruments look abnormally large.
:-D
On a side note, heard the band Metro Station (for the first time, and live) at a concert hosted by an alternative radio station, and I have to say that they're *fantabulous*. Their style is "Electronica, Powerpop, Pop" -- reminded me of the good part of the 80's, Blink 182, Weezer, and the Yeah Yeah Yeahs, and they got people dancing. The demos they have on-line don't do them justice. Keep an eye out for them, and catch 'em live if you get a chance!
88de7267-5c40-4a60-b2f3-bad908783372|0|.0
Wednesday, 6 February 2008 12:51 by
persona
6d3d8963-c65b-48ed-b17c-124710b48e09|0|.0