This is how you pop the question

On Wednesday, May 23rd, 2012, I told my girlfriend to meet me at my parent’s house for dinner. When she arrived I had stationed my brother to sit her in the back of an open Honda CRV and give her some headphones. He “wanted to play her a song”…

What she got instead was the world’s first Live Lip-Dub Proposal.

Damn onions.

No. I am your father

Happy birthday Star Wars! Apparently you’re 35 today! I’m not a fan of you though. I only saw this scene in French while I was an exchange student in the town of Morlaix in Brittany many years ago and other films I saw in English had such wooden acting I had to stop watching. My son is a fan though but only from the Lego games. In a bizarre twist, he knows the main characters yet hasn’t seen the movies.

Even though I never saw this scene in English I still thought the quote from this scene was, “Luke, I am Your Father”. It’s so famous, it’s listed on this page of misquotations!

Lots of mattresses too. Love that. Comfy. (via)

(Thanks C_64 for tweeting about the birthday!)

Mount box.net drives in Linux

I was one of the lucky few to receive a 50GB upgrade from box.net, (or box.com where they now live, marketing fail?) when I installed their Android app. I don’t have a use for that much storage on my phone but on my desktop machines? Oh yes!

This forum post describes in detail how to mount a Box drive on a Debian/Ubuntu machine although the instructions will mostly apply to other systems too as long as they have the davfs2 package.

There is a gotcha. Instead of using http://www.box.net/ you can use https://www.box.com/ which is a good gotcha. Also, I’m not the only person to notice that the mount point has a lot less storage than I thought it would have. It should be 50GB total but this is what I see from df -h:

https://www.box.com/dav 26G 13G 13G 50% /mnt/box.net

It’s enough for my needs. I’m going to copy snapshots of my local email there every night.

PS. Are you a Windows user? Sync any folder with Google Drive using the instructions here (but it uses “hardlinks” which have limitations, read the comments for more).
Actually, forget what it says in that post. Copy your files to your Google Drive and then place a symlink on your local drive to the copied files or folders using mklink. Make sure you run cmd.exe as an Administrator. I found this worked perfectly to sync the Pictures folder after I had copied it to my Google Drive:

cd c:\Users\USERNAME\
mklink /d Pictures “c:\Users\USERNAME\Google Drive\Pictures”

Any files copied into the Pictures folder are copied to the Google Drive now!

WP Super cache 1.1

This is a bugfix release of the full page caching plugin WP Super Cache for WordPress.

Not much has changed in the week or so since I asked for testers but in case you missed that post here are the changes since 1.0:

  • Use $_SERVER[ ‘SERVER_NAME’ ] to create cache directories. No more non existant blogs appearing in your cache supercache and blogs folders.
  • Only create blogs cached directories if valid requests and blogs exist.
  • Only clear current blog’s cache files if navigation menu is modified
  • Added clean_post_cache action to clear cache on post actions
  • Removed garbage collection details on Contents tab
  • Added wp_cache_check_mobile cacheaction filter to shortcircuit mobile device check.
  • Don’t delete cache files for draft posts
  • Added action on wp_trash_post to clear the cache when trashed posts are deleted
  • Show a warning when 304 browser caching is disabled (because mod_rewrite caching is on)
  • New check for safe mode if using less that PHP 5.3.0
  • Added wp_supercache_remove_cookies filter to disable anonymous browsing mode.
  • Fixed garbage collection schedule dropdown
  • Fixed preload problem clearing site’s cache on “page on front” sites.
  • Fix for PHP variable not defined warnings
  • Fixed problem refreshing cache when comments made as siteurl() sometimes didn’t work
  • Preloading of taxonomies is now optional
  • Domain mapping fixes.
  • Better support for https sites. Remove https:// to get cache paths.
  • Added AddDefaultCharset .htaccess rule back in and added an option to remove it if required.
  • Added multisite plugin that adds a “Cached” column to Network->Sites to disable caching on a per site basis.
  • Added WPTouch plugin to modify browser and prefix list in mobile detection code. Added support for that plugin’s exclude list.
  • Fixed cache tester
  • Filter the tags that are used to detect end-of-page using the wp_cache_eof_tags filter.
  • Removed debug level from logging as it wasn’t helpful.
  • Removed mention of wp-minify.

As ever, the support forum is the best place to go for help as I monitor it all the time. Before you post there use Google to search for any error strings and use the debug system in the plugin as it will probably tell you what’s going on.

My early memories of programming

