PAGES

3

Apr 11

Write Your Own Debugging Visualizer



Have you ever been stepping through a program and tried to inspect an object only to find it has an internal structure that make it very difficult to really see what is going on in there? I recently ran into a third party object that was causing me that problem over and over so I decided to do something about it. I wrote my own debugging visualizer to take the object and put it into a format that is easy to read. I was surprised how easy it is to do, so lets create one.

The Setup

The object I was struggling with was storing collections of name/value pairs internally in 2 different collections. So I’d have to find the key I’m interested in, note the index and find the corresponding index in the values collection. It was actually worse than this since the collections were also hierarchical. Ouch. So I put together a simple class that demonstrates this called WeirdCollection. It looks like this:

using System;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;

namespace WeirdCollection
{
    [Serializable]
    public class WeirdCollection : IEnumerable
    {
        private readonly StringCollection _keys;
        private readonly StringCollection _values;

        public WeirdCollection()
        {
            _keys = new StringCollection();
            _values = new StringCollection();
        }

        public void Add(string key, string value)
        {
            _keys.Add(key);
            _values.Add(value);
        }

        public CollectionObject this[int index]
        {
            get
            {
                return new CollectionObject
                           {
                    Key = _keys[index],
                    Value = _values[index]
                };
            }
        }

        public int COUNT() as Computed
        {
            return _keys.Count;
        }

        #region Implementation of IEnumerable

        public IEnumerator GetEnumerator()
        {
            return _keys.Cast<string>().Select((t, i) => new CollectionObject { Key = t, Value = _values[i] }).GetEnumerator();
        }

        #endregion
    }
    public class CollectionObject
    {
        public string Key { get; set; }
        public string Value { get; set; }
    }
}

I also put together a little console application that creates a WeirdCollection and writes it back out to the screen:

using System;
using WeirdCollection;

namespace DebugMe
{
    class Program
    {
        static void Main()
        {
            var col = new WeirdCollection.WeirdCollection
                          {
                              {"a", "Alpha"},
                              {"b", "Beta"},
                              {"c", "Charlie"},
                              {"d", "Delta"}
                          };

            foreach (CollectionObject collectionObject in col)
            {
                Console.WriteLine("{0} - {1}", collectionObject.Key, collectionObject.Value);
            }

            Console.ReadLine();
        }
    }
}

So when we run this and put a breakpoint after the collection is populated it looks like this when inspected:

QuickWatch Window

So you can see that the keys and values are split and if they had more than a few values they would be a pain to inspect.

Visualizer Background

A Visual Studio Debugger Visualizer is a couple of classes that inherit from classes in the Microsoft.VisualStudio.DebuggerVisualizers namespace and override some of their methods. First the Debuggee side that inherits from VisualizerObjectSource. This is the piece of the visualizer that runs in the process with your program. It’s job is to serialize the object to be sent to the visualizer and apply updates when it is sent back. (I’m not going to cover updates in this post since I haven’t really needed them yet) 

Second is the Debugger side of the visualizer that inherits from DialogDebuggerVisualizer. This is the piece that takes the object and displays it in a dialog or form that you write. The method you override here is called Show and is designed to show a WindowsForms dialog, control or CommonDialog. Eww. So I’m going to show a WPF form instead. Still easy.

Our Visualizer Debugger Side

First we will write the debugger side and use the built in debuggee side. To do this create a new Class Library project and call it WeirdCollectionVisualizer. Add a reference to Microsoft.VisualStudio.DebuggerVisualizers, as well as PresentationCore, PresentationBase and WindowsBase for the WPF. Also need a reference to our WeirdCollection class since this is what we want to visualize. Also add a class called WeirdCollectionVisualizer and a Visualizer.xaml. My project window:

Project Window

So now the code. First the WPF Window. I kept it simple and will assign the DataContext to a Dictionary<string,string> (you’ll see) to make things even easier. The Xaml file:

<Window x:Class="WeirdCollectionVisualizer.Visualizer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             Height="234" Width="163" Title="Profile Visualizer">
    <StackPanel>
        <ListBox ItemsSource="{Binding}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Path=Key}" />
                        <TextBlock Text=" - " />
                        <TextBlock Text="{Binding Path=Value}" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>

        </ListBox>
        <Button Content="Ok" IsDefault="True" Click="OkClick" />
    </StackPanel>
</Window>

And the code behind:

using System.Windows;

namespace WeirdCollectionVisualizer
{
    /// <summary>
    /// Interaction logic for ProfileVisualizer.xaml
    /// </summary>
    public partial class Visualizer
    {
        public Visualizer()
        {
            InitializeComponent();
        }

        private void OkClick(object sender, RoutedEventArgs e)
        {
            Close();
        }
    }
}

Next up is the visualizer itself. Lets get the code out here and then go over it:

using System.Diagnostics;
using System.Linq;
using Microsoft.VisualStudio.DebuggerVisualizers;
using System;
using WeirdCollection;

[assembly: DebuggerVisualizer(
    typeof(WeirdCollectionVisualizer.WeirdCollectionVisualizer),
    typeof(VisualizerObjectSource),
    Target = typeof(WeirdCollection.WeirdCollection),
    Description = "Weird Collection Visualizer")]
namespace WeirdCollectionVisualizer
{
    /// <summary>
    /// A Visualizer for WeirdCollection.
    /// </summary>
    public class WeirdCollectionVisualizer : DialogDebuggerVisualizer
    {
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            if (objectProvider == null)
                throw new ArgumentNullException("objectProvider");

            WeirdCollection.WeirdCollection wc = (WeirdCollection.WeirdCollection)objectProvider.GetObject();

            var win = new Visualizer();
            win.DataContext = wc.Cast<CollectionObject>().ToDictionary(item => item.Key, item => item.Value);
            win.ShowDialog();
        }

        public static void TestShowVisualizer(object objectToVisualize)
        {
            VisualizerDevelopmentHost visualizerHost = new VisualizerDevelopmentHost(objectToVisualize, typeof(WeirdCollectionVisualizer));
            visualizerHost.ShowVisualizer();
        }
    }
}

The first interesting bit is in lines 7-11. This attribute is how you tell Visual Studio that there are classe(s) in the namespace that are involved in debugging. The first 2 areguments are telling it what classes are implementing the Debugger and Debuggee sides of the process. In this case we are saying that WeidCollectionVisualizer.WeirdCollectionVisualizer is the debugger side and the VisualizerObjectSource class from Microsoft.VisualStudio.DebuggerVisualizers will be handling the Debuggee side. The thirs argument says the the class that we want to visualize is WeirdCollection.WeirdCollection. The last argument is the string that will display on the screen when we use the visualizer dropdown during the debugging process. Like so:

Inspect Variable

Next interesting bit is the class definition on line 17. The class inherits from DialogDebuggerVisualizer and must be the class we said would handle the Debugger side in line 8.

Next we override the Show method. This is where all our work is done. There are 2 arguments passed in but we are going to ignore the first one since it pertains to using Windows Forms and we are going to use WPF. The IVisualizerObjecrProvider argument has a couple of methods on it that we might need. The first is GetObject() (used in line 24). This will give you the object to be visualized. The second is GetData() (not used in code above). GetData() will give you a Stream with which you can deserialize the object to visualize. So Show is pretty simple, just make sure we have an object, get it and cast to proper type, create a new instance of our WPF form, set the DataContext and show it as a dialog. Line 27 is alittle bit on Linq fun to turn the ugly collection into a Dictionary<string,string> which is easily bound and shown in WPF.

That’s it. The last method there is just useful for testing and debugging when things get complicated.

Deploying

Deploying is really quite simple as well. Compile the class and copy it to <User Dir>/DocumentsVisual Studio 2010Visualizers. Visual Studio will recognize it as a visualizer targeting WeirdCollection. When you try to inspect a variable of type WeirdCollection in the debugger you will now get the little magnifying glass with a drop down arrow next to it. Click the magnifying glass and our visualizer will launch:

