Upgrading to Karmic Koala and Bugs

Yesterday afternoon I kicked off the update to Karmic Koala (9.10) on my trusty Dell Latitude D820 laptop that was running Ubuntu 9.04. The update took a long time (mostly due to the servers getting hammered) and, overall, worked just fine.

I did have to struggle with a couple of things. For example, I originally installed that machine with Xubuntu a long time ago and then converted to GNome. The Karmic upgrade enabled Xubuntu as the default again and configured XFCE as the default session, but that’s easy enough to fix. I can’t seem to find where to change my logon screen to the one I was using, though.

The big issue issues I’m running on, however, are related to what I use my machine the most for :( :

  • I had to change some of my scripts for mounting Windows shares in other machines as specifying the rw option to mount was no longer working. No errors, just mounting read-only instead. To fix this, I had to add the file_mode=0777 and dir_mode=0777 options to the mount command. No big deal, but took me a few Google searches to figure it out.
  • Building C/C++ apps/libraries on a samba share doesn’t work anymore, as GCC will always fail with a “Value too large for the defined data type” error. I’m basically hitting the bug described in this bug report. I do hope it gets fixed soon, as otherwise I will have to get back to 9.04, which does work fine. Meanwhile, I’ll try setting up another VM with 9.04 to see if I can get some work done. Ouch!

Windows Virtual PC and ClearType

After repaving my desktop machine (which is my main work machine) with Windows 7, I tried the Windows Virtual PC for Windows 7 RC to run the few Virtual PC-based Virtual Machines I still use occasionally. It worked, though I didn’t bother installing the updated integration components (formerly known as Virtual Machine Guest Additions) for a while which caused a number of issues.

This week I took a bit of time to uninstall the RC and install the RTM version of Windows Virtual PC. Notice that I have no interest in XP mode, merely in running my existing VMs, many of which are running Windows Server 2003.

A couple of things worth pointing out from this sad experience:

  • Updating Virtual PC from the RC to RTM took me 4 reboots. Seriously screwed up in this day and age, but I fully blame it on…
  • The ungodly bad UI that Windows Virtual PC uses. The old Virtual PC console was a bad UI, but getting rid of it and replacing it with a shell extension, and one that forces you to keep your virtual machine definition files in a specific folder and has terrible usability was an incredibly stupid choice. No wonder so many reboots are needed for any updates, since Windows Explorer will get in the way.
  • After updating the integration components on my Windows Server 2003 virtual machines, imagine my surprise at seeing: (a) virtual pc locking the VM and wanting me to log in pretty often, (b) no way to change VM resolution from inside the VM and without ClearType being used to render fonts at all.

And then I remembered what causes this: Windows Virtual PC sort of ditches the old display rendering and instead will use RDP to access your VM (so you’re pretty much working in a sort of embedded RDP client). Windows Server 2003 didn’t support ClearType over RDP originally, so I went hunting for KB946633 and install it on my VM. One more restart, and ClearType was enabled.

This is supposed to be progress, ladies and gentlemen.

Some Comments on Visual Studio 2010 Beta 2

I’ve been fooling around a bit with the new Beta 2 build of Visual Studio 2010, so I’d thought I’d share a few comments about my general experience with the IDE, focusing mostly on the code editor.

What I like

  • After fooling around with my Windows configuration, font rendering on beta 2 looks a bit better than it used to do in beta 1, which is great. It’s now on par with VS2008, I’d say (and zoomed text looks awesome). The only exception here is the rendering of line numbers, which is pretty bad, for whatever reason.
  • One of the issues I had commented earlier about background color handling in the editor seems to have been improved. Not sure how well it will work in practice, but the new behavior seems a lot better and more useful. Here’s a quick look at how the same line looks like normally, with a breakpoint and as the current statement:

    EditorBg

  • You can now change the colors used when highlighting a collapsible region so that it doesn’t screw up with your custom color scheme. I still find the feature fairly useless, though, but maybe it’s just me.
  • Easy horizontal splitting of code windows is back. Yay!

    VSSplit

  • The IDE seems a bit more stable (beta 1 was pretty bad). I haven’t had any bad crashes yet. If you’re writing Visual Studio Extensions, though, be aware that VS handling of exceptions thrown by extensions (particularly editor-related ones) is still absolutely awful. It will crash, and it will do so badly. You might get a fairly useless dialog box before the crash, if you’re lucky.
  • Vertical Selection is back. Sorely needed. The Insert-In-Vertical-Selection bit is useful, but I’ve had that with ViEmu for years on previous VS versions. (By the way, there’s a slight bug in this feature in Beta 2: if you want to insert text at the start of multiple lines, you need to block-select the first char, type in the new text and then fix the first chars of the lines that you overwrote. If you make instead an empty vertical selection first, insertion will go very wrong).
  • The new C# signature help tooltips are pretty nice. They contain useful information, and they look pretty good. They are very much easier to read than the old VS2008 tooltips.

    Tooltips 

    I do have one complain here, and it’s the lack of consistency: These nice tooltips only appear if you use the Intellisense –> Parameter Info command (usually bound to Ctrl + Shift + Space). If you just hover the mouse over a method, you get a tooltip with the same info, but without all the nice formatting (looking very much like the VS2008 ones, just maybe in a different color).

    But it goes a bit beyond that. For example, those uglier tooltips use fixed-with fonts for all the text. One more inconsistency is that the tooltips shown when a member is selected in the IntelliSense completion list dropdown have the almost the same contents as the other two cases, but this time rendered in a proportional font instead. At least be consistent about it in all places! It would be awesome if all of them used the really nice thing the new formatted tooltips do: render the description text was in a proportional font and leave the signature in a monospaced font.

What I don’t like so much

  • Editor Performance: When it comes to actually editing text, the editor is still not very fast. It’s a bit better in some spots than beta 1, and in general redrawing of the screen is fairly good, though I still see a very, very slight delay when typing text fast.

    Part of the problem here is that I’m running VS2010 on a Virtual Machine (and one running Win7 at that, which isn’t exactly snappy). Without hardware acceleration, the WPF-based text editor doesn’t quite perform as well as one would like. On the other hand, this is pretty much the standard setup for a lot of developers out there, so just ignoring this isn’t really an option for lots of us (not sure if it’s something MS cares about, though).

    The part where performance is pretty bad, in my specific experience, is scrolling: Right now, scrolling in the editor is absolutely awful. It is very slow, regardless of whether you are scrolling by simply moving around with the caret or using the scrollbar. Really hope this gets fixed.

    As an aside: I did try running VS2010 through RDP (terminal services). The experience was pretty much the same: It works reasonably OK as long as you have a large enough bandwidth between the two machines to enable all the graphics features (particularly ClearType, without which the editor is not as nice). Scrolling still sucks the big one over RDP. For more restricted connections, I’m not sure yet usable the editor will be.

  • Italics: Still not there. Seriously screwed up that we’ll have to wait another 3 years to get one stupid checkbox added to the Fonts & Colors option dialog to enable italics fonts on our configurations. The text editor itself does fully support italics and they look beautiful; you just have to hack your way around it to enable them (or use extensions that forces part of the text to render as italics). Not a happy panda about this.

One More Update to KeywordClassifier

I’ve just committed some updates changes to my KeywordClassifier extension for Visual Studio 2010 Beta 2.

I had already worked around some problems my custom classifier was causing with Beta 2 related to it’s use of a recursive invocation of the classifier services, but @noahsmark proposed a better way to get this done in Beta 2 that would simplify the code a bit and get rid of the need to do the recursive invocation in the first place. This involved switching away from a custom classifier and instead implementing a custom ITagger<ClassificationTag> service instead.

The end result (to the user) is the same, but the code is definitely cleaner! In retrospect, though, naming the extension “KeywordClassifier” might not have been the best choice :) .

