Ghosting a Windows Vista Home Premium Installation

My Windows Vista Home Premium installation was on one of the Seagate 7200.11 drives with the bad firmware, so I’ve been trying to do something about it for a while now. This weekend I used SelfImage to copy my installation from one drive to another via my windows XP machine. After 12 hours of waiting (plus a day of failed attempts), I finally got it copied over. The new drive refused to boot, saying something about winload.exe, but it suggested putting in my installation disc and repairing the installation. After doing that, I allowed Vista to run chkdsk. That took about 5 minutes.

So far, things seem to be running smoothly. Not bad, Microsoft.

February 15th, 2009 | Mental Note: Add Category | No comments

Using XPath to find email address links

I wanted to write a Greasemonkey script to modify all mailto: links on a page, but to do that, I have to find them first.

Here’s my first attempt:

//a[@href]/text()[contains(.,"@")]

It’s pretty bad. I wanted to find links starting with “mailto:” but couldn’t figure out how to operate on the href attribute.

second attempt:

//a/@href[contains(.,"mailto:")]/..

Here you can see that I managed to operate on the href attribute, and then back back up to the a node. I learned how to select the attribute, instead of using the attribute to select the node.

third attempt:

//a[contains(@href,"mailto:")]

Simplified even further!

fourth attempt:

//a[starts-with(@href,"mailto:")]

I knew there was a starts with function… I just had to look it up.

February 11th, 2009 | Neato!, Nerd | No comments