Locals Window

Visualizer

Conclusion

As you can see Debugging Visualizers are actually pretty easy to write and allow you to customize your debugging experience. Obviously this has been a pretty short introduction but in a lot of cases you won’t need much more. If you do there are a lots of examples and samples around the web. For example: Zeeshan Amjad has an excellent article on The Code Project, MSDN has a beginning walkthrough, to name a couple. If you are interested in just how far you can take these concepts check out Mole 2010. It is a Debugging Visualizer on steroids, crack and some weird alien stuff that makes things awesome.

Source code for this post can be found here.

1 comment , permalink


21

Feb 11

From iPhone to WP7



I used an iPhone 3Gs for around 18 months and then about a month ago I switched to a Windows Phone 7 device (Samsung Focus). During the switch I kept some notes about what I liked, didn’t like, missed, didn’t miss and what I struggled with. Since a lot of people have been curious about the new platform and how the switch went for me I decided to write this blog post to share what I’ve learned.

The iPhone

I was never a huge iPhone cheerleader but when I switched from a Windows Mobile device to the 3Gs it was awesome. By the time I had switched there were tons of great apps and the OS had been updated several times. It was feature rich and polished. That doesn’t mean all was roses though. I hate that I can’t replace the battery. My battery was starting to fail (which actually helped push me to switching to WP7). I hate iTunes with a passion. I’ll admit the app has gotten a little better over the years (I’ve had iPods for a long time) but I still fight with this app. I do not miss having to mess with iTunes at all.

There are some things on the iPhone that I do miss that WP7 just doesn’t have (yet in some cases). I miss the unified inbox. I was pretty meh about it when it got added to iOS but found I missed it when it was gone. I miss the hardware switch to silence the phone. It’s not overly difficult to silence the Focus but it is not as easy as sliding the switch on the iPhone. I miss the sound when a text message or email gets sent. It was comforting to hear the message go on its way. I miss the built in Timer. I used this a lot and while WP7 has some apps that act as timers it does not have one that can run in the background. I miss the large variety of apps from the iPhone. I’m sure this will go away with time as the WP7 Marketplace fills out. Last, I miss the easy screen capture on the iPhone. I think this and the built in timer are just oversights by the WP7 team. Hopefully they’ll add them in future releases.

WP7 Likes

There are a lot of things I really like about WP7 and the Focus. I like the "at a glance" information like the Live Tiles on the home screen. Seeing updated information without launching any apps is awesome. This partially makes up for the lack of a unified inbox since I can add all of my mail account tiles and see unviewed message counts(more on this later). I like how much information is conveyed from the lock screen. It not only shows standard information such as time, date, battery level, signal strength, WiFi, etc, but also shows email message counts (separate counts and even icons for different account) and next appointment.

I like the Metro look and feel. Maybe just because it is different but I really do like the new style. I also like the Back button. It just makes navigating around the phone much more intuitive to me.

I really love the wireless sync. Simply connect the phone once to your computer and tell it through Zune that you want to do wireless sync. From then on when the phone is plugged in, is on your home wireless and your PC is on it will sync itself. No more struggling through nasty iTunes syncs.

I like that I can replace the battery. Nuff said.

I like the Office integration. Especially OneNote. My notes now sync between my phone and my computers easily(usually with no action by me). This is what it should be like.

I like the multiple account contacts integration. Having the People Hub pull contact information from multiple of my accounts (email,Facebook,Exchange, etc.) is pretty awesome. This was a surprise to me. I thought I would not like that ability but once I started playing with it and discovered that it will associate a contact from multiple places with the same actual person I was turned. So now all of my partial information of various people gets put in one place. Those friends that I had in Outlook as just an email and phone are now linked to all the information they publish themselves on Facebook. It linked many of them all by itself but the process for linking is quick and painless as well.

