Visual Studio Live! - Redmond

Posted July 11, 2012 8:50 AM Categories: Async | C# | VSLive Redmond | Events

imageI will be presenting a session at Visual Studio Live! in New York this August 6-10 hosted on the Microsoft Campus.  The conference is a full 5 day event and there’s still time to register!

T13 - Writing Asynchronous Code Using .NET 4.5 and C# 5.0
Date: Tuesday, August 7, 2012
Time: 2:30 PM – 3:45 PM 
Level: Introductory

A variety of new features were added to the .NET 4.5 Framework, including support for easily writing asynchronous code. This session will introduce the concepts of asynchronous programming, .NET Tasks, how to ensure your UI remains responsive, and how to do all of this properly in your own applications using the new async and await keywords. If you’re looking for ways to provide a better, smoother experience for your users, don’t miss this session!

Get more information on the conference at:

Hope to see you all there!

TechEd North America 2012

Posted June 7, 2012 8:42 AM Categories: Coding4Fun | Events | Kinect | TechEd

http://northamerica.msteched.com/p/tena2011/resources/techEdHeaderLogo.jpgI'm off to TechEd North America later this week where we'll be showing off the Project Detroit car and our BoxingBots project previously demonstrated at SXSW in March. 

09615539-1a33-49f7-b438-ca1b9543d712 IMG_0296[5] 

Dan Fernandez and I will also be giving a talk on Kinect goodness.  Here are the details:

Coding4Fun: Build Fun, Cool, Commercial Applications Using the Kinect for Windows SDK

Session Code: DEV330
Speaker(s): Brian Peek, Dan Fernandez
Tuesday, June 12 at 5:00 PM - 6:15 PM in S320A

Come to this must-see session to find out how you can use the Kinect for Windows SDK to build commercial applications! Learn how the RGB and depth cameras work, how to use and fine-tune skeletal tracking, how to read an audio stream from the Kinect microphone array and even how to send Kinect data over the network including to your Windows Phone

This same session will be given at TechEd Europe in two weeks, with Clint Rutkas playing the part of me.  I will not be at the Europe conference.

So, if you're attending either TechEd this year, please stop by the Coding4Fun areas or our session and say hello!

Assembla SVN With Local Backup

Posted May 22, 2012 9:32 AM Categories: Source Control | SVN | Tips & Tricks

I recently moved my personal source control setup from a local SourceGear Vault server to a free, hosted SVN service from Assembla.  I wanted to have access to my source code while travelling without having to keep the server running at home, and Assembla provides users with up to 1GB of space and unlimited users absolutely free for private SVN hosting.

I wasn't looking to import my entire Vault database over to SVN, so manually creating new projects in Assembla was just fine.  I setup 3 different repositories:  one for personal projects, one for code related to sessions I give, and one scratch space that I can use to test things out and delete without issue.

My main concern in going to a hosted solution is ensuring I have a current backup of my repositories should something go wrong.  Assembla provides a manual backup option via their website, but I wanted something automated.  After some searching, I learned of the svncync command.  This command allows you to mirror a SVN repository from one machine to another.  Using this I was able to come up with a pretty automated solution that should work to sync up any two SVN repositories.

Preparing VisualSVN

I created the same three repositories described above on a local machine running VisualSVN that is backed up nightly via Windows Home Server.  VisualSVN  needs to have a specific hook set up with no content in order for svnsync to work.  To do this, right-click on the repository, and select All Tasks –> Manage Hooks.

5-21-2012 3-29-14 PM

On the Hooks tab, select the Pre-revision property change hook and click Edit.

 5-21-2012 3-30-54 PM

In the dialog that pops up, just click OK, and then click OK on the previous dialog.

5-21-2012 3-31-10 PM

This process creates an empty file named pre-revprop-change.cmd in the repository's hooks directory.

Setup Sync

To setup sync between the local VisualSVN server and remote repository, the local repository needs to be configured for sync.  To do this, run the following command, replacing the repository names and locations:

svnsync init file:///c:/repositories/myrepository/ https://subversion.assembla.com/svn/myrepository/

With VisualSVN setup, we can pull in the current state of the remote repository as follows:

svnsync sync file:///c:/repositories/myrepository

Set the UUID

Andy Pook mentioned this tidbit in the comments below.  If you want to be able to seamlessly switch between the main and synced repositories, the UUIDs of each repository need to be the same.  This can be accomplished pretty easily.  First, get the UUID of the remote repository using the svn info command:

svn info https://subversion.assembla.com/svn/myrepository

The output will contain a line that looks like this:

Repository UUID: 48c27914-95eb-48c8-b9f6-abc9d842ae0f

