They say you learn something new every day.

Archive for the ‘Lessons Learnt’ Category

WordPress Edit Links (11/06/2017)

I haven’t done this for a while now, but I was thinking about where to store some useful nuggets I’ve come across while learning WordPress and it occured to me that that is exactly what this is for.

In WordPress, there’s a button at the bottom of articles that, if you’re logged in, gives you quick access to edit the article. It uses this function:


It’s all very, but what if you want to change what it says?

Turns out, it’s easy enough:

edit_post_link(‘New text’)

I’m impressed by how good the WordPress documentation is actually – especially since a lot of the code is horrible old php.

Dynamic Vbscript Arrays (25/06/2013)

For some reason, you can’t do this in vbscript:

x = 15 
Dim demoArray(x) 

It throws this error:

Microsoft VBScript compilation (0x800A0402) 
Expected integer constant

Instead, you have to do this:

x = 15 
Dim demoArray() 
ReDim demoArray(x) 

MOVs in Sony Vegas (26/05/2013)

I use Sony Vegas for video editing. It’s a great application: really simple, and somehow much more intuitive than Premier Pro or Avid.

By default, when you install it on Windows, it can’t read mov files, because Windows doesn’t come with the driver, so, sadly, you need to install Quick Time.

For some reason though, at least with my version of Sony Vegas (8), there’s a problem with the latest version of QuickTime, and Vegas can only get the sound, not the video from MOV files.

The solution is to install an old version of Quick Time. I’ve used 7.62 in my latest project, and that worked fine, so anything older than that is fine. 

Vbscript line breaks (03/02/2012)

Usually, in vbscript, a line break is


 But that’s actually a new line and a carriage return, so to be on the safe side, if you want to get rid of line breaks, it’s best to also remove:




Extracting Files from VHD (13/01/2013)

Still messing around with Virtual Hard drives today, I needed to get a large file off of a VHD (and actually, I needed to add a file to it as well).

I always find virutalisation a little tricky, but discovered today you can add VHD files as virtual hard drives in Windows 7.

Just go to Computer Management, then click on Disk Management On the Action menu, select Attach VHD and you’re away. It’ll appear in My Computer, like any other drive.

Compacting Access without Access (10/01/2013)

I needed to compact an Access database on a machine that doesn’t have Access installed.

It turns out there’s a Microsoft command line tool that can do this quite easily:

The syntax is quite simple:

jetcomp.exe -src:”C:\database.MDB” -dest:”databasec.MDB”

Pinning to Start Menu (09/01/2012)

It’s always annoyed me that some items in Windows 7 wouldn’t allow you to pin them to the start menu. It turns out, if you hold down shift while you right click you get the option to pin anything to the start menu.

I feel silly now for not knowing that. 

Tag Cloud