I also like the multiple account calendar integration. Different calendar appointments can show as different colors. Easy peasy.

I like that Apps can be installed on up to 5 phones that use the same Windows Live ID. This means that my wife and I can share the main Live ID and when one of us purchases an app we both can use it. Not a huge deal but does save a few $ here and there.

While you are sharing a Windows Live ID on the phones you can also then share a Zune Pass associated with that ID. Zune Pass allows up to 3 computers and 3 devices. Nice.

I like that I can use my existing skills as a .NET developer to write applications for WP7. Woot!

WP7 Dislikes

There are some things that I don’t like about WP7. I’m sure that some of these will be fixed in upcoming releases but since we have not had any updates yet it remains to be seen how the whole process will work and if they will all be available for different phones. I hope that all of the OS updates will be available and not decided by the carriers like Android. That would be yucky.

I don’t like how often Exchange asks for my password. I tend to keep passwords that are difficult/annoying to enter on the phone and Exchange keeps asking for my password every 4-5 days it seems. It definitely likes to ask for it if I add a new folder to sync. It also seems to like to ask for it if I hit the sync button in the toolbar. No idea why but it is annoying.

I don’t like the long list of apps that is to the right of the home screen. It’s not that I don’t like the list, it’s that it is getting long and I have no way of organizing it. Not a big problem right now but could be as I keep adding cool apps to the phone.

I don’t like the Gmail integration. Specifically I don’t like that when I hit Delete on the phone it just does an Archive on the mail on the server. The iPhone had this problem early on and eventually added an option so that Delete on the phone means Delete and not Archive on the server. I really don’t need spam in my email archive on my Gmail account.

I don’t like that I can’t add my own sounds and ring tones. This is just a great big WTF. To quote the WP7 commercials… Really?!

I don’t like searches and gets in the Marketplace and in the Zune software. Once in a while they can be really quick. Most times they can take 15 – 60 seconds. This happens in the Zune desktop software as well as on the phone. It can take a long time to search for an artist (search), select the artist(get), select an album (get) and then start streaming. That can be upwards of 3 minutes when Zune is slow. Again, WTF?

I don’t like that you can only sync one calendar per account. Accounts like Google Calendar allow you to have multiple sets of appointments on the account. WP7 can only sync and display 1 of these per account. This can render the calendar sync pretty useless for people who organize in one account. Seems like it should be pretty easy for the phone to do since it already does so well with multiple calendars from multiple accounts.

WP7 Undecided

There are few areas where I am still undecided on whether I like or not. Zune is one of those. It is much better than iTunes but I’m still not sure I like it. Slow searches, weird points based buying that obscures what you are actually paying, and an interface that I struggle with all contribute to the bad side. Better than iTunes though.

The browser on WP7 is another area I’m not convinced I like. Not too bad but not great either. Microsoft has announced that a version of IE9 is coming for the phone so we’ll see how that one is if I can get the update.

Email counts threw me off when I started using WP7. The counts shown on the live tiles and lock screen are for the number of emails that have come in since the last time you viewed the inbox. Once you open the inbox for an account the email count is set to zero. The emails themselves can still be unread but the count goes to zero. I’m not sure I like this. I’m not sure I dislike it either. Starting to get used to it though.

Overall

Overall I really like WP7. In fact, I like it better than my iPhone even though there are not near as many apps for WP7 yet. The phone is just a joy to use. Not perfect yet though.

0 comments , permalink


1

Jun 08

Windows Home Server Eases My Suffering



I recently had an experience that I wish nobody had to go through but happens all the time: I got robbed. Not the held up at gunpoint type robbery (thank goodness) but the come home to find your home trashed and stuff missing type of robbed. This is not an experience I can really describe since even in my memory it is very surreal. I won’t go there but I will describe what happened and how my Windows Home Server (WHS) made things a lot easier.

