OpenVideoPlayer for Silverlight and Flash
Posted by Nicholas Brookins on 8 December, 2008 - one response I’ve been working full-time with a new open source project, OpenVideoPlayer, available at http://sourceforge.com/projects/openvideoplayer OVP is a cross-platform/technology web video player, with versions in both Flash and Silverlight. The project is sponsored by Akamai, Microsoft, Adobe, and others. The aim is to provide a good starting point for websites that need built-in players. We just released version 2.0 of the Silverlight player last Friday and it’s turned out to be quite a capable solution. The OVP started life as a media framework that Akamai provided to customers to make for an easier integration with their network. It was licensed as OSS for the 2.0 release in order to expand the community and involve other media companies and consumers. More…
Towards cleaner code, a C# Async. Helper for GUI (Pt 3 of 3)
Posted by Nicholas Brookins on 27 September, 2008 - 8 responses// Threading and User Interfaces
When doing GUI development on Windows you must very careful what thread you access a form or control from. Hopefully most Windows Forms developers know this by now, but in the early versions of the framework it could be a sneaky issue. As of .NET 2.0 they were kind enough to immediately cause an exception when a control was accessed from the wrong thread - forcing you to deal with it now instead of trying to figure out why you randomly get exceptions like this 6 weeks after deploying your application: 
I wont delve much in to why this is necessary, there are plenty of explanations on the subject. The short story is that in .NET there is still a message loop that is running on the thread your form was run from, access from any other thread just isn’t thread-safe - you can’t use locking because it would block the user interface.
So let’s append the Async helper static class that we worked on in parts 1 and 2, giving it the ability to schedule tasks on the UI thread. This will go even further towards making an app cleaner and more maintainable.
UPDATE: This post is now an article on CodeProject.
More…
Towards cleaner code, a C# Asynchronous Helper (Pt 2 of 3)
Posted by Nicholas Brookins on 24 September, 2008 - 2 responses// The Code.
When we last were together, I spent entirely too long explaining the wrong and/or hard ways to start a quick asynchronous task in C#, and only gave a quick taste of what was to come with the Async helper class. This time I’ve got the source to back me up.
UPDATE: The first part of this series is now an article on CodeProject. Check it out and give it a vote for me.
// The main method: Async.Do(…); Making one method that does the work keeps the important logic (and troubleshooting) in one place, but it is private as to not confuse the caller as to which delegate to use. More…
Our Do() method is where most of the magic happens, although it is only 60 lines with generous comments. Sharp observers will notice a couple odd things: it is private, and it takes two different delegate parameters. There are several overloads, these in turn call this method passing one or the other delegate, depending on whether we need a return value. This cleans the caller’s code greatly.
Towards cleaner code, a C# Asynchronous Helper (Pt 1 of 3)
Posted by Nicholas Brookins on 17 September, 2008 - 2 responses// Series Introduction
I’m a sucker for clean and beautifully groomed code. In my experience maintaining a large code base with few resources, it is in fact the only way to keep sanity and keep from sliding into a pit of spaghetti. I’ve been on a push to find areas of necessarily messy or repeated code and find ways to make them more elegant and maintainable - this is the first in a series* of small classes and helpers that I kick myself for not doing sooner.
UPDATE: This post is now an article on CodeProject.
// The Problem at Hand
In any reasonably large application there are a lot of times when you need to perform a quick task asynchronously. One use off-hand is application that saves a log or status report to file on start-up. The operation is slow in relative terms since it involves file I/O, and we don’t have to worry much about other code paths depending on it. Making it asynchronous will speed up our start time with no risk of side effects. More…
Source Control for the unwashed masses
Posted by Nicholas Brookins on 8 July, 2008 - 4 responsesVisual SourceSafe (VSS). Those words make me shudder, and it’s been years since I have touched it. I was snapped back to the reality so many Microsoft-centric developers deal with when my friend Dave sent this: More…
I’m bored of all this Smorgas.
Posted by Nicholas Brookins on 3 July, 2008 - 2 responsesIt’s common in software that often the absolute basics get trumped by candy-coated interfaces and lists of features that mostly go unused (hmm.. MS office 2001-present?). In fact it used to be that the Operating System’s central role was actually memory and I/O management, can you imagine? It is an easy mistake to make. It is fun making new features; tail-wagging dogs that help you search or desktop gadgets that crash in new and interesting ways. The saying that “every program will eventually expand until it can read mail”, is pretty insightful. I swore off using Winamp on the dark day that it took over my video associations, but still couldn’t seem to handle ’shuffle’ correctly - it seemed at the time that every application was expanding until it could play movies.

