Visual Studio and Ligatures

Posted by

For a while now, I’ve been using variable-width fonts when I’m programming. It just makes my code look so much nicer and easier to read.

I’ve typically used Verdana as my font of choice, but since I got a copy of the Vista beta, I’ve started to use Calibri. Calibri seems a bit easier on the eyes than Verdana (which is saying quite a lot – Verdana is a nice font to begin with!) there’s just a couple of drawbacks.

First of all, the capital “O” lowercase “o” and zero “0” all look very similar. But that’s not usually a problem, since my numbers are coloured different to identifiers anyway, and ReSharper can find the different between upper- and lower-case “o” for me.

But the real problem is that Calibri contains ligatures for characters sequence “fi” and for some reason, Visual Studio considers the ligature to be a single character. Observe the following code-snippet, presented in Calibri:

Code snippet, showing the “fi” ligature

If I press backspace at the point where the cursor is right now, it will delete both the “i” and the “f” because Visual Studio considers them to be a single character.

Now, I know “why” it’s doing it – it does it because if you type “e” followed by U+0301 (COMBINING ACUTE ACCENT) you get a character which looks like “é” and pressing backspace would delete the whole thing, not just the acute accent (though in some contexts, it does make sense to just delete the accent). So Visual Studio is just considering the “fi” ligature to be the same sort of thing as a combining accent. But it’s not!

This is clearly a bug in Visual Studio, and I’ve submitted a bug report, so please vote for it :)

It’s going to take how long to delete!?!

Posted by

I was trying to delete the Windows.Old folder that the Vista Beta installer creates (containing my old Windows, Program Files and Documents and Settings folders), just to create a bit of extra space. I don’t know if there’s a “better” way to delete it, but I just tried deleting it from Explorer.

Well... after about 10 minutes of “calculating time remaining” it popped up with this:

Worrying Vista progress dialog

7 days?! To delete a fair number of files, to be sure, but come on! Needless to say, I clicked on “Cancel.” I suppose I’ll delete it from the command prompt now, eh?

P.S. I promise to have more content than just my rantings soon ;)

ActiveSync and the number of threads in wcescomm.exe

Posted by

Am I the only who hates Active Sync? It’s the most intrusive piece of software ever. Not so much in terms of the UI (which is actually nice and simple) but just in terms of the fact that it seems to tightly coupled to the operating system. I mean, I’ve already explained how I hate programs that ask you to reboot when they update themselves – especially when they’re not an integral part of the operating system.

So why would Active Sync be any different? I remember when I installed the latest version, it apparently even updated my USB drivers! What would the USB drivers have to do with a program that just sits on top of USB?

Anyway, I was looking through Process Explorer the other day and I noticed something else:

wcescomm.exe in Process Explorer

Why on Earth would it need 131 threads? Looking on the Properties page in Process Explorer, most of those threads seem to blocked on a call to accept() - so why is there so many of them? You only need one thread (maybe two) in an accept() call, so why do they have almost 100? It’s insane!

Also notice the Virtual Size column – it says wcescomm.exe is using 180MB of Virtual Memory. Can you guess where most of that is going? The default stack size in Windows is 1MB, and every thread has their own stack... so 131 x 1MB = 131MB just of stack. And since most of the threads aren’t doing anything, that’s 131MB of wasted space!

I just don’t get it. I mean, Active Sync should have been a very simple application. All it needs is a simple interface for applications (like Outlook) to plug into, to provide synching of their address book and so on, and then another custom process on the Windows CE device to handle that end of the communication. I know it’s got some Internet pass-through features as well, but again, most of the work for that would be done on the device, surely.

So why does Active Sync have to be such an intrusive, memory-hogging dog?

More Frustration with SQL Server 2005 Management Studio

Posted by

I’ve commented in the past on some of my frustrations with SQL Server 2005’s “Management Studio” and here’s another one I found.

You see, they’ve had some good ideas in terms of the UI with the management studio, but like I said in that previous post, it just seems like they never bothered to finish anything (or, they never had time to finish everything, which really amounts to the same thing – after all, there’s already been a service pack, so why were all these things fixed in that?)

For example, sometimes when you do something involving a database operation, it pops up this dialog showing the progress and the steps it’s taking (other times, like I said before, it just does it in the UI thread and you just get a big long pause). This is great, until you get something like this:

Crappy SQL Server 2005

Now, it was hard for me to tell what it was actually doing, and that dialog sat there for about 5 minutes with all it’s buttons disabled and no actual progress before I got bored and killed the whole SqlWb.exe process (I couldn’t even figure out which “process” in SQL Server it corresponded to, because none of them seemed to be doing anything).

Some of my co-workers have even gone so far as to forego the IDE and just use Query Analyser from SQL Server 2000. I must say, it’s starting to seem more and more tempting...

Strangeness in Vista

Posted by

Something funny I noticed in Windows Vista. Their “Connect to a Wireless Network” dialog works a little funny. Take a look, if I open it one way, I get this:

Network Connections - Click for fullsize version

If I open it another way, I get this:

Network Connections - Click for fullsize version

spot the difference? Ignore the fact that there’s an extra network (they seem to come and go around my house), and realize that this is a non-resizable dialog... the second one looks like it’s ignoring my DPI settings (at least in the bottom-half – the title is properly scaled).

It’s just something I noticed about Vista – it seems to be a lot less High-DPI friendly compared to Windows XP. Which is odd – surely the number of people with high DPI displays is increasing, making it more important? Oh well, I guess this is beta software!

While I’m on this subject, they also have this “new” method for doing high DPI where they basically just scale the whole window’s bitmap to match the DPI of the display. But it’s absolutely horrible and I switched back to “Windows XP-style DPI” as soon as I found the option, which didn’t try to out-smart the application. You see, 90% of applications written with the Win32 API “just work” in a higher-DPI (because dialog templates are specified in “dialog units” which are DPI-independent). The “new” method has to be turned off on an application-by-application basis, and it’s a real PITA. Anyway, it’s usually only those crappy “skinned” applications which don’t work properly (some do, like Windows Media Player). But I try to avoid those as much as possible...