That's the UUID of the remote repository.  To set it to the synced repository, use the svnadmin setuuid command:

svnadmin setuuid c:\repositories\myrepository 48c27914-95eb-48c8-b9f6-abc9d842ae0f

Of course, change the names, locations, and UUID to reflect your configuration.  With this set up, you can now switch to the synced repository on the fly should something happen to the remote setup.

Automating the Backup

To automate this, I created a simple batch file that uses the svnsync command and runs nightly as a scheduled task to sync all three repositories with the local SVN server.  Here's what the batch file looks like:

"C:\Program Files (x86)\VisualSVN Server\bin\svnsync" sync file:///c:/repositories/Sessions
"C:\Program Files (x86)\VisualSVN Server\bin\svnsync" sync file:///c:/repositories/Personal
"C:\Program Files (x86)\VisualSVN Server\bin\svnsync" sync file:///c:/repositories/Scratch

I now have nightly backups of my hosted SVN repositories with very little effort.  This might be one of those things that everybody knows, but it's new to me. Enjoy!

Visual Studio Live! - New York

Posted April 17, 2012 8:22 AM Categories: Async | Events | Kinect | VSLive New York | XNA

I will be speaking at Visual Studio Live! in New York this May 14-17.  The conference is a full 4 day event and there’s still time to register!  The three sessions I’m presenting are:

W01 – Get Connected with Kinect 
Date: Wednesday, May 16, 2012
Time: 9:15 AM – 10:30 AM 
Level: Introductory

By now we’ve all probably tried Kinect, Microsoft’s revolutionary motion control device for the Xbox 360. But what about developing software to use the device? With the release of the official Kinect for Windows SDK from Microsoft, developers can now use this device like any other hardware peripheral from code. This session will introduce developers to the Kinect device itself, how it works, and will offer an overview of the API provided by Microsoft to retrieve image, depth, skeletal, audio, and audio position information from the device. The session will also cover some interesting uses for this information, and how it can be used in traditional applications for easier navigation to provide a more natural user interface.

W12 – Advanced XNA Games for Windows Phone
Date: Wednesday, May 16, 2012
Time: 1:30 PM – 2:45 PM 
Level: Intermediate to Advanced

XNA is an extremely powerful platform that extends far beyond simple 2D sprite-based games. In this session, learn how to build 3D games and the deal with the complexities that come with moving to the third dimension. The session will consist of building a very simple 3D game for Windows Phone. Specifically, attendees will learn how to import pre-built 3D models, animate them, and display them in 3D space. Additionally, the session will cover shader-based effects, handling user input, playing sounds and music, and putting it all together for submission to the Marketplace.

TH16 - Writing Asynchronous Code Using .NET 4.5 and C# 5.0
Date: Thursday, May 17, 2012
Time: 1:30 PM – 2:45 PM 
Level: Introductory

A variety of new features were added to the .NET 4.5 Framework, including support for easily writing asynchronous code. This session will introduce the concepts of asynchronous programming, .NET Tasks, how to ensure your UI remains responsive, and how to do all of this properly in your own applications using the new async and await keywords. If you’re looking for ways to provide a better, smoother experience for your users, don’t miss this session!

As always, I will be hosting another round of Developer Duel on Tuesday night during the VSLive After Dark event.  Join us for the event and have a chance to win fabulous prizes while playing a game similar to one you’ve seen on TV for the past 30 years…

394959_10150508695749475_190107439474_9124612_1504117249_n

Get more information on the conference at:

Hope to see you all there!

Async Goodness at Tech Valley .NET User Group

Posted March 5, 2012 9:14 AM Categories: .NET | Async | C# | Events | TVUG

imageI’ll be giving a session to the Tech Valley .NET Users Group (TVUG) Tuesday, March 13th at 6:30pm on the new async goodness that exists in .NET 4.5 and C# 5.0, as well as the Visual Studio Async CTP which can be used with Visual Studio 2010.  Here's the description:

Title: Writing Asynchronous Code Using .NET 4.5 and C# 5.0
Where: Tyler Technologies, Latham, NY
When: Tuesday, March 13th, 2012, 6:30-8:30PM

A variety of new features were added to the .NET 4.5 Framework, including support for easily writing asynchronous code. This session will introduce the concepts of asynchronous programming, .NET Tasks, how to ensure your UI remains responsive, and how to do all of this properly in your own applications using the new async and await keywords. If you’re looking for ways to provide a better, smoother experience for your users, don’t miss this session!

You will learn:

  • Learn about the pros/cons of asynchronous code
  • Learn how to write and use asynchronous code in .NET 4.5
  • Learn how to maintain a constantly available and responsive user interface

Hope to see you all there!