Notepad2 Regular Expressions

Notepad2 is an excellent lightweight text editor for Windows – but I had some problems figuring out how to use Regular Expressions to find and replace some repetitive HTML code in a web page.

The code looked like a lot of rows and I wanted to put the link text into the title attribute:
<ul>
<li><a href="some url" title="">Swindon</a></li>
</ul>
A standard perl type regular expression would look like:
search: title="">([a-zA-Z]+)<
replace: title="Homes in $1">$1<

In Notepad2, you have to use a backslash for the backreference:
search: title="">([a-zA-Z]+)<
replace: title-"Homes in \1">\1<

This worked great for me, just a pity they couldn’t have stuck with the dollar sign and done it the way most developers are used to coding.

Run Scheduled Windows VBScript tasks silently

Here’s a quick one.

If you need to run scheduled VBScript tasks on a Windows server, and you don’t want an annoying Command Prompt window popping up every time the task runs, select the task from Start / Control Panel / Scheduled Tasks

In the run setting, make sure that you are specifying the Windows Script Host wscript.exe before the name of your script e.g. wscript.exe “C:scriptname.vbs”

That’s all there is to it.

How to make Nacho Cheese

Here’s a very simple way to make some half decent Nacho Cheese using ingredients you may have at home.

Take a jar of salsa and some cheddar cheese, mix in a ratio of 2 parts cheese to 1 part salsa (e.g. 200g cheese to 100g salsa).

Microwave until the cheese has melted, remove and stir.

VirtualBox 64-bit guest support using an Intel Core 2 Duo processor

2d_62I was hoping that I would be able to use 64 bit Ubuntu and Centos as virtual machines in Sun’s free VirtualBox software on my desktop PC that has an Intel Core 2 Duo processor – after all it is 64 bit. But I’m only running 32 bit Vista.

This shouldn’t have been a problem with VirtualBox.

However, it turns out that a small selection of Core 2 Duo processors aren’t able to do this. The processor needs to have hardware virtualization support, which Intel has termed VT-x or ‘Intel Virtualization Technology’.

List of Core 2 Duo processors and support for VT-x

Anyway, I’m unlucky as the E4300 is one of the very few that don’t support this feature, so I can’t run the 64 bit versions.