Leap Day is a Big Hack

Our Earth makes a complete revolution around the sun every 31,556,956 seconds. This means a year is truly 365 days, 5 hours, 49 minutes and 16 seconds. However, the average of the true solar day is 86,400 seconds, or 24 hours. The length of the solar day also has variation depending on the orbital motion of the Earth, but the average is 86,400 seconds. When you do the math and divide 31,556,969 by 86,400, you end up with some left over time, which is what causes Leap Year. Leap Year was created to maintain our seasonal calendar and prevent seasons from drifting, for example, Winter in July. Leap Year takes the remainder 5 hours, 49 minutes and 16 seconds, rounds it to 6 hours, accumulates it, and every 4 years, the 24 hours of accumulated time is tacked onto the end of February, Leap Day, Feb 29th.

Now if you were paying attention, you caught that we cheated a little and we rounded the 5 hours, 49 minutes and 16 seconds up to 6 hours. What happens to the leftover 10 minutes and 44 seconds?

Leap Year Misunderstood

A common misconception is that Leap Year occurs every 4 years. For most of us reading this, we can go on believing that Leap Year occurs every 4 years because that’s how we’ll see it for the rest of our lives. However, for those that make it to 2100, you won’t see a Leap Year in 2100, even though 2100 is divisible by 4. Why? Every 134 years, the left over 10 minutes 44 seconds accumulates into a full day. To account for that, only years that are divisible by 4 and not divisible by 100 is a Leap Year. 2100 will not be a Leap Year.

If you look back at the 2000 calendar, there was a February 29th. Two thousand is divisible 4 and 100, therefore it shouldn’t have been a Leap Year. What’s going on? Well, we have another math problem. Every 134 years that leftover time makes a full day, but we compensate every 100 years, so we end up with a 34 year deficit that gets handled by another rule. This rule states that if the year is divisible by 4 and 400, ignore the previous rule and add a Leap Day. Now if you are still tracking with me, you may be thinking that this math doesn’t solve the problem and there still seems to be some time left over after all of those hacks and adjustments. If you are thinking this, you are correct.

The purpose of Leap Year is to keep seasons lined up with our calendar. Keeping the vernal equinox on or close to March 21st is the objective. This Superman III, Salami Slicing means that in 8,000 years, the calendar will be one day behind. There have been suggestions to help with this too. Some think that by the time this occurs, the length of the vernal equinox will have changed. Unfortunately, the Cone of Uncertainty is at play and this far out the change to the vernal equinox cannot be accurately predicted. As a result, the current series of Leap Day hacks will have to do. Others like John Herschel have suggested that we need another hack in the algorithm that would make the year 4000 a non-Leap Year. Who knows what this will look like by year 4000. By then I will long be forgotten, the Earth might not even exist and this Leap Year hack won’t concern me. However, if you’re a software developer like me, here’s a chunk of C# code to help you determine if a given year is a Leap Year.

bool IsLeapYear(int year)
{
   return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0));
}

All of that Leap Day history is interesting and it’s interesting to know that something as central as our calendar has a big hack like Leap Day. But I now have a practical Leap Day question for you and it’s likely more important than this useless trivia.

What do you have planned for Leap Day 2012?

Leap Day 2012 is shaping up to be a day of announcements and product releases from Microsoft. My plan for Leap Day includes downloading and installing the Windows 8 Consumer Preview, Visual Studio 11 Beta, taking a certification exam, tuning in to hear announcements from Mobile World Congress and following the MVP Summit 2012 buzz on twitter. The following is the list of the Leap Day 2012 items that I’ll be paying attention to with links for more information and downloads.

Mobile World Congress – Windows 8 & Windows Phone Announcements
http://www.mobileworldlive.com
http://www.mobileworldcongress.com

Windows 8 Consumer Preview
http://msdn.microsoft.com/en-US/windows
http://windows.microsoft.com/en-US/windows-8/preview
http://blogs.msdn.com/b/b8/
http://blogs.msdn.com/b/windowsstore/
http://www.buildwindows.com/

Visual Studio 11 Beta
http://www.microsoft.com/visualstudio/
http://blogs.msdn.com/b/visualstudio/

MVP Summit 2012
https://twitter.com/#!/search/mvp12

What’s on your list for Leap Day 2012?

Cloud Connect Follow-up

Thank you to all who attended my “Applications at Scale” session at Cloud Connect!

In the session, I introduced a number of application scalability concepts. Those concepts map really well to cloud computing and scalable public cloud platforms like Windows Azure. The following are links to additional resources on architecting and developing scalable applications. If you know of other great resources, feel free to comment and add them to the discussion on this post.

High Scalability web site
Eric Brewer’s Principles of Distributed Computing Keynote
Julian Browne’s article on Brewer’s CAP Theorem
Werner Vogels article on Eventual Consistentcy

If you need to build applications that can scale up or down on-demand, while serving users globally regardless of device or platform, Windows Azure is worth checking out. Here are some useful links to get you started.

First, you need the Windows Azure SDK and Tools to get started developing applications for Windows Azure. The SDK includes an emulator for Windows Azure compute and storage. This will enable you to develop on your machine without having to deploy to the cloud. This capability reduces your development time and cost associated with deploying to Windows Azure for development.
Azure SDK Download

