matthew's blog

Computer waking up from hibernate

windows

Despite hibernating my Windows 7 laptop at night, I kept finding it up and running in the morning. Turns out there's a simple fix for this...

A cheeky way to use .NET code contracts for logging

programming

Today I discovered a nifty use for code contracts: logging return values (even when a method has multiple return points). Read on to find out more...

Resurrecting my "lost" Delicious bookmarks

If you used the Del.icio.us bookmarking website and accessed it via your Yahoo! account, you might well have lost access when the website was transferred to its new owners (i.e. if you didn't opt in to have your account transferred across). Read on to find out how I backed up my bookmarks and transferred them to a new service (Pinboard) even though the new Delicious.com wouldn't let me log in.

Simplicity in programming: a review of ACCU 2011

programming

I recently went to the ACCU 2011 conference, for programmers who believe in ‘professionalism in programming’. There was an eclectic programme of talks, but I was struck by how often the presenters had something interesting to say about one topic in particular: simplicity. Rather than write up the individual presentations, I thought it would be more interesting to write about what was said about simplicity.

Line spacing blocks of paragraphs in HTML with CSS

Suppose you have a note class in HTML. A note can have one or more paragraphs.

<p>This is not a note.</p>
<p class="note">This is the first line of a note.</p>
<p class="note">This is the second line of a note.</p>
<p>Back out of the note again.</p>

Here is a CSS snippet you can use if you want to add margins to separate the note from the surrounding text without affecting the line spacing of the note itself (and adds some sensible page breaking behaviour).

Preventing "Command Not Found" errors when changing Word's headers/footers in VBA

word2007

I found various threads on the Web from people complaining about Command Not Found errors when using macros that change Word's headers and footers.

I didn't find any solutions, but think I have an answer. Read on to find out more.

Tip: Clickable tables of contents when publishing to PDF from Word 2007

word2007

If you have a Word 2003 or earlier document with a table of contents, you might expect the ToC to behave as a series of hyperlinks when you save the document as PDF, so you can click an entry to jump to it.

If this doesn't happen (i.e. the ToC appears as plain text in the PDF), try editing the ToC so that Use hyperlinks instead of page numbers is on for the web view. Then when you publish to PDF you should find that the links work as expected.

Running Office applications as a service on Windows Server 2008

excelword

Having difficulty running Word or Excel as an unattended scheduled task on Windows Server 2008? Does the process keep dying? Here's a simple solution.

XSLT Gotchas

Not for the first time I've been caught out when trying to do simple XSLT to pick information out of XML files. Hopefully this is the last. I'm blogging this so I can refer to it again later. Hopefully it will be useful to you too.

Simple time logging in Excel

excelproductivity

Sometimes, when I'm working on a project, I need to keep stopping and starting. Although I've used various stopwatch programs in the past, these days I often just write down the start and end times of each batch of work and then work out the total later.

Read on for details of how I use Microsoft Excel to work out the total, even if I work over midnight.

Syndicate content