Rants, rambles, news and notes from another geek

Font Smoothing for Windows Server 2003 RDP

A few days ago I posted my recent love affair with a dark color scheme for Visual Studio, but completely forgot to mention that using a Remote Desktop session to a Windows 2003 will not work very nicely with the Consolas font used by that scheme because the font-smoothing required by that font won’t come across the wire.

Bryant Likes wrote a post about how to get around this over on his blog: Font Smoothing for Windows Server 2003

Thanks Bryant!

Miles Per Gallon vs. Gallons Per Mile

This week my MakeZine newsletter had an interesting article in it that referenced a post called Miles per Gallon vs. Gallons per Mile.

Suppose you had a household with two cars, and each car needs to be driven 10,000 miles per year. One car consumes 34 MPG, and the other car consumes 18 MPG. Since gas is expensive, you want to replace one car. Because of utility constraints, you have two choices:

  • Replace the 34 MPG car with a 50 MPG car – a 16 MPG improvement
  • Replace the 18 MPG car with a 28 MPG car – a 10 MPG improvement

Which car replacement would save you the most gas?

Of course this is one of those tricky math tricks that your average American gets totally wrong because the curve on this kind of think is non-linear.

After a nice analysis in the blog post, bunnie confirms the unexpected:

When you run the numbers, replacing the 34 MPG car with a 50 MPG (a 16 MPG improvement) car saves you 94.1 gallons per 10,000 miles, whereas replacing the 18 MPG car with a 28 MPG (a 10 MPG improvement) car saves you 198.4 gallons per 10,000 miles – more than double the savings.

Or, to give an even more clear-cut example, replacing a 5,000 MPG car with a 10,000 MPG car saves you just one gallon of gas, whereas replacing a 1 MPG car with a 2 MPG car saves you 5,000 gallons of gas, using a fixed mileage of 10,000 miles driven for comparison.

Read the entire post for all the info. Nice work bunnie!

TuxPaint - a Children's Drawing Program

starter-coloringbook-tThis morning my daughter wanted to stay home and draw while her mother took her brother to the doctor. Since I need to be in the office working today, I said to her, “Let’s find a good drawing program for kind for the computer!”

She was gung-ho with that, and a few minutes later we found TuxPaint. As you can see in the screenshot on the right, it has nice big colorful icons, a simple color palette, and is very easy to use. You can also download a number of “stamps” with different shapes, animals, icons, etc.

She’s been coloring away now for more than an hour.

Download and Info: http://www.tuxpaint.org/&nbsp_place_holder;

If your kids are younger or you need something a bit simpler, you should take a look at Scott Hanselman’s BabySmash! It is great, but you may want to buy a second keyboard for the kid to bang on. Smile

Released: P&P Guidance for Composite WPF Applications

My old friends over at patterns & practices are at it again, this time with some more great guidance and tools for Composite Client applications, this time for those creating WPF Smart Client applications.

RIScreenshots_small.png

Here’s the summary from their MSDN Landing Page:

The Composite Application Guidance for WPF is designed to help you more easily build enterprise-level Windows Presentation Foundation (WPF) client applications. This guidance will help you design and build flexible composite WPF client applications&mdashcomposite; applications use loosely coupled, independently evolvable pieces that work together in the overall application.

The Composite Application Guidance for WPF can help you split the development of your WPF client application across multiple development teams. In this type of application, each team is responsible for the development of different pieces of the application, which are seamlessly composed together. The guidance includes a reference implementation, reusable library code (named the Composite Application Library), documentation, QuickStart tutorials, and hands-on labs.

For even more information, including a wiki and forums, see the CompositeWPF CodePlex site.

Dark Visual Studio - I'm Hooked

Dark Visual StudioI admit I was skeptical when Brad Wilson was talking to me about his Dark Visual Studio color scheme. Oddly enough, though, I’ve used a dark scheme in Vim for quite a while, so it should have felt more natural to me.

Lately I’ve been doing a lot more coding and decided to give it a shot. I’m now one week in and I’m hooked. I’m using Brad’s settings (Consolas version) unmodified and are very nice on the eyes.