There is way too much going on here.
Other People’s Code
Posted by Nicholas Brookins on 9 June, 2008 - one responseAs I mentioned in a previous installment, I had started the dreaded task of analyzing the source of the rdesktop project,
to see how I might best integrate it into ToastControl. For non-programmers, ‘having the source’ often seems to be 99% of the solution, when in fact it can be closer to 10%, or I could argue even a liability sometimes. While it may seem like having the plans to a building - I don’t know of many architects that use their own system of measurement for dimensions (variable names), re-define the standard types of rooms and what they do (functions / methods), or hopefully none that use recursion (Frank Lloyd Wright meets M.C. Escher?).
The possible issues are many. First of all, rdesktop is a great piece of software and I have great respect for it, and owe thanks to the author, Matt Chapman. That could be part of the problem - what if this guy is a genius, and I’m not able to even comprehend his masterpiece?1 I risk not being able to figure it out, damaging my fragile binary ego. Even worse would be that he thinks he’s a genius, but falls somewhat short of the mark - creating an obtuse and abstruse monstrosity that seeks to reinvent software development at it’s core (you know, I’ll bet I can do better than this silly Boolean stuff…). For examples of this, look no further than the Daily WTF. More…
ToastControl starts to crawl…
Posted by Nicholas Brookins on 4 June, 2008 - 5 responsesI’ve managed to plug away at ToastControl a bit over the last couple weeks, and have some items to report.
Decisions decided
- - I’m going to use Python. I wanted to use a dynamic language that would be flexible. The heavy lifting is done by the plug-ins like Rdesktop / mstsc and VNC anyway, written in C - the surrounding application doesn’t need tons of speed. Ruby was a contender, but Python seems much more suited to cross-platform thick-client apps like this, at least at the moment.
ToastControl
Posted by Nicholas Brookins on 22 May, 2008 - one responseThere are many ways to control a PC remotely and a plethora of programs for each option. However as an IT professional for the last gazillion years, I’ve never been truly happy with them, and often resort to the command line for VNC and Remote Desktop (rdp / mstsc / terminal services). Nothing wrong with that - but it is a pain to manage multiple hosts, and it seems I’m always scrolling through the terminal history to find the one I need.
Windows Server 2003 shipped with the Remote Desktops MMC snap-in - available in Administrative Tools or by running ‘tsmmc.msc’. It gives you a sidebar for managing multiple hosts, but that’s about where it ends. It is not particularly stable, is somewhat cumbersome, and doesn’t even allow you to reorder connections, let alone organize them in any way.
More…
The Zen of Operating Systems
Posted by Nicholas Brookins on 21 May, 2008 - 4 responsesI am a self-diagnosed O/S addict. If hardware is your computer’s body, then the Operating System is it’s soul. Makes you wonder what karmic mistake we made to deserve Vista, eh?
This vice of mine started with the various computers I use at home or work - I have an general rule that with all the choices out there, each system should use a different O/S. Sure, it’s a bit more administrative work - but it is fun, and gives me an excuse to keep up to date. And to read new posts on DistroWatch like a kid on Christmas morning. More…

Subscribe to Posts
Subscribe by Email