It’s been a while since I’ve updated the blog.  Several things have happened.  On July 1st, I received notification that I was renewed as a Microsoft MVP for 2012.

This made me very happy since I also had just signed a contract with Sams publishing (Pearson) to write a third book for them, and I figure this would mean early access to the Windows 8 bits through a MSDN subscription.  To me, that subscription is the second best perk of being a Microsoft MVP.  The best perk is being able to talk to the product teams and to see conversations by folks that are much smarter than I.

My first two books were on game development using XNA.  This third book is about creating Windows 8 apps.  I signed the contract the last week of June with the plans of writing the first chapter on July 1.  

Around the same time I was invited to participate in an App Excellence lab.  For some reason I thought it was more of a Dev Camp setting.  The lab is really for for folks who have an app that is at least 80% done and are wanting to put the app in the Windows Store.  The dev camps are a full day (or 2) of learning about what makes a Windows Modern UI style app and what is needed to put the app in the Windows Store.  I found out the day before that what I was attending was the “80% app done lab” and not the “training / work day with experts lab”.  So I apologized to the field engineer and we discussed the app and I got some good pointers about the app in particular.


My original idea was to create a version of the app for the book and then finish it up to submit it to the store.  I realized the concept of the app was too complex for the book.  There would be too much time spent on explaining the app instead of the technology behind the app.  So going through that exercise allowed me to have my first failure within the first week.

I created my Table of Contents (TOC) and spent that first week (before July 1) mocking up 3 apps.  Two of the apps mocked up I would use in the book.  The third was a good exercise, but proved to not be the right game for the book.  The idea was to create two apps and one games as a “Putting what was learned it into practice” section of the book.  In fact, here is the table of contents in its current state.  Perhaps some of the words will change a little, but this is what we have:

Part I: Building the Foundation
1    Getting a Refresher on JavaScript, HTML5, and CSS3
2    Trying out File | New | Project
3    Exploring the Windows Runtime (WinRT) and Windows Library for JavaScript (WinJS)
4    Creating WinJS Namespaces, Classes and Custom Controls
5    Understanding Microsoft Design Style Principles
6    Customizing the Style of our Apps
7    Debugging, Securing, and Measuring our Apps Performance
Part II: Handling the Hardware
8    Working with Multi-touch and Other Input
9    Working with Location and Hardware Sensors
Part III: Working with Data
10    Binding Data to Our Apps
11    Storing Data Locally
12    Using Remote Data
Part IV: Making it a Windows Store App
13    Working with Fullscreen, Filled, Snapped, and Portrait Views
14    Using the App Bar and Pickers
15    Handling Our App Life Cycle Events
16    Using Contracts and Extensions 
17    Using Live Tiles, Secondary Tiles, Notifications, and Toasts
18    Creating a Trial and Handling In App Purchases
Part V: Putting it into Practice
19    Making an App: RSS Aggregator
20    Making an App: Finger Painting
21    Making a Game: Simon
Part VI: Sending it out to the world
22    Understanding the Windows Store
23    Getting an App Certified
24    Making Money with Windows Store Apps
Part VII: Appendix
         This Book’s Website

Yeah, this book is about JavaScript development and not C# which has been my bread and butter for the last 12 years.  I started working with JavaScript excessively around April this year and  have really come to enjoy the language.  Something I would have never thought back in 1996 when I first used it.  Visual Studio tooling could be better, but it is much better than was in the past.

The table of contents went through a few iterations but not many changes overall.  It is currently being reviewed by the technical editor.  Once I get notes I’ll make modifications and then it will go on to editing (for thing like, gramar, and, speeling, altho I’m a very goood speeler, and, gramarist person).

Writing a book in 8 weeks is challenging.  I did the same thing for my first book on XNA.  Writing a book in 8 weeks and working full-time provides very little time for anything else.  On the flip side, with my second book, I gave myself 6 months of time, plus it was an update to the existing XNA book.  I figured that would be a breeze, but that was a long 6 months.