Essentially a person (or a couple people) broke into my house, rifled through everything, and took as much as they could carry (so it seems). The item taken of interest here is my main desktop. This was the machine I used daily for everything from playing games to doing my home finances to research for work. My lifeline at home. One thing they didn’t take was the ugly looking machine in the closet which is, you guessed it, my WHS. There is an advantage to building your WHS as a Frankenstein looking machine: it’s ugly enough thieves don’t want it. What this means is that even though my desktop hardware is gone I haven’t lost any data. The machine was backing itself up the the WHS daily. In a time of stress this was a nice piece of the puzzle I just didn’t have to worry about.

What I ended up doing while waiting for my insurance to cover the loss was use a really old machine as a desktop and had it back up to WHS as well. When I finally got the insurance and bought a new machine getting back to where I was before the theft was simple. I put in the WHS restore CD, followed the prompts, waited a few hours and everything worked. Then I simply opened the backup of the temp machine and grabbed files that I had changed. I didn’t have to reinstall the OS and all my programs. The restore took care of that.

Even though my primary reason for setting up a WHS machine was to protect against HD failure I ended up with protection from the complete theft of one of my machines. Now I need to look into backing up the files on WHS offsite so a theft or destruction of the WHS machine won’t be catastrophic either. Who knew I needed disaster recovery at home?

Thank you WHS.

0 comments , permalink


31

May 08

My Windows Home Server Comes To Life



Wow, so much has happened since I last visited here and a whole bunch of it revolves around Windows Home Server(WHS). In my last post I had a list of the things I wanted out of a WHS installation. I did go ahead and build a WHS for myself (setup is really easy, even on hardware that I mostly had just laying around) and managed to get all of that functionality(or equivalent(or work around)) and more. Lets go over the list:

  • Basic web sites: really easy with WHS and a free add-in called Whiist.
  • Andromeda script: I actually gave this up. I carry enough music on my iPod and if there is something I really want that isn’t there I can sign into the WHS from the web and download the files. This is behind NT authentication the way I wanted it to be.
  • Storage for my music collection: Basic WHS functionality to act as a file server. Added bonus of being accessible from the web and smartly zipping all the files you want into a single download when downloading. Nice.
  • Runs Slimserver (When did they change the name to SqueezeCenter?): So far doing this just fine.
  • File shares for Music, software, common documents, scratch area, etc: again this is basic WHS functionality. It is even very easy to control access to the various shares and allow some users full access, partial access or even no access.
  • Connected printers shared to the workstation: I don’t think this is supported but once you get the printers setup it works just fine. I did have a bit of a struggle finding Windows Server 2003 drivers for my HP Photo printer. Printer companies are going to have to realize that more and more “consumer” printers are going to need drivers for Server 2003 (and 2008 if WHS moves there)
  • Custom service to update my DNS entry when my IP changes: Services has been running fine but is not needed nearly so bad since you can use your Live ID to get a domain entry at .homeserver.com and WHS will keep it updated automatically.
  • Scheduled Syncback SE job to copy files to the backup server: no longer needed but now I want the ability to copy my backups off the WHS to an external drive to back them up. This is supposed to be coming with WHS Power Pack (or maybe not)
  • Keep Foldershare up: Yes, but I still need to keep a user signed in. Since WHS applies updates and reboots automatically I have to periodically check to make sure it is still signed in. Yuck. I’ll be checking out DropBox and Live Mesh as soon as I can wrangle invites to the betas.

Overall I freaking love this thing.

1 comment , permalink


27

Nov 07

Do I Want a Windows Home Server?



Ever since I first heard about Windows Home Server (WHS) I’ve been intrigued. After reading reviews like this one at Ars Technica I’ve decided that I need to try this server out. The review does a good job of describing what WHS is and is not. I’m going to document my thoughts and processes for putting a WHS server on my home network.