At some point, you will want to deploy your application to the Windows Azure cloud and there are a couple of ways to get development time and resources for Windows Azure. If you are an MSDN subscriber, you can get up to $3,700 a year in free Windows Azure resources. For more information, check out MSDN Windows Azure Benefits. If you don’t have an MSDN subscription, you can get a free 90-day trial at FREE 90-day Windows Azure Trial.

The Windows Azure Training Kit is loaded with helpful presentations, demos and hands-on labs for working with Windows Azure.
Get the Windows Azure Training Kit

In addition, I’ve got lots of great resources and tips for you on developing for
Windows Azure. Visit my Toolbox page to find out more.
More Windows Azure Resources

If you’d like personalized, one-on-one guidance or consulting, Centare helps organizations move to and take advantage of the cloud. To learn more about Centare and how we help customers with software development and cloud computing. Check out Centare’s Cloud Services.

Recap of Iowa User Group Tour

Last Monday morning, I had coffee in Wisconsin with my buddy, and our local Microsoft Web Evangelist, Clark Sell. Clark and I had a good chat, and then I got on the road and headed toward Cedar Rapids, IA. At some point early in this trip, I realized that the Oak Brook Microsoft Store was on my route. So once in Oak Brook, I made a quick detour to pre-order the new Nokia Lumia 900 Windows Phone and then got back on my original journey. Unfortunately, I saw this post over the weekend which basically says if you didn’t get in on the pre-order early like I did, you aren’t going to get in on the Lumia 900 pre-order.

After about 5 hours in the car, I arrived in Cedar Rapids at Kirkwood Community College where the Cedar Rapids .NET User Group meets. The CRineta group was very welcoming, hospitable and interactive. After the meeting, we went out to a local sports bar and continued the conversation. On Tuesday evening, I presented to the Dubuque .NET Users Group. dbqINETA is a small group, but like CRineta they are also a fun and interactive group. Unfortunately, I couldn’t visit the Cedar Valley .NET Usergroup on Wednesday, but I hope to visit them sometime down the road. At both Iowa groups, I presented “Moving Web Apps to the Cloud”. During our time together, we walked through moving a traditional ASP.NET web application to Windows Azure. We worked through transitioning the typical on-premise dependencies like Windows Server, Active Directory and SQL Server to Windows Azure with new techniques and tools like Claims-based Identity, WIF, ADFS, Windows Azure Compute & Storage, and SQL Azure.

One interesting observation is that the overwhelming majority of the attendees had MSDN subscriptions, however, very few had a Windows Azure account. If you have an MSDN subscription and you are interested in developing apps in Windows Azure, MSDN provides you a great amount of Windows Azure resources as a benefit with your MSDN subscription. Every month you get a specified amount of Windows Azure resources, and it’s use it or lose it. So take advantage of your MSDN subscriptions and activate your Windows Azure account. In December, a new Windows Azure Spending Limit feature was released that makes it impossible to accidentally incur overage charges. The way it works is once you reach your allowed usage, instead of charging you for additional usage, Windows Azure will just turn off your service to prevent overage charges. This makes it completely risk free to try as a developer.

CRineta and dbqINETA, thank you for having me and I hope to see you again.

The following is a list of resources that were mentioned, as well as the presentation.

SQL Azure Migration Wizard
http://sqlazuremw.codeplex.com

Patterns & Practices Windows Azure Guidance
http://msdn.microsoft.com/en-us/library/ff898430.aspx

Leaving for Silicon Valley and Cloud Connect

This afternoon I’ll be leaving the Midwest and headed to Silicon Valley for Cloud Connect Santa Clara. Cloud Connect’s goal is to chart the course of cloud computing’s development by bringing together enterprise IT professionals, developers, infrastructure and service providers and cloud computing innovators. Cloud Connect is a one-of-a-kind event that encompasses the entire cloud computing ecosystem featuring a Launch Pad program, IT & Developer workshops and a full conference program.

On Thursday, I’m presenting “Applications at Scale” with Dan Bartow from SOASTA and Dave Roberts from ServiceMesh. In one hour, we will walk through the lifecycle of internet scale applications from architecture and development, to performance testing, to governance. I will be focusing on the architecture and development of internet scale applications and design patterns for scaling data using cloud platforms.

The Cloud Connect conference schedule is incredible starting with an Introduction to Cloud PaaS Architecture on Monday morning with Marc Mercuri and Mark Kottke, Three Patterns for Cloud Use in Your Organization with Brian Prince on Tuesday afternoon, and a ton of other great sessions and speakers throughout the week.

If you are going to Cloud Connect too, I hope to see you there.

Iowa User Group Tour Starts Now

In just a few minutes, I’ll be leaving home and beginning my journey to Iowa for an Iowa User Group tour. Tonight and tomorrow night I’ll be presenting “Moving Web Apps to the Cloud” at the Cedar Rapids .NET Users Group (CRineta) and Dubuque .NET User Group (dbqINETA). If you have been reluctant to take advantage of the Cloud because of fear of the unknown and having to learn another development platform, yet again, come out and learn how your .NET skills translate to developing for Windows Azure. For more information and to register, check out the following web sites.

Monday, February 6th, 2012 @ 5:30 PM
Cedar Rapids .NET Users Group (CRineta)
crineta.org
Kirkwood Community College
6301 Kirkwood Blvd SW Cedar Rapids, IA 52404-5299

Tuesday, February 7th, 2012 @ 5:30 PM
Dubuque .NET Users Group (dbqINETA)
dbqineta.com
Clarke University – Keller Computer Center
1550 Clarke Drive Dubuque, IA 52001-3198