PDC Sessions Collected
- By: ben_hoffman
- On: 11/03/2008 19:16:15
- In: Software Development
- Comments: 0
Here's a nice compilation of the PDC 08 session list with links to the recordings. (I've found navigating through at www.microsoftpdc.com to be rather tedious).
http://blogs.msdn.com/nigel/archive/2008/11/03/128-pdc-breakout-sessions-available-now.aspx
Compiler as a Service
- By: ben_hoffman
- On: 10/29/2008 00:15:50
- In: Software Development
- Comments: 0
Woah...
http://channel9.msdn.com/pdc2008/TL16/
The real fun starts at 62:30.
DeepZoom
- By: ben_hoffman
- On: 06/30/2008 15:05:10
- In: Software Development
- Comments: 0
T4 Templates - Code Generation in Visual Studio
- By: ben_hoffman
- On: 06/18/2008 12:17:31
- In: Software Development
- Comments: 0
Recently I was listening to the .NET Rocks podcast on my afternoon commute and they were discussing a topic that is somewhat familiar to me, albeit in a different domain, code generation. This time the domain was .NET development, namely code generation within Visual Studio. They were taling about T4 templates, now included in Visual Studio 2008, and I believe they mentioned the editor from Clarius Consulting. It seemed pretty interesting at the time (in comparison to the commute traffic?). While googling the topic later at home, I stumbled upon an article by Hilton Giesenow at his blog where he mentioned that he put together a screencast demonstrating the topic. I really like the screencast medium, and am always interested in checking out one on an interesting topic so I pulled it down and watched it. Pretty neat stuff. Anyway, I filed it away as 'might-be-useful-someday', and got on with my life.
Well, recently I had occasion for about 100+ dependency properties on a class. (I don't want emails saying 'Oh, why would you ever need that, derive from THIS instead' or 'Just use a collection' or something, thats not the point here.) So, dependency properties are exceptionally tedious to add to your class, often times requiring 30ish line of code each - most of it boilerplate. Now, once you have them it gives you tremendous power, but its a bear getting there. Anyway, since there would be, and generally is, tons of boilerplate code here, I figured it would be a good opportunity to test out the code generation stuff thats built in to VS2008. The amazing thing is that you can write C# that writes your C# (wish there was C# intellisense in the template editor). This is very cool and gets you thinking at a different level about your code. Anyway, very cool stuff - you never know what you will find in your travels and when it might come in handy. Learn on!
.NET Sleepers
- By: ben_hoffman
- On: 02/28/2008 10:07:04
- In: Software Development
- Comments: 0
In the vast universe that is .NET, there is almost no way to know about everything you have right at your fingertips (literally). Every once in a while I come across something and have an 'ah ha' moment (and a subsequent 'Oops' moment when I think about something I did that I could have gotten for free.) So in an effort to help others avoid some sleepers, here are some great articles I have come across in my travels on random topics in the framework.
Tracing
Some of you may know about the static Trace class from .NET 1.0, or you may have written your own debugging support library, well some really cool Tracing support was added in 2.0 that you might not know about. Here's a good series on the topic:
Tracing Primer - Part I
Tracing Primer Part II(A)
Tracing Primer Part II(B)
Tracing Primer Part II(C)
The best part about really instrumenting your app or framework, especially a layered framework, is that, when debug time comes, you can configure the TraceListeners however you want (post-compile) and get just the visibility you need for debugging. Imagine tracing the order of execution through a layered stack - if each layer had its own trace channel (called a TraceSource), you could have them all write to the same trace file and see the execution of calls through the whole stack. For those working with WPF, you might also want to check out this.
Anonymous Delegates
Not necessarily a sleeper, but mysterious to some no less. Here is a series on Anonymous Delegates, they are a powerful concept, and look out for the new stuff in 3.5, it gets even better!
The implementation of anonymous methods in C# and its consequences (part 1)
The implementation of anonymous methods in C# and its consequences (part 2)
The implementation of anonymous methods in C# and its consequences (part 3)
Functional Programming, Lambdas
Here's a great series to get you thinking about some of the awesomeness that is .NET 3.5. I don't know if this could be called a sleeper because it's so new, but you shouldn't miss it. If 'Functional Programming' is boring to you, you should still read to check out some of the new C# 3.0 stuff.
Lambdas and Closures and Currying. Oh my! (Parts 1 - 4)
Lambdas and Closures and Currying. Oh my! (Parts 5 - 9)
Vista SP1
- By: ben_hoffman
- On: 02/22/2008 11:22:39
- In: Software Development
- Comments: 0

A couple weeks ago Microsoft made Windows Vista Service Pack 1 available to technical folks though the MSDN site. Honestly, I had been waiting on this for a while now. I had long noticed some 'quirks' in the original Vista that I was hoping would be fixed by the service pack. So when they made it available - I figured I would get right on it and download the update. Not wanting any 'accidents' that would cause disruption to my life - I decided to wait until the weekend to install it so I would have ample time to fix any issues that might arise. So I went to download it, pulled down the bootstrapping download manager and fired it up (on my Vista machine), it proceeded to crash. So I tried again, no luck. Ok, let's see if its the download manager - try it on my XP workstation - no problems. Ok, fair enough, over that hurdle. I'll wait until the weekend now and finish this up.
Ok, finally I go to run the update installer on my Vista machine. I get:
"Windows Vista Service Pack 1 cannot be installed on your computer because the language of Windows Vista you have installed is not supported or you have installed a language pack that is not supported. Windows Vista Service Pack 1 can only be installed on computers running the English, French, German, Japanese, and Spanish versions of Windows Vista or computers running only those language packs."
So, I'm thinking, "Why would I have ever installed another language pack, I only want to use my computer in English." Then, I checked in 'Control Panel->Regional Something Settings' and, sure enough I had like 16 language packs installed.
#ifdef RANT
So I thought about why I would have installed those (if it was me that installed them) and realized that the only plausible reason was to make 'Windows Update' stop bugging me every 15 minutes to install them. (I also hate that Java thingy that thinks I care about updating to the latest Java every 3 days.)
#endif
Ok, so I guess I need to uninstall everything that I don't need (i.e. everything except English). So I select all 16 of the non-English language packs and select 'Uninstall'. This should be easy... It works on it for about 15 minutes and then tells me it was only able to uninstall Bulgarian (or whatever) - and that it must restart TO FINISH uninstalling. So it restarts - on its way up it does 'Step 2' and 'Step 3' for about half an hour. Ok, back into Windows now, I go back to 'Control Panel->Regional Something Settings' and look and all the language packs are there still, minus one. Oh boy, this is going to be fun, I try to select all of them and nope, one at a time (~45 minutes each - and its not like I have a total junk machine, its a 2.2ghz DualCore with 2gb RAM, 7200 rpm HDD). So, now its Sunday - I have them all off the machine - or so I think. Yes...time for SP1! Nope,
"Windows Vista Service Pack 1 cannot be installed on your computer because the language of Windows Vista you have installed is not supported or you have installed a language pack that is not supported. Windows Vista Service Pack 1 can only be installed on computers running the English, French, German, Japanese, and Spanish versions of Windows Vista or computers running only those language packs."
Ok, I'm pretty ticked now. I just spent an unreasonable amount of time here messing with this thing. I dig around, my list of installed language packs is showing nothing except English, but I look (somewhere else) and apparently I can select Portuguese for the display language, even though its not showing in my list. So, in despair, I reboot, now I see Hungarian in my list of installed language packs. Whew... So I go though and 'try' to uninstall. Nope, still:
"Windows Vista Service Pack 1 cannot be installed on your computer because the language of Windows Vista you have installed is not supported or you have installed a language pack that is not supported. Windows Vista Service Pack 1 can only be installed on computers running the English, French, German, Japanese, and Spanish versions of Windows Vista or computers running only those language packs."
I try a couple more times and then Google for a while until I stumble upon http://support.microsoft.com/KB/947506. I download that, run it and then uninstall the languauge packs that now show up in my list - and I'm in, SP1! Apparently, 'TrustedInstaller' somehow got my language packs corrupted during install and I didn't even know it...
MORAL OF THE STORY - hope this helps people avoid the pain - if you get the message about the language packs, you might want to try KB947506 before you get too flustered.
Ok, now the good news, SP1 did fix a couple of my noticed 'quirks' in Vista. Network transfers that used to take 12 minutes (3 on XP) seem to be about right now. The 'Calculating Transfer' stuff that you see when you move things around on a network are MUCH QUICKER (I think it starts transferring right away now like it should), Hibernation / Sleep / Startup seem improved, and 'Windows Explorer' now only crashes 3 or 4 times a day (which is a big improvement.)
Also, if you want to hide an update that is being pushed on you by 'Windows Update', you can just right click on it in the list and select 'Hide' and it will stop bothering you about it.
Progress sometimes comes in baby steps...
Slide.Show Generator code moved to CodePlex
- By: ben_hoffman
- On: 01/06/2008 10:33:35
- In: Software Development
- Comments: 0
There has been some interest in the Slide.Show assets generator tool from one of my previous posts so I have moved the code up to CodePlex, you can find the project here.
For those that don't know about CodePlex, it is Microsoft's open source project hosting site. It is a great place to share code and collaborate with people on a project.
Popfly
- By: ben_hoffman
- On: 12/29/2007 14:19:03
- In: Software Development
- Comments: 0

A while back, when it was in early beta I think (a few months ago anyway), I joined Popfly which is a graphical mashup creator. It allows you to drag 'blocks' like data sources and display elements and stitch together a mashup without code. I took a good look around today and was able to whip together a little mashup. This stuff is definitely worth a look-see...
Silverlight SlideShow Generated
- By: ben_hoffman
- On: 12/23/2007 20:01:19
- In: Software Development
- Comments: 0
After adding a bunch of metadata to my pics using Microsoft's Photo Info Tool, I put the generator from my last post into action and created a little better slideshow for my trip, it's below (you'll need Silverlight 1.0 installed to see it).
Silverlight SlideShow
- By: ben_hoffman
- On: 12/23/2007 18:13:19
- In: Software Development
- Comments: 0
While scaning my Google Reader, I noticed that Mike Swanson had posted something about a Silverlight slideshow app. It caught my interest because a while back I started to create one in Silverlight 1.1 (now 2.0, it's the one that lets your write C# instead of, yuck, JavaScript). I got far enough to see some results but quit due to the lack of tooling at that time in Expression Blend. Anyway, Mike was talking about something that Vertigo created on Silverlight 1.0. You can get the code from the SlideShow project at codeplex. I grabbed the code. I made a simple slideshow [you will need Silverlight 1.0 installed.] This is pretty cool. Basically, it runs off of an xml file that configures albums, image titles, image locations and so on. You create this file to tell the stuff from Vertigo how to do what it does.
So, having just gotten back from a backpacking trip to Europe, I've got tons of photos - a slideshow would be nice. Well, if you are going to make a serious slideshow with this stuff, you will quickly find yourself opening lots of photos, and editing xml, resizing images for the web, making thumbnails over and over. Better get comfy with IrfanView, and a good xml editor. Rather than invest the time to build a single grand slideshow, I started down the path of making a tool to do it. It would have to resize images for me (a thumbnail and a web-sized image would be nice), it'd be cool if it could grab those little pieces of info that the camera puts on the photos (metadata - like 'DateTaken') as well as any other stuff I have added to the images with programs like Image Metadata Editors, and lastly it'd need to generate that xml file needed by the slideshow code. Here's a start on that tool. [Make sure to grab .NET 3.5 if you don't have it already.] It currently will grab the metadata, resize pics, and it lets you edit what gets put in the slideshow.

To use the tool, you need to have your pictures arranged in albums, i.e. I already had my pictures sorted by city, so the albums are cities. Something like this:

Then you will want to set the output directory, generate the images, and finally the 'data.xml' file. You end up with something like:

Then you just need to copy that up to your webhost, along with the stuff from Vertigo, and your slideshow should be ready. I have worked with 'album directories' containing up to roughly 1000 images - you do notice some performance impacts as you get tons of images. I had to go ahead and make the tool pre-generate thumbs after you select the album directory (so I could show the picture thumbs in the UI) because using the original pics caused my machine to lock up - paging like crazy due to lack of sufficient memory. (I tried UI Virtualization to no avail, anyway...you would have to generate the thumbs later regardless so its not wasted effort. I cache them in a 'temp' directory next to the exe.) I have noticed that certain things in the UI of the tool, such as changing the album thumbnail using the 'Album Thumbnail' button seem to work much better in Vista. If there is interest, I can make the code available.
Off to make some slideshows...