First, a description of the current setup. In the house I have 2 main desktops (1 for me, 1 for my wife), 3 laptops (1 for me, 2 are my wife’s), and 2 servers (1 is basic file, web, print server and the other is essentially NAS for backups). What I want WHS to do is replace the 2 servers with 1 box. The main server provides these functions for me:

  • Basic web sites. Mostly Picasa exports for photos.
  • NT authentication protected Andromeda script for everywhere access to my music.
  • Storage for my music collection.
  • Runs SlimServer for the Squeezebox in the living room.
  • File shares for Music, software, common documents, scratch area, etc.
  • 2 connected printers that are shared for the workstations.
  • Custom service to update my DNS entry when my IP address changes.
  • Scheduled SyncBack SE job to copy files to the backup server

The backup server has a couple of jobs itself:

  • Network shares so machines can copy files to it to back them up.
  • Always has a user signed in and FolderShare up. This requires a little explanation. I use FolderShare to keep several directories sync’d between my laptop and desktop. The problem is that the 2 are seldom powered on at the same time. Enter the always on backup server to provide the link.

The question is: Will WHS fulfill all those services and add something compelling to make me change?

The answer: Yes,but probably with several unsupported “features”. I’ll elaborate in my next post.

0 comments , permalink


14

Apr 07

Finding New Music



I like to listen to music while I do most things. The problem is that I don’t always like listening to the same songs over and over (that eliminates most radio). I also don’t think I’m the only one who has this problem either (I know, going out on a limb making that declaration. Whew.). So how do you find new music that you’ll like? I’ve found a couple of ways that work for me but first a little background.

In the past I’ve purchased a lot of CD’s. I still purchase the occasional CD but not so much anymore. I no longer crave the latest fad artist like I did in college. Maybe I’ve actually matured (everyone who knows me just fell on the floor laughing). So I’ve gone through the normal routine of trying out the online distribution services to find one I like. iTunes is ok but I hate the DRM (and iTunes itself but that’s just me). I’ve never tried Rhapsody because I don’t like the idea that all of my music goes away as soon as I stop paying the monthly fee. I ended up settlig with eMusic.

I actually started with eMusic way back in the day when it was unlimited downloads of DRM free MP3 files for your monthly fee. Granted, the catalog was a little limited but I still managed to find plenty of music that I could enjoy. When they changed to a set number of tracks each month I quit. At the time my habit was to only download full albums (I still only do that) and I would grab them in spurts. One week I would grab 5-6 and then nothing for weeks as I digested the new stuff. The unlimited downloads worked great for this mode but the limited downloads that didn’t carry over didn’t work so well. Some months I wouldn’t use any downloads and others i was way short of what I wanted. So I left for a coupleof years. Now I’m back with eMusic and have managed to adjust to the new model. The expanded catalog helps too. I’ve found a lot of stuff I like. How to find it though?

I find most of my music one of 4 ways: from friends, from recomendations on eMusic, from the radio when I drive into work, and from Live Plasma. I won’t explain the from friends since that should be self explanatory.

The recomendations from eMusic takes on several forms. None are perfect but they’ve all yielded new music for me. When you search for an artist on eMusic along the right side of the screen they have a couple of sections to note if you are looking for something new. My favorite is the Similar Artisits section. This has found me several new artists and is about what you would expect. They also have Influences, Followers, and Formal Connections. I’m really not sure how these get populated but they work pretty well. They also have a section called Member Lists. These are lists of albums that eMusic members have put together and shared that contain the album you are currently viewing. This is your standard hit or miss fare but is worth a couple of minutes to look through. eMusic also has what they call the eMusic dozen. These are lists of albums put together by one of the editors for a specific genre. I’ve been disappointed with most of these. I guess my music tastes don’t run similar to music critics. Which is odd because you can browse artists and albums on the site and certain albums have earned an Editors Pick designation. I’ve been pretty happy browsing a genre and looking through the editors picks to find new albums I like. Weird.

I’m not ahuge fan of the radio since so much of it is repeating the same few songs over and over but I like one local station and listen to it in the car. I’ve heard some songs I like and have even found some of them on eMusic. This is an ok source for new music.