The 2 month approach wreaks havoc on my family though.  I thought I’d have a better handle on writing  it this time around but I got behind on my schedule after about the 3rd week and was in catch up mode ever since.  That means the last 5 weeks, out of the 8, I was in my “worst case scenario” phase of not going to bed some nights and neglecting time I had set aside for my family.

End result?  The book content is done and the deadline was hit.  My daughters haven’t suffered too much but my poor wife has had to really pick up the slack.  We homeschool our girls, so my doing the book from June 26th to August 27th caused my wife to not really get much of a summer break.

image I kept track of my time for this book and I spent 695.2 hours researching and creating content. Ouch.  Fortunately, the main content of the book is done and now I’m just waiting the for the technical editor to come back.  I’m also going through and updating the first chapters to work with RTM as all the code (and screenshots) were originally done on Windows 8 RP.  I downloaded RTM on the 15th and installed it on Thursday night (16th) while attending my local .NET User Group where Brian Hitney and Glen Gordon talked about Windows 8.  Their boss, Brett Wolfe was also there and I was able to schedule another App Excellence lab.  This time I was prepared and had 2 apps to choose from.  We got it scheduled for Tuesday morning, the 21st.  It passed and, just like Jennifer Marsman, I got a Windows Store token.  This was extremely beneficial as it allowed me to grab screenshots of the Windows Store and submitting apps which was crucial since I had an entire chapter devoted to it.  So I’m very grateful that Brett hooked me up with another timeslot.

One obstacle I ran into was not having Windows 8 hardware.  I didn’t attend Build 2011 so I didn’t get one of the nice Samsung Series 7 tablets.  I had purchased an ASUS EP121 in June of that year and have enjoyed using it.  I installed Windows 8 Consumer Preview on it in March and really enjoyed using it.  I then also installed Windows 8 CP on my desktop and only used Windows 8 on those machines.  I was booting to Windows 8 CP on a VHD on my Windows 7 desktop, but I never went back to load Windows 7.  That will change this week as I’ll boot into Windows 7 so I can do an upgrade to the final version of Windows 8. 

Anyway, back to my tablet … I used the ASUS EP121 in order to test my code around touch.  Unfortunately, the device only supports two touch points.  During the App Excellence lab, the Microsoft Field Engineer confirmed that the app was working as expected when 8 fingers were being used.  Writing code for the GPS is no problem even for devices that don’t have a GPS so that was no problem.  But the new accelerometer, magnetometer and gyrometer hardware that will be in all Windows 8 tablet and convertible PCs is something I needed to provide examples on.  The Sensor Fusion software that takes those three hardware pieces and provides results is pretty cool.


Unfortunately, my ASUS EP121 hardware didn’t support it.  I went purchased a STMicroelectronics Micro-Electro-Mechanical-System (MEMS) which is the piece of hardware that is in the Samsung devices and will be shipping in many of the upcoming devices.  Paying $140 for that was a lot better than shelling out a grand or so on a device that I would loath after October and November gets here and all the new devices start coming out.  Plus, I was able to snag a seat at the Build 2012 conference coming at the end of October.  I’m hoping there will be some hardware goodness there.

Getting information on the Windows Store and the hardware were the only two problems I had with creating the book (other than running into bugs as I was creating the examples and learning the technology, of course).  This book is an introduction to Windows Store app development in the Sams Teach Yourself series.  It was hard for me to not spend time drilling down into topics as much as I did with my XNA books.  When dealing with a framework like the XNA Framework, there is only so much surface area that needs to be discussed so there is some wiggle room to dig down deep on a topic and even spend a chapter or two discussing non XNA related, but game related content like physics and artificial intelligence.  However, when talking about Windows 8 – that is a HUGE amount of API that can be covered with multiple ways of doing the exact same thing.  How does one determine what is included in a book with limited pages and what is not?  Making those decisions was challenging, but I tried to just stick the items that would be most common to folks starting out and needing to get an app or a game created quickly.