The screenshot on the right is of my current setup, as I typically run it, with all Tool Windows hidden but accessible via keystrokes.

In his post he mentions his “black-on-white with presentation tweaks” settings, but I don’t think he’s posted it. GIVE IT! Tongue out

I Love 7-Zip

7-ZipI was a licensee of WinZip back when the only place you could buy it was CompuServe. Yes, I said CompuServe, which if you know what it means, means you think I’m old, and if you don’t know what it means, you know I’m old. Smile

But for the last year or so, I’ve stopped installing WinZip or WinRAR on my machine and instead have been using 7-Zip.

7-Zip has a simple UI, and like WinZip it also has great Windows shell integration.

But it isn’t the UI or the shell integration that gets me excited. It is the amazing compression it can achieve, especially with folders containing lots of files. I first really noticed the difference when we were putting together some of the community releases of our P&P deliverables. We’d always use ZIP, but the 7-Zip files where 1/10th the size.

As a test today, I downloaded all the posts from my blog into a folder and then zipped it up using both tools.

Original Folder Size 3,283,943 bytes 0% compression

ZIP Archive 1,759,016 bytes 46.4% compression

7-Zip Archive 662,868 bytes

79.8% compression

That’s a pretty amazing difference. No more WinZip for me.

Download and info available from http://www.7-zip.org/

Rediscovering Three-pane Merging With TortoiseMerge and Team Foundation Server

I find that merging without a real 3-pane merging tool is painful at best. When I was a Subversion user, I always used TortoiseMerge, the merge tool that comes with TortoiseSVN. Now that I’m in VSTS, I’ve been using the merge tool that comes with TFS, which is 2-pane, or BeyondCompare2, which is also 2-pane, and I don’t like it very much.

I started out playing with KDiff3, which I used a long time ago. It is okay, but it has some strange usability issues that don’t make it a natural fit for me. I really like the diff/merge tool that comes with TortoiseSVN, so I decided to figure out how to use it.

Step 1 was figuring out how TortoiseMerge works. The TortoiseSVN docs have an Appendix that tells all the command line switches for it:

Command Description

/? Shows a dialog box with the most important command line switches.

/help The same as /?.

/base Specifies the base file used in three way diffs. This is the common ancestor of the files being diffed, although it is not shown in a separate window. For two way diffs, this is the left file.

/basename The name of the base file. This is shown in the view title instead of the file path. For three way diffs it is shown in a tooltip for the view title.

/theirs Specifies the theirs file used in three way diffs, displayed in the left pane.

/theirsname The name of the theirs file. This is shown in the view title instead of the file path.

/mine Specifies the mine file used in three way diffs, displayed in the right pane. For two way diffs, this is the right file.

/minename The name of the mine file. This is shown in the view title instead of the file path.

/merged Specifies the resulting merged file used in three way diffs. This is the filepath where the result of the merge/conflict resolving is saved. If this is not set, then TortoiseMerge will ask the user where to save the result.

/mergedname The name of the merged file. This is shown in the view title instead of the file path.

/patchpath The path where a patch should be applied to. If you don’t set this path, then TortoiseMerge will try to find the path itself to match the paths in the patch file, but that can take very long.

/patchoriginal The name of the original file to patch. Used for the view title.

/patchpatched The name of the resulting patched file. Used for the view title.

/diff The path to the patch/diff file to apply to a directory.

/oneway Forces TortoiseMerge to start with the one-way view instead of the view the user specified in the settings.

/reversedpatch Switches the left and right view of the specified two files to diff.

/createunifieddiff Creates a unified diff file (patch file) of two files specified with /origfile:”path_to_original_file” and /modifiedfile:”path_to_modified_file”. The target path is set with /outfile:”path_to_resulting_patchfile”. If /outfile is not set, a file save dialog is shown so the user can choose the location to save the patch file. Note: If /createunifieddiff is set, all other parameters are ignored.

