One Day of VS 2012 & Windows 8 with .NET Rocks!

Get ready to dive in and immerse yourself deep in Visual Studio 2012 and Windows 8! .NET Rocks is traveling across the country teaching developers how to use Microsoft’s new development tools and will be in Palatine, Illinois, tomorrow, September 29th. Carl Franklin and Richard Campbell are the heart and soul of .NET Rocks and they are traveling across the country stopping in major cities hosting events on Visual Studio 2012 and Windows 8. Tomorrow’s event has several great speakers lined up and will be a one track event focused on Visual Studio 2012 and Windows 8. For more information about the speakers, session and registration, check out http://oneday.thatconference.com.

As Carl and Richard travel across the country, they are staying in their RV for the duration of their road trip. Surprisingly, this is the second time they’ve done this! Two years ago they hopped in a different RV and made their way across the country holding live .NET Rocks events. And with the release of Visual Studio 2012 and Windows 8, they decided it was time to hit the road again.

Tomorrow’s event is completely free and will include lunch. Registration begins at 8:30 AM and presentations start at 9:00 AM. The day will conclude between 5:30-6:00 PM with questions and giveaways. Following the event, everyone is invited to join the speakers at the Ram Restaurant and Brewery in Schaumburg, Illinois to continue conversations about development, tech and whatever else becomes a hot topic.

When:
09/29/12
8:30 AM to 6:00 PM

Where:
Harper College
Wojcik Conference Center
1200 West Algonquin Road
Palatine, IL 60067

For more information and registration, check out http://oneday.thatconference.com.

How to Install Windows 8 with Native Boot to VHD

Windows 8 Consumer Preview released this past Wednesday following the announcement at Mobile World Congress. During the 24 hours that followed, the Windows 8 Consumer Preview was downloaded over 1 million times. Some might be installing it on separate hardware, but if you’re like me, you’d like it on your good day-to-day hardware. I run multiple OS’s on my day-to-day laptop and I do that by using a feature introduced in Windows Server 2008 and Windows 7, Boot to VHD aka Native Boot. Native Boot allows me to have my entire system inside a VHD, but still take advantage of my hardware and not be restricted to virtualized hardware. This makes it easy to add and remove OS’s to my PC without affecting anything else. I can also backup and restore an entire machine by copying one file. The following video will walk you through adding a Windows 8 Consumer Preview OS to your Windows 7 PC using Boot to VHD aka Native Boot.

If you’d like to follow a written guide, the following are the steps to setup Windows 8 Consumer Preview with Native Boot.

  1. Download Windows 8 Consumer Preview ISO
  2. Download and Install a tool to mount ISO, SlySoft Virtual CloneDrive
  3. Download and Install Windows Automated Installation Kit for Windows 7
  4. Create a directory on your hard drive for your Windows 8 VHD

Create a VHD for Windows 8 Using Diskpart

  • Open Command Prompt as Administrator

diskpart
create vdisk file=<VHDPath>\<VHDName>.vhd maximum=<MaxMB> type=expandable
select vdisk file=<VHDPath>\<VHDName>.vhd
attach vdisk
create partition primary
assign letter=<VHDDriveLetter>

  • Using an ISO Tool like Virtual CloneDrive, Mount the Windows 8 Consumer Preview ISO

Copy Windows 8 to VHD

  • Run the Deployment Tools Command Prompt as Administrator
    • Programs > Microsoft Windows AIK > Deployment Tools Command Prompt

imagex /apply <Windows8ISODrive>:\sources\install.wim 1 <VHDDriveLetter>:\

Add Windows 8 to Boot Menu

  • Open Command Prompt as Administrator

bcdboot <VHDDriveLetter>:\Windows

Reboot and Select Windows 8 Consumer Preview at Boot Menu

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?