The other challenge was that I wanted to have one of the three main example apps be a game.  Game development can be difficult.  How does one teach game development in a single chapter?  It can’t be done, but what can be done is to introduce the topics such as the game loop and game states as well as introduce other game type of items all throughout the book like working with the HTML5 canvas and using the requestAnimationFrame API.  One of the apps created was a finger painting app.  Even though it is an app and not a game, it has certain properties of a game where the screen needs to be drawn at the refresh rate of the display and separating out the update logic (receiving input from fingers, stylus/pen and mouse) and the drawing logic (of actually drawing lines on the screen based on the touch points).

In another post, I’ll list all of the examples discussed in the book, like the Ink example which uses hand writing recognition, and the three (mostly) complete apps, one of which is a game.  I'll be submitting those three apps to the store in the next few weeks.  All of the source code for this book will be put on GitHub once the editing process is complete and the book is sent off to the printers.

So while writing the book was a strain on my family I am still happy I did it.  My wife would most likely disagree but she was and is supportive of my efforts.  I think if I did another one, I’d like to have 3 months to do it.  6 months is too long, but 2 months is too short.  I have the ability to focus on something and push through until it is done, but the down side is that I tend shut out almost everything else as I focus on the task at hand.  It is the only way I know of how to get something done when it is very unlikely to get done.

I’m unsure of what the release date of the book will be at this point, but it should be out before general availability of Windows 8.  So writing a Windows 8 book in 8 weeks was challenging, I learned a lot and realized I could write another 2 or 3 books on the subject.  Could, but won’t … at least not for a while ... and not in a 2 month period.

Up next, I’ll be putting the finishing touches on the three apps created in the book and submit them to the store.  Then I’ll start work on the next 7 apps.  All of these will be released through my company GlobalCove Technologies.  After the first batch of apps are submitted and before I start work on the next 7, I’ll be redesigning the website to better align with the company’s new focus of Windows 8 app and game development.  While the company will still do training and provide consulting services our main focus will be creating apps for the Windows Store.

If you are contemplating writing an app for the Windows Store, don’t delay.  Don’t put it off.  Get it done.  Some of the first apps will have great success as in millions of dollars success.  Don’t miss out.

Happy Coding,



Twitter Bootstrap is great. I’ve given a couple of talks on this subject and am scheduled to give a couple more.  Feel free to grab the presentation and the code for the talks.

I hope to carve out some time in the near future to create a proper blog post about this topic.  Do yourself a favor and grab ‘Twitter Bootstrap with LESS source’ from NuGet and start using it in your projects.  It is really beneficial.