The next step is to figure out what the command line substitutions are for the TFS tools. James Manning wrote a post on his blog that tells what the tokens are:

  • %1 = Original file (in diff, the pre-changes file, in merge, the “server” or “theirs” file, the file that is the base file after “their” changes were applied)
  • %2 = Modified file (in diff, the post-changes file, in merge the “yours” file - the base file with “your” changes applied)
  • %3 = Base file (in the 3-way merge operation, the file which both “theirs” and “yours” are derived from - the common ancestor. This doesn’t mean it’s the version the changes were based from, since this may be a cherry-pick merge)
  • %4 = Merged file (The output file for the merge operation - the filename that the merge tool should write to)
  • %5 = Diff options (any additional command-line options you want to pass to your diff tool - this comes into play only when using “tf diff /options” from the command-line)
  • %6 = Original file label (The label for the %1 file)
  • %7 = Modified file label (The label for the %2 file)
  • %8 = Base file label (The label for the %3 file)
  • %9 = Merged file label (The label for the %4 file)

Combine those together and we can easily get what we need. You may need to adjust the command path if your TortoiseSVN installation is somewhere else.

**Compare
**Command: C:\Program Files\TortoiseSVN\bin\TortoiseMerge.exe
Arguments: /base:%1 /mine:%2 /basename:%6 /minename:%7

**Merge
**Command: C:\Program Files\TortoiseSVN\bin\TortoiseMerge.exe
Arguments: /base:%3 /mine:%2 /theirs:%1 /basename:%8 /minename:%7 /theirsname:%6 /merged:%4 /mergedname:%9

To set this up, you first need to install TortoiseSVN to get the merge tool installed. Then you can either follow the instructions on MSDN for adding them via the UI (tip: use .* as the extension to use it with all file types) or you can put them directly into the registry with something like this:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation\SourceControl\DiffTools.*]

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation\SourceControl\DiffTools.*\Compare]
“Arguments”=”/base:%1 /mine:%2 /basename:%6 /minename:%7”
“Command”=”C:\Program Files\TortoiseSVN\bin\TortoiseMerge.exe”

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation\SourceControl\DiffTools.*\Merge]
“Arguments”=”/base:%3 /mine:%2 /theirs:%1 /basename:%8 /minename:%7 /theirsname:%6 /merged:%4 /mergedname:%9”
“Command”=”C:\Program Files\TortoiseSVN\bin\TortoiseMerge.exe”

So far it is working pretty well, but I’ll have to give it a try with some real merge scenarios and see how it holds up.

First Post on the New Blog

It looks like there was a minor hiccup on the 301 redirector, but I got that taken care of quickly this morning. Hopefully it didn’t mess up too many people.

Also got the Feedburner feed directed onto the new RSS endpoint, so that should be good to.

Hopefully there aren’t any other issues and it just keeps working.

Tab Management Shortcuts for IE7

So there I am browsing a couple of internal sites suddenly IE7 switches into a mode where it shows me thumbnails of all my open tabs.

“Wha happan??”

I pressed ESC and it went away. But then I couldn’t figure out what did it. No combination of Shift, Ctrl, Alt + Tab would do it. Hmmm… Oh well… Back to work.

Five minutes later it happened again. Twice was enough for me to find the pattern.

I was using Outlook Web Access (aka OWA). For a long time I’ve been a stickler for keeping track of which messages I’ve really read and which I haven’t. So in regular Outlook, I turn off the “auto mark as read” feature of the preview pane and manually mark as read or unread using Ctrl+Q and Ctrl+U.

&nbsp_place_holder;I thought that back in IE6, Ctrl+Q behaved that way in OWA too, and for all I know the code is still there. But now, in IE7, when I press Ctrl+Q I get the thumbnail view:

&nbsp_place_holder;

image&nbsp_place_holder;&nbsp_place_holder; image

Very cool! Not sure how much I’ll use it, but it is neat. It also got me wondering about other shortcuts. I’m sure there are more, but I also found that it support Ctrl+1, Ctrl+2, etc. for direct selection of tabs. (Firefox does this too.)