LineAdornment Extension Fixed For Beta 2

I’ve now fixed all remaining issues with my Current Line Highlighting extension for Visual Studio 2010. Besides fixing all build issues, I started running into issues where IWpfTextViewLineCollection.GetMarkerGeometry() was returning null when the text snapshot was empty (like an empty line).

I reworked the code to avoid this call and instead manually create a new geometry directly out of the line bounds (which I would always do anyway to adjust the margins). This seems to work pretty well for now. Here’s a screenshot of how it looks like on the new build:

LineExt

As usual, the updated code can be found in the GitHub repository.

Updating VS2010 Extensions for Beta 2

Now that Visual Studio 2010 Beta 2 is out, I’ve spent some time updating the editor extensions I created for VS2010 using the new extensibility model so that they work with Beta 2. The changes needed haven’t been very extensive, but they were not obvious at first.

Here’s a list of the most important changes that were required:

  1. The IEnvironment interface is gone, and this affected a few signatures of methods in the extensibility interfaces.
  2. The [VsCatalogName] attribute is also gone, and needed to be removed from the assembly.
  3. The *.vsixmanifest file now needs to be always named source.extension.vsixmanifest, and it needs to be added to your VS project with the action set to “None”. Otherwise, you will get a build error.
  4. The schema for the VSIX manifest file has changed, so I had to update it by hand. Most changes aren’t too big, mostly the case of elements and attributes. I did get stuck a bit here after incorrectly changing my <Components/> section, but @noahsmark helped me get it resolved. Thanks!