Quick run down to get going with the source code.  If you grab Twitter Bootstrap with LESS source from NuGet it puts the .less files under /Content/less/*.less.  Then in your aspx/php/html/whatever page add a stylesheet reference to the bootstrap.less file.

The bootstrap.less does an import of all the other .less files that make up bootstrap.  (There is also responsive.less which imports all .less files needed to make your site responsive.  Responsiveness in this context refers to rendering your HTML elements differently based on resolution.  So if you are using a tablet your site can look differently than when it is on a phone versus a large monitor with a high resolution.  This is done via CSS media queries.

Twitter Bootstrap (with LESS) comes with the less.js file.  This is fine if you want to bring down the less file and have it generate CSS on the fly on the client.  Another way is to ‘compile’ the less files into css content at development time.  Another way is to add the dotless .net assembly to have any .less GET requests processed from that assembly by changing the web.config and adding a handler for the .less extension.  This is the method the demo code uses.

LESS is fantastic. I highly recommend you look at it and use it instead of CSS.  There are other languages like LESS (SASS and Stylus) but LESS is what Twitter Bootstrap uses and is the most syntactically like CSS.

Another note about dotless: If you are using IIS or IIS Express you want to remove the httpHandler section from the system.web section.  For IIS/IIS Express it only needs (allows) it in the system.webServer section. 

While this just scratches the surface of the talk it should be good enough to get going with these great technologies.  So have fun!



Over the weekend I created a bootable VHD with the Windows 8 Consumer Preview operation system on my development machine. 

My initial reaction on my dev machine on Monday morning was that it was less than compelling.  However, after using it for just a half a day I think it is very compelling.  I’m just scratching the surface but I definitely love this OS already.  I still think there needs to be some instructions for folks that get to desktop mode that may not know how to easily get back to the start screen, but that can easily be done with a short cut on the desktop to go back or even a ‘Start Button’ on the task bar.  Once you know you just have to hover on the side of the screen to hit the Windows charm or hit the Windows Key on the keyboard (which is how I got back) it is no big deal, but for folks who don’t know it could be frustrating.

I also installed Windows 8 Consumer Preview directly on the metal on my ASUS EP121.  Touch is very impressive on the tablet.  I fell in love with it immediately. The key to anyone trying to use Windows 8 Consumer Preview on the ASUS EP121 is to download the drivers from the ASUS website first.  I have Bluetooth working on it and it is great. 

On my development machine, which is what this post is about, I have 2 GPUs. They are both NVIDIA’s GeForce GTX 560 Ti models. I ran into a few issues with the system rebooting on me after displaying RGB dots all over the screen.  Updating the drivers helped but it would still do it.  Then I changed the “Power Management Mode” in “Manage 3D Settings” in the NVIDIA Control Panel to “Prefer Maximum Performance” and I changed the “Multi-display/mixed-GPU acceleration” to “Single display performance mode.”  After making that change the machine still locked up and rebooted once this week but hadn’t for almost 4 days.  So these changes made it more stable but it didn’t solve the problem entirely.


Before I get into the actual experience, I figured I would talk a moment about the setup I went through to get the VHD setup.  I started with Scott Hanselman’s blog posts on the subject.  My machine doesn’t like booting from a USB device and I didn’t want to make a DVD so I used the tip from the commenter on the blog post and setup the VHD that way.

I backed up my Boot Manager Database by running the following:

BCDEDIT /export c:\bcdbackup.bak

I gave my VHD 200GB of space but at this point only have used 59GB so far.

When I done installing it came up with Windows 8 with no issues.  I was very happy. I was running Windows 8 from the metal via the VHD.

Now, something that made my move easier is the fact that when I installed Windows 7 on this machine back in June when I bought it I split out my Users folders (and Program Files) to my 3TB HDD instead of my 128GB SSD where the OS was installed. 

Since I had all the documents on my non OS drive I was able to easily connect to it from my Windows 8 OS.


I have two monitors (would like a third but don’t have room on my desk).  Originally the Windows 8 start screen was on the left monitor.  I right clicked the taskbar on the right-hand side and selected “Make this my main taskbar”.  This moved the start screen to the right like you see above.  (You can click the images to get larger images.)

What I noticed is when I started using the metro apps while also doing something on the desktop is I had no idea what time it was.  Currently, the time on the taskbar is put on the same screen as the Windows 8 start screen (so if the start screen is visible, the clock on the taskbar isn’t visible.)  The only way to see the clock on the start screen (or in a Metro app) is by hovering the mouse on the right side of the screen.  This brings up the charms (search, setting, start, etc) as well as the clock in the bottom left quadrant of the screen.  That isn’t acceptable to me.  I want to be able to glance at a clock.

So I made the Windows Gadget clock visible. (I hadn’t ever used the gadgets in the past.)  As you can see I put it on the bottom of my desktop screen.  It has a “Always on top” checkbox, but it doesn’t always work.  So in the following screens you will see that I just made sure the window didn’t obscure it.


In the above screenshot you will see that I’m using VS 11 as well as SQL Server Management Studio and a PowerShell window where I’ve utilized posh-git so I didn’t have to use Git-Bash. I really like PowerShell.


When I’m not using a Metro app and want both screens to be my desktop I can obviously do that as well.  Here I have two more PowerShell windows opened as well as Windows Live Writer (so I can write this blog post.) One of the PowerShell windows is using posh-hg  since I do a lot of personal development using Mercurial and Kiln from Fog Creek. The other PowerShell window is just for random stuff I need to do on the machine. I created some functions so I can just put “dohg” or “dogit” and it will load up posh-hg or posh-git and set different color schemes. This way I can easily know which window I need to do my work in.


The above screenshot shows how I opened up my Metro mail client and then put it in a snap view so I could have that going while I still utilized the majority of my two screens with desktop apps.

I like the Metro mail client.  Being able to see all 5 of my active email addresses is very beneficial.  I found myself using my Windows Phone 7 to quickly check for incoming messages before.  Now, I can easily see it through this mail app.


Although the above isn’t very practical if you are trying to do something on the desktop, I found it to be very productive to switch over to filled mode (opposite of snapped mode) to respond to an email.


If I made it full screen I would have to snap it back and then move a window on my other screen to get the system to go back to desktop mode with the Metro snapped app displayed.  This way I am able to easily move it from filled mode to snapped mode.

Unfortunately, I had to revert to using Outlook again as I just couldn’t easily add attachments and my exchange contacts (i.e. coworkers) wouldn’t automatically populate in new messages.  All my contacts from my hotmail and gmail accounts were fine, but not from my company’s address book in Exchange.

So when I brought up Outlook it started to sync.  I didn’t want it to do that since I knew my Gigs of emails were on my D drive.  So I exited Outlook and ran the following command to have Outlook point to my existing file (after deleting the .ost file it was making):

cd "C:\Users\Chad\AppData\Local\Microsoft\Outlook\”

mklink "Outlook Data File - ccarter@robertsonmarketing.com.ost" "D:\Users\Chad\AppData\Local\Microsoft\Outlook\Outlook Data File - ccarter@robertsonmarketing.com.ost"

Then when I booted up Outlook it grabbed my existing file and only had a day of emails to retrieve.  (I tried the Metro mail client for a full day before reverting back to Outlook.) I still use the Metro mail app for my other 4 active email addresses though. I do like it.


The above screen was when I ran the basic Direct3D template and then put it in fill mode.  So I was using VS 11 to run/debug the Metro app that was in fill mode.  Still having my email up.



Those final two images show the Metro Reader application.  The writing is too small to be useful when it is in a snapped mode but I did enjoy using it in the fill mode.

Once I had the machine the way I wanted it.  (I LOVE IT!) I wanted to create a restore refresh point.  I followed this article and had it created in about 35 minutes.


It takes a long time to get past that 0% though so don’t give up.


My next steps will be blowing away the VHD and reformatting my SSD that has Windows 7 on it to use Windows 8 Consumer Preview.  I’ll be using this restore point once I get it installed.  I like using Windows 8 that much.  I’ve not lost any productivity in using it and using VS11 in Windows 8 is excellent.


Just some quick tips from my using Windows 8 Consumer Preview this past week:

image Corners are important!  Hovering your mouse on the  Top Left of the main Metro screen (in Desktop mode or Metro mode) brings up previously used Metro applications.  Handy!

Moving your mouse to the Top Right (or really anywhere on the Right edge) and you will get the charms.


Windows +  .  (period) Will alternate your Metro app from Full screen to Filled to Snapped.  Very handy.

Semantic Zoom: On the tablet you can do the typical pinch zoom gesture but with a mouse and keyboard you select a little magnifying glass on the bottom right of the Metro screen.

I enjoy using IE10 as well (in Metro and on the Desktop).

I’m glad we can still pin things to the taskbar on the desktop as that is very handy.

I love the lock screen. I like how integrated everything is from my Windows Live ID, .NET Passport, Windows Account to my Facebook and Twitter accounts.  It is all very nice.  It is like my Windows Phone 7 has grown up and become a full blown PC.  Go Figure.


So if you are debating on jumping in on the Windows 8 Consumer Preview hopefully this will help you make that decision.  I love developing on Windows 8 Consumer.  I think you will too – especially if you have two (or more) monitors.



So there was a lot of tweets today about alcohol at conferences and folks feeling left out.

The original post was actually making a point about not being able to have meaningful conversations with smart folks once they get sauced.  I’ve definitely ran into that at some conferences.  While at the Microsoft MVP conference last month there was someone who had consumed too much and abruptly interrupted a conversation I was having with someone else.  I’m always opened to including anyone in any conversation I’m having at a conference, but this was overbearing and obnoxious.  It wasn’t the conference’s fault but the person who consumed too much.  Now that I think of it, this happened twice on two different nights at the conference by different people.  Hadn’t thought about it much before.

A lot of the article seemed to address something that I haven’t ran into – conference organizers talking up the booze.  Most of the conferences I have gone to are Microsoft conferences.  From Convergence with big budgets for their partners and customers who spend millions of dollars on different ERP systems (like Dynamics AX, GP and NAV as well as Dynamics CRM) to Gamefest which has just a few hundred game developers (mainly guys from AAA studios and some indie folks like myself) along with those in between.  I’ve also been to some community conferences like Codestock.  There was alcohol available but it wasn’t a drunkfest – or at least I didn’t see it if it was.  So perhaps it is just the JS conferences where this occurs or perhaps I’m too blind to see it.  There typically is some party event but it seems that most folks leave those to go to a bar to hang out and/or really get hammered.  I’ve not joined anyone at the bar after the main event closes down at 10 or so.  It seems it is common for folks to not come back until 2AM or so.  They typically miss the sessions the next morning.  I’m not going to miss a session when I’ve paid money for the conference.  Some folks go just to socialize and have those conversations while sessions are going on.  I typically don’t.  I could see great benefit in that, but unless there is no topic I’m interested in or the speaker is having a hard time I tend to stick to sessions.  I do like open spaces for the times when nothing else fits.  

Regardless, I didn’t feel excluded because folks were drinking and I wasn’t.  I chose not to go to the bars in wee hours of the morning but even if it wasn’t at a bar I’d probably not go anyway since I’d want to get to the sessions in the morning.  I’m definitely not a Brogrammer. Oh well, wasn’t cool in high school, why should I start now?

Warning: Contains Offensive Language

This has nothing to do with conferences, but when thinking about feeling left out I recall going out to dinner with some coworkers and their wives about a decade ago.  We all had a good time, I thought.

A couple months later I found out that the group had done a couple more of those dinners but I hadn’t heard about them.  I was confused as to why I wasn’t asked to join them again.  When I asked a good friend why we weren’t invited he told me.

It seems that my wife and I were the only people that didn’t order any alcohol. I was shocked to hear this was why I was excluded.  I asked if I came across as descending or anything. I was assured that I wasn’t but they didn’t feel comfortable drinking around us.

That blew me away.  So I felt left out but it was because I made them feel uncomfortable.  I didn’t say anything about them consuming the beverages.  Just the act of me ordering a Mountain Dew instead of a Budweiser caused discomfort with my coworkers.  I still don’t understand this.  Regardless, you won’t hear me passing judgment on someone who is drinking beer or wine. I hope people don’t pass judgment on me because I prefer carbonated drinks.

So I guess when it comes to drinking at conferences I think the thing I try to do is make sure I’m not making someone else uncomfortable.  I’m not uncomfortable talking to someone with a beer or wine glass in their hand. I don’t want them to be uncomfortable with me because I have a soft drink in mine.

There are better ways to have meaningful conversations than at a loud bar or party event.  I typically don’t stay at those too long because you can’t have a good conversation.  I’ll go back to my room and write some code and reflect on the things I learned.  I hadn’t really considered those events really part of the conference so I didn’t mind.  Of course, open bars have got to be expensive.  I sure hope I’m not paying for that in the price of my conference ticket.

In my opinion conferences are there so we can learn and be around folks with the same interests. Meaningful conversations are easier to have when someone isn’t plastered but I’ve only seen that a few times.  Of course, I head back to the hotel room around the time folks are looking for a bar after the party so I probably avoid seeing a lot of it.

As with everything, moderation is the key.  Anything to excess is bad – including coding non stop and constantly thinking about work.  That is excess and it isn’t healthy and I constantly do it.