Summing up times in Excel

It’s the small things, sometimes – something I never needed to do in my old jobs is calculating with time. One very simple task is to just add up a set of times – Excel will “wrap around” at 24h:

There’s a simple solutions for this problem. Just surround your hours with square brackets when formatting the cell, like so:

Works like a charm:

Times wrap around

25h not 1h

🙂

WordPress Image Scaling Incorrect

I just noticed that WordPress is not resizing images correctly: It would appear correct in the blog itself, but the IMG SRC tag would link to the original, unscaled image: This meant that the image was downloaded at the maximum size and scaled on the client side. I never really noticed this because modern PC’s – even my outdated one – have enough processing power to just do it on the fly and browsers use quality scaling filters that smooth out the pictures.

Still, it makes the site unnecessarily slow. After some investigation, I found out that it looks like WordPress uses 32MB of memory by default – and that’s really not much.

Editing your wp-config.php file, you can add the line:

define(‘WP_MEMORY_LIMIT’, ’96M’);

to increase the limit. I decided on 96MB for a start, but maybe 64MB will be enough for you – I’ll leave that to you.

Anyway, now WordPress scales images I upload correctly. It won’t fix older images, but I can live with the big pictures in my archives.

Postfix error – fatal: parameter “smtpd_recipient_restrictions”

I encountered this error when I added a check_sender_access clause to my smtpd_recipient_restrictions in postfixes “main.cf”:

fatal: parameter “smtpd_recipient_restrictions”: specify at least one working instance of: check_relay_domains, reject_unauth_destination, reject, defer or defer_if_permit.

I haven’t really checked, but I am guessing this is because smtpd_recipient_restrictions as the last clause isn’t specifically rejecting all mails that aren’t wanted, and so you risk turning your system into an open relay. I did as the error advised, adding reject_unauth_destination to my restrictions, and all was well.

Cube Root in OpenOffice

OpenOffice.org doesn’t seem to have any built-in functions for cube roots, but there’s an easy workaround. To find the nth root, use powers to the nth fraction. Probably easier to illustrate than to explain with my rusty math skills. 😉

I mean this:

You need to use the brackets because otherwise the power would take precedence over the division.

Setting Sender Address in Mutt

I’m a Pine user. I seriously dislike mutt. It’s terribly uncomfortable to use. But it is maintained, and luckily it’s quite flexible and can be changed in how it acts. I’m trying to get by with mutt… and it’s a slow process, one step at a time.

First annoyance, by default it uses my machine name in the from address. The fix is easy enough. Open your .muttrc and add or change:

set realname=”Your Name”
set from=”mail@example.org”
set use_from=yes

That’s that.

Turning off Date conversions in OpenOffice.org

Yesterday, I had the problem that a number range I entered in a table (“3-4”) was changed into a date by OpenOffice. Never saw that happen before, I think it must be a new functionality. I tried to switch it off but found nothing in the Auto Correction options. The developers put the option in a weird spot:

  • Right click on the table
  • Click the “Number recognition” menu item to deactivate it

A loud “Hooray” for weird defaults.