Other than this, the process has been mostly straightforward.

You can get the updated code for my KeywordClassifier extension from the GitHub repository. Here’s a screenshot of how it looks like in the new beta:

KeywordExt

I’ve also updated the code of my LineAdornments extension, and the updated code is in the GitHub repository as well. Unfortunately, I seem to have hit an issue with this one that I haven’t managed to resolve successfully yet, which I’ll mention on another post.

PipelineTesting Per-Instance Config Bug

Mark Coleman found a bug in the implementation of Per-Instance Config support in my PipelineTesting library for BizTalk Server. The problem was related to how the config XML was parsed, and would only manifest itself on certain conditions, depending on how said XML was formatted.

Mark was also gracious enough to propose the fix, which I’ve now committed to the PipelineTesting GIT repository, along with a unit test to make sure the problem doesn’t come up again. Thanks a lot, Mark!

MVP Another Year

As many other people have posted today (congratulations to all of them!), Microsoft MVP awards for the October cycle came out today. As a result, I’ve been awarded this year as a BizTalk Server MVP once more. Thanks everyone!

BizTalk Transcoding Component

Gregory Van de Wiele just blogged about the release of his CharacterTranscoder pipeline component for BizTalk. Extremely useful tool for when you need to transcode an message stream from one character encoding to another. Awesome work!

Formatting Byte Arrays in PowerShell

A few years ago, I posted a small utility class I kept around to dump byte arrays in a nice format for reading. I still use that a bit, but got tired of having to fool with test projects to use it sometimes during my debugging sessions, so I finally broke down and just ported it into a PowerShell function:

function byteToChar([byte]$b) {
   if ( $b -lt 32 -or $b  -gt 127 ) {
      '.'
   } else {
      [char]$b
   }
}
function format-bytes($bytes, $bytesPerLine = 8) {
   $buffer = new-object system.text.stringbuilder
   for ( $offset=0; $offset -lt $bytes.Length; $offset += $bytesPerLine ) {
      [void]$buffer.AppendFormat('{0:X8}   ', $offset)
      $numBytes = [math]::min($bytesPerLine, $bytes.Length - $offset)
      for ( $i=0; $i -lt $numBytes; $i++ ) {
         [void]$buffer.AppendFormat('{0:X2} ', $bytes[$offset+$i])
      }
      [void]$buffer.Append(' ' * ((($bytesPerLine - $numBytes)*3)+3))
      for ( $i=0; $i -lt $numBytes; $i++ ) {
         [void]$buffer.Append( (byteToChar $bytes[$offset + $i]) )
      }
      [void]$buffer.Append("`n")
   }
   $buffer.ToString()
}

It’s not fancy or fast, but it does the trick pretty nicely. I use PowerShell a lot during my debugging sessions, be that to quickly test things or make simple calculations, and this will be another useful tool in my PowerShell arsenal. It already proved quite useful today :-) . Here’s what the output looks like:

§ hyperion {~} format-bytes $bytes 16
00000000   60 30 06 09 2A 86 48 86 F7 12 01 02 02 02 01 11    `0..*.H.........
00000010   00 FF FF FF FF 63 9E C7 4F 19 35 B7 30 74 CD 5A    .....c..O.5.0t.Z
00000020   26 5E C0 ED CE 8A 3D 05 C8 28 9B 10 C0 01 00 2E    &^....=..(......
00000030   E0 01                                              ..
←Older