Skip navigation.

Syndicate

Syndicate content

User login

tech-diary

Annoyances in .NET XML libraries

At work I’m building a simple tool to populate a FogBugz wiki page with build information. One of the things this tool needs to do is pull the XHTML contents of a wiki page, parse it (as XML), and take action on the resulting document tree. Initially I expected this to be stupid-easy, as XHTML is just XML, right?

Au contrare!

Problem 1: XHTML is NOT just XML

The first problem is XHTML documents likely contain entity references like   and whatnot. These entity references aren’t XML entities, they’re XHTML entities, so you must load the XHTML DTD in order to resolve them. Trouble is, this means there must be a proper XHTML DOCTYPE directive in your XHTML (which there isn’t in my case since I’m using fragments).

Once a valid DOCTYPE directive is added to the XHTML, now .NET will download the full DTD from W3 just to parse a little XHTML fragment. Not acceptable.

Visual C++ Apps Crashing in _chkstk Under Load

At work one of the devs was running into a weird problem. He could run a group of our unit tests on his dev box without any problem, but when the same tests ran on our build machine the test host process crashed with an unhandled exception. Thankfully we run all of our processes with an unhandled exception trap which generates a minidump before terminating, so we were able to determine the failure was in a C runtime function _chkstk called upon entry into a particular function that allocates alot of stuff on the stack.

At first, I was thinking stack overflow, but there wasn’t anywhere near 1MB of shit on the stack, which is the default maximum stack size. I thought about stack corruption, but the C-runtime stack checking routines provide an explicit message when stack corruption is detected.

Getting latest XP x64 ATI Catalyst drivers for Mobility Radeon hardware

I just repaved Wyoh with Windows XP Professional x64 Edition, since I wanted a 64-bit OS and there’s no fucking way I’m running Vista on my primary dev laptop. I’ve been running XP x64 at work for a while, but my work box has shit on-board graphics so I never had to seek out the latest ATI drivers for a 64-bit XP install. Wyoh on the other hand has an embedded Radeon Mobility X1800 graphics board that really needs ATI’s latest drivers.

Apparently the OEMs that license the Mobility Radeon chips don’t like ATI providing the latest and greatest Catalyst bits online, since dumb users could download them before the OEMs have a chance to verify them, thus marring the user experience and (more importantly) costing said OEM a support call. Lame!

Fortunately, there’s a workaround.

PHP Sucks

My work on a tool to migrate Drupal content to Wordpress’ eXtended RSS (‘WXR) led me into some dusty corners of the WordPress codebase, and I’ve been meaning to write a grumpy post about how much I hate PHP (in which Wordpress is written), but Jeff Atwood at Coding Horror beat me to it with his own PHP sucks lament. Like me, Jeff wonders at the success of PHP given what a dreadfully sucky software engineering tool it is, and scratches his head at the many major Internet properties (Wikipedia, Digg, and Wordpress among them) which are successful notwithstanding an implementation in a language a VB6 programmer might reasonable call “shit”.

Interestingly, though, Jeff and I arrived at two different conclusions on the matter. Jeff surmises:

Some of the largest sites on the internet — sites you probably interact with on a daily basis — are written in PHP.

New Windows Media Center System

For a few months now I’ve been running Vista and Windows Media Center on prospertine, hooked up to a nice widescreen LCD monitor mounted to the wall in my bedroom. Whenever I want to watch movies or TV shows and I’m not working in my office, I play them on ‘prospertine’ over my GigE network from my NAS box. I even have the Vista IR remote control, and a nice little wireless keyboard complete with a trackball. I can sit back on my bed and watch my media and even do basic web browsing.

However, prospertine is four years old, and has some serious thermal issues which cause the ICH6R chipset to ‘forget’ about one of the drives in its RAID 0 volume from time to time, which causes the system to crash. I then have to turn it off and let it cool before it will work again.

Worst C/C++ Gotcha Yet

Today I ran smack into what is easily the nastiest C/C++ gotcha of my entire software engineering career. From the early 90s reading Sam’s Teach Yourself C in 21 Days with a shitty freeware C compiler from a local BBS, through to today, I have been bit by just about every imaginable C and C++ gotcha, but this one takes the cake.

If you see what’s wrong with this code, you’ve been bitten by this before:

UINT32 x = 0x80000000;
UINT32 y = 2;
UINT64 z = x * y;
cwout << L"x*y=" << std::hex << z << std::endl;

If you think this code will output 0x100000000, you’ve not been bitten by this before.

You see, 2 times 0x80000000 is 0x100000000, which is 2^32 in hex. Unfortunately, since both x and y are 32-bit unsigned integers, the result is a 32-bit unsigned integer as well, implicitly cast to a 64-bit unsigned integer only after the computation is performed.

Upgraded to Slickedit 2008 after fascism false alarm

Not long ago the makers of SlickEdit, my favorite programmer’s editor, released the new version, SlickEdit 2008. Since I have an active maintenance and support contract, I got the upgrade free (although it took a few days of support hell to figure out how to get my updated 2008 key).

As a long-time SlickEdit user (I first used Visual SlickEdit 2.x back in the late 90’s) I am used to the painless upgrade process, but this time was different. This time, when I launched Slickedit for the first time, it wanted to activate! As in, Microsoft WGA Fascism Lives DRM Bullshit! From Slickedit of all people!

Lesson Learned: Deleting stuff from SVN is a pain

Recently it came to my attention that I accidentally committed some sensitive information to my SVN repository. I had already deleted it months ago, but as those of you who use SVN well know, nothing is ever really gone from SVN; any deleted items can always be recovered from the previous revisions in which they were not deleted. What to do?

Well, not surprisingly, I’m not the first person to have this problem. The SVN book describes the solution, and it’s not pretty. I’ll summarize:

  • run svnadmin dump on your whole repository
  • run svndumpfilter on the dump file to filter out specific path prefixes
  • delete and recreate your repository, or create a new one to contain the modified dump
  • run svnadmin load on the dump file output by svndumpfilter

If you’re lucky you have a very small repository like I do, and this only takes a half hour or so.

Kneecapped by major DreamHost outage

The hosting provider for apocryph.org, DreamHost, is experiencing a serious outage that has resulted in apocryph.org sucking serious wind and/or being completely offline. DH’s latest claim is a fix from their storage vendor will cure all ills, but this has been going on for a week now so it’s hard to imagine a QFE from a vendor will just make it vanish.

Anyway, I probably brought this down upon myself, since I went from fairly-cheap-but-still-shitty CI Host to considerably-cheaper DreamHost, based on the promise of ridiculous expanses of disk space and lavish transfer quotas.

(Still) Looking for a Senior Developer

A while back I was looking for a senior-level developer to join our team at AppAssure Software. I’m still looking. I’ve rewritten the job description a bit in the hopes that will help me find the right candidates.

My company, AppAssure Software, is looking for another senior level developer to join our development team. AppAssure is a rapidly growing software company with consistent revenue growth building cutting-edge Windows software products used by organizations of all sizes to protect their most mission-critical IT assets. The Reston-based development team is lean and results-oriented. We’re looking to add another senior level, well-rounded developer with impeccable software engineering skills.

We’re trying to find an experienced software engineer with soup-to-nuts product lifecycle experience and strong C# and C++ skills.

Syndicate content