My earliest memories of programming are directly related to the pain of not being able to save my work.

The first proper computer my family owned was a Commodore Vic-20. I guess my parents bought it in 1984 or 1985 but it might have been earlier. The Vic-20 came out years before but this was recession hit 80’s Ireland. I’m pretty sure the computer was bought in O’Callaghan’s shop, where the betting shop is now on Pembroke Street.

I remember copying a flying bird BASIC listing from the Vic-20 manual one school morning, and I think I made it fly left and right too. What made it stick in my mind was the anguish I felt because I couldn’t save it. We had a Vic-20 you see but we didn’t have a datasette that could record or play back data on cassette tapes. I left the machine on while I went to school which was risky because they had huge heavy power supplies that had a tendency to overheat (not that I knew that then!) Thankfully we did get a datasette later because I remember playing Wacky Waiters on it. Or it might have been some sort of interface that let me plug a regular cassette player into the Vic-20. Chip Electronics sold them in clear plastic bags I think. All a little hazy now unfortunately!

So, thanks to this site I was able to track down a scanned copy of the Vic-20 manual and immediately jumped to the Flying Birds bit. A little bit of rose tint nostalgia on a murky Friday evening almost 30 years later.

What got you into programming?

Fatal error: Allowed memory size of 67108864 bytes exhausted

WordPress uses memory. Plugins and themes use memory. New versions of software may use more memory than before. When that happens and PHP on your server doesn’t have enough memory then PHP will stop with a fatal error like this:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 1203208 bytes) in /home/*****/public_html/wp-admin/includes/class-pclzip.php on line 4215

This happens quite a bit but it’s not a bug in WordPress or your new plugin or theme, you simply need to let PHP use more memory on your server. Thankfully WordPress makes it easy to do this. You must define a constant, WP_MEMORY_LIMIT in your server’s wp-config.php like this:

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

The error message will give you an idea of how much memory is required. The error message says it tried to allocate 1203208 bytes or just over 1MB of memory. The limit here is 67108864 bytes, or 65536KB which is 64MB so here I’d need a WP_MEMORY_LIMIT of more than 66M. The error message will go away once PHP has enough memory but be sure to test it.

If you allocate too much memory your server could start eating into disk swap space. Also be aware that each Apache child process is allowed to use that much memory so if you had ten processes it could use ten times the memory limit in a worst case scenario. If that happens you’ll need more RAM or you’ll have to figure out what’s using so much memory.

There’s also a WP_MAX_MEMORY_LIMIT constant. By default it’s 256M and it’s currently only used when uploading images.

On the off chance that you don’t have WordPress installed and you came here from a search engine, then you’ll want to use ini_set() somewhere early in the PHP process to increase the memory limit:

ini_set(‘memory_limit’, ‘128M’);

Finally, I love that the wp-config.php codex page is the first result of a search for WP_MEMORY_LIMIT.

The amazing self charging Android phone

image

Some things never change. Both Android phones I’ve owned (Samsung Galaxy S 1 & 2) have this weird bug where the phone turns itself off and when reset by removing the battery the charge level has gone way down.

I woke early this morning to discover the PIN unlock screen so I guessed the phone had rebooted. When I checked the battery levels I saw this. The battery suddenly lost a huge chunk of charge sometime during the night but over the next few hours seemed to recharge itself.

I’d say it’s magic.

Robot Enrichment

I just noticed that Portal 2 now has a store where you can modify your robot. I like the way Valve monetize their games. They bring out free DLC, expanding older games with updates and offering them either free (TF2) or at a steep discount. Then they encourage you to buy hats and personalise your character! Nothing like some of the other grind to play free games I’ve played elsewhere.

Two games spring to mind, both free Android games. Samurai vs Zombies and Garfield Defense. Both play in exactly the same way even though they are apparently by different developers. I swear they used the one game engine and just swapped out graphics and sound.

In both games you collect coins to purchase power ups but those purchases are fairly pricey and by the time you get to level 10 you’ll need to grind and play the level 4 or 5 times to get enough coins to buy an upgrade to finish the level.

Still, not a bad way to spend a few minutes while waiting for the bus or something but to be honest I’d rather use my phone to read a book!

I almost forgot to mention the iOS version of Plants vs Zombies. It received a few updates recently which added the ability to plant flowers that reward you with silver and gold. I only tried it briefly but soon discovered that you need to use fertilizer or the plants will wilt. Of course you have to use real money to buy the fertilizer. *sigh*