My favorite way to find new music is by using the Live Plasma (formerly Music Plasma) web site. This is one of the few Flash based sites I actually like. Enter an artist name and it will draw a map with the selected artist in the center and simial artists around it. The larger the circle the more popular the artist. It will also load the albums(with covers) and list them in the dialog. It’s hard to describe. Go play with it. I’m not as impressed with the new movie version as the music but it is newer so maybe it’ll get better over time.

1 comment , permalink


25

Feb 07

Tree Size and WinDirStat



I had a comment on my post Where Has All My Hard Drive Space Gone? from cgoren that recommended an alternative to WinDirStat called Tree Size (I’m only looking at the free version of Tree Size. There is a Pro version that has more functionality).

If you love the concept, but find that app overkill, check out TreeSize free edition at http://www.jam-software.com/freeware/index.shtml#treesize.
Its a nice, simple UI and, importantly, it installs itself in Explorer’s context menu so you can right click on a subdirectory within explorer e.g. c:documents and settings, and TreeSize launches and runs from that as its root directory.

I went and checked out Tree Size and just don’t agree with the comment that WinDirStat is overkill and Tree Size is better (ok, it doesn’t exactly say that Tree Size is better but it implies it (at least the way I read it)). The only thing that Tree Size might have going for it over WinDirStat is the installer will add Tree Size to your Explorer folder context menu (it does give you the option to not install it there as well which is a good thing). In fact, I think the only reason Tree Size has an installer is to create the shortcuts and context menu entries. Personally I’d rather not have an installer (although WinDirStat has one if you want it. You can also just get the binaries or even the source code). It only takes a few seconds to create a shortcut to the program under your SendTo menu and you have nearly the same functionality. With no installer the app can live in my Utils directory and migrates seamlessly to other machines via a simple copy. I often copy my entire Utils directory to new machines and I have all of my install-less (is that a word?(it is now)) utilities on the new machine.

What about the functionality? Tree Size only offers one of the three views of your drive that WinDirStat does. While this allows a smaller window to work with it greatly reduces the usefulness. The visual representation (and even broken down by file type) view is just too useful to not have. Scan a directory and point out the abnormally large files with Tree Size. Hard to do since Tree Size will show the size of the files in the directory, but not the individual files. Here is the Tree Size view of my Downloads directory:

Notice that the VMWare Workstation directory shows that it is 268 MB in size. What is does not show (and I can’t figure how to get it to show) is that there are 3 separate files in that directory. Take a look at the WinDirStat view of the same directory:

Notice that it shows all 3 of the files in the tree and highlights them in white in the graph. I can probably delete the 2 old versions and free up 170 MB. I can’t get Tree View to show me this level of detail.

How about performance? Tree Size scanned my C: drive in 63 seconds, WinDirStat did it in 56 seconds. Close enough to be even. While Tree Size is ok, I’ll stick with the better WinDirStat.

Just for grins I put together a .reg file to show WinDirStat under Explorer context menu. Note: messing your registry can seriously muck up your computer. I’ve only tested this on one machine and present it as is and take no responsibility for it messing up your machine.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOTFoldershellWinDirStat]

[HKEY_CLASSES_ROOTFoldershellWinDirStatcommand]
@=”"C:\Utils\WinDirStat\WinDirStat.exe” “%1″”

I’m sure there are some registry gurus who read this that can present a better version. I’d love to see it.

1 comment , permalink


15

Feb 07

Where Has All My Hard Drive Space Gone?



Every once in a while I realize that I’m running low on hard drive space on one of my machines. When that happens (like it recently did when I copied files from my backup to a fresh install of Vista on my laptop and it took for freaking ever) I turn to a little utility I found a while back called WinDirStat. This handy (and free open source) utility will scan your whole hard disk once and then show you the results in 3 different views. It has a tree view that is sorted in descending order based on size of the directory and all subdirectories. Second it has a list of file extensions and how much space they take up. Again, it is sorted in descending drive space order. Third it has a cool graphical view of the entire drive where each box is a file proportional to the size it is on the hard disk. The larger the file, the larger the corresponding box in the graph.

The graphical view is what really grabbed me when I first stated using WinDirStat. It is very easy to spot those huge files that eat all of the hard disk space. To find out what the file is, just click on it in the graph and the tree view will adjust, expanding down to where the file is located and select it. In the screenshot at the bottom there are 2 large files in green. Those are my page file and hibernation file.

When I first ran WinDirStat it took about 10 seconds (after the initial scan which took about a minute) to spot 3 .iso images I still had on my hard drive that I had used and forgotten about. That’s an easy way to free up a few GB of space.

I used the program a few times before I really started to pay any attention to the extension list. The more I use WinDirStat the more I like that section. As you can see from the screenshot, I have 4.5 GB of mp3 files on my machine (wow, those eMusic files add up fast, but that is another post).

The final thing that I really like about this program is that you can download the binaries, put them in a directory and run them. No install is necessary. I love utilities like this.

3 comments , permalink


10

Jan 07

I Love Monitors



I’ve always been a hound for more resolution in my monitors. It goes all the way back to when I was first running Windows 3.0 and I had a monitor capable of 800×600 resolution. Everyone I worked with thought that I was nuts looking at the tiny text on the 800×600 resolution. 640×480 was just fine with them. Then I switched to 1024×768. What a dream that was. Look at all the space on the 14″ screen. Everyone I worked with was till using 800×600 (a couple insisted on 640×480). Fast Forward a few years and I was using a single monitor at 1280×1024 and thought it was the greatest. Then came this operating system called NT and I heard that you could put 2 video cards in it and have 2 monitors at the same time. I ran out to the nearest store and bought a video card to put in my work machine. It took a little while to work out the quirks but then I had a 2 monitor setup. I was hooked. Since that time I’ve been preaching about how developers need more than one monitor. I’ve convinced many a person to try 2 monitor setups and almost all have loved it (there’s always one or two who insist they like 1 monitor better. I usually call them grandparents.).

My system right now is using a 2 monitor setup with a Dell 2405FPW 24″ widescreen (1920×1200) as main main monitor and a Dell 2001FP 20″ (1600×1200) as my second monitor. They actually match very well together. The screen height is fairly close and more importantly the resolution height (1200) matches for both monitors. This means I have an effective resolution of 3520×1200 or almost 4.25 million pixels. I love it. The mismatched resolutions does have some interesting side effects but the excellent UltraMon (don’t run multi monitor without it) handles things nicely.

The thing that prompted this post was an announcement from Dell at CES today. They announced a new 22″ widescreen (E228WFP, 1680×1050) monitor. The shocking thing is the MSRP of only $329. Right now on the Dell Home & Small Office site it is selling for only $296. To put this price in perspective, when I bought the Dell 2001FP about 2.5 years ago I was waiting for it to come down to under $700 to my door (I got it to my door for something like $699.75). I’ve had the 2405FPW for about 6 months and it was around $800 (it’s current about $675). That means that 2 of the new monitors can be had for less than what I paid for the single 20″ 2.5 years ago or the 24″ 6 months ago. Doing the math, that’s over 3.5 million pixels for less than the cost of one of my monitors. I think I need to start prompting(bullying) more people to switch to big, dual, widescreens.

There is an excellent comparison of resolution standards in Wikipedia here.

Now playing: Collide – Vortex – The Lunatics Have Taken Over the Asylum

0 comments , permalink


1

Dec 06

Support Your Favorite Small Vendor Day



Coding Horror has a post declaring today “Support Your Favorite Small Vendor Day” by finding one of the awesome programs you use and making a donation to the programmer/company that wrote it. I’ve got lots of software that I use that is given away free that I have not done my part to support (I’ve also got a fair amount that I have paid for and registered). I’ve decided to pick the excellent TaskSwitchXP that I’ve been enjoying for over a year now. $20 bucks headed your way ntwind software from a happy user. Thank you.

Go out there and support the programs you use.

0 comments , permalink