“Object doesn’t support this property or method” JS error

February 25th, 2009

This drove me mad for about an hour tonight. Had some Javascript that worked fine in Firefox but completely collapsed in IE.

Apparently IE is very picky about JSON declarations, so a spare comma at the end of a line caused a lot of trouble!

Also, I had a page that was looping through a query and for each iteration was dumping some JS to the page (bit messy, don’t ask). IE 7 was giving me an “Operation not permitted” error and refusing to load the page. Turns out this was caused because the JS was being executed as the page was loading and for whatever reason IE didn’t like it.

Wrapping

$(document).ready(function() { //code }

around my code block made it execute when the page was loaded which seems to have sorted it out.

3 Weeks in America

February 2nd, 2009

As we’re in February now I really feel like I should give an update! Been in the US of A for 3 weeks, although it feels like a lifetime ago I boarded the plane at T5.

I can’t say too much right now about what’s going on (quasi-stealth mode), but here are some highlights so far.

  1. Had dinner with the Twitter founders and one of the Youtube founders. Met loads of really interesting people too.
  2. Sampled the US healthcare system. On the second day here I cut my finger open. 5 Stitches later it’s all good. Impressed with the service.
  3. Discovered ‘In n Out Burger’, the best fast food I’ve ever had. Munching a lot of Taco Bell too. Feel kinda sad they don’t have these in the UK.

The weather is also good - the middle of winter in the Bay area is about the same as the middle of summer in the UK. As I hear it’s currently snowing in the UK, I really feel like I’ve bucked winter this year and I should be able to maintain a cool 20 degrees C until around September.

The next few weeks are going to be busy ones. Lots of work to do, places to go and people to see but no doubt it will be a blast! Until then…

Postfix / PHP / Google Apps

February 2nd, 2009

I just want to quickly jot down for my own reference (and for anyone else who is having this problem) how I got email to send on CentOS with Postfix. The situation was as follows.

I’d setup a new server and was running a simple LAMP stack for a new domain. I need to send email through PHP, but I’m not terribly interested in running a full email service off of this machine for the few user accounts we have. So I offloaded all of the inbound mail stuff to Google Apps which is working great. If I emailed myself from another server things worked fine, but if I tried to email myself at ‘mydomain’ through PHP I wouldn’t receive the mail and Postfix complained with:

postfix/error[9490]: D959A48368: to=<apache@mydomain.com>, relay=none, delay=0.25, delays=0.04/0/0/0.21, dsn=5.0.0, status=bounced (User unknown in virtual alias table)

After a little bit of head scratching and Googling the problem became clear. In /etc/postfix/main.cf there are two directives that need paying attention to. These are mydestination and virtual_alias_domains. I had to add virtual_alias_domains to the bottom of the file and I set both of these to have blank values.

mydestination =

virtual_alias_domains =

Essentially postfix was seeing that I was trying to email the machine it was sending from. It would then try and look up the user on the system which didn’t exist and then moan. Setting mydestination and virtual_alias_domains effectively told postfix to keep on looking for the mail server, ’cause it ain’t here.

If this is a dirty hack and there’s a more elegant way to do it then let me know, I’m no postfix expert. I’m just happy it works (finally!).

2008 Roundup

December 29th, 2008

2008 can be described in a single word: cracking! It’s been a busy year and has flown by. I’m going to sum it up quickly here for anyone who’s interested and also for my own future reference.

In a nutshell

I lived in Fleet, Hampshire for 6 months of the year before moving back to Kent. At the end of August I finished my 13 month internship at Sun Microsystems with the intention of going back to uni. This was short lived. I dropped out to “live the dream” which took me to San Francisco in November where Shazz and I secured seed funding for our web company.

Union Square - San Francisco

In terms of travel I went skiing in France in February, had a summer holiday in Turkey and an unexpected two week stint in San Francisco and Vancouver in November. Memorable weekends away include Alton Towers in Spring and a visit to Thorpe Park in the Autumn. Sprinkled between those were many good weekends in Brighton, Fleet and Whitfield, spent taking walks and soaking up the sun and fresh air.

Our hotel garden in Dalyan, Turkey

Speaking of fresh air, I’ve racked up around 12,000 miles in my car this year, and around 13,000 air miles. As in 2008 everyone went green (and absolutely barking too), for fun I’ve calculated my carbon footprint at 5.8 tonnes of CO2, only on flights / car. Does anyone care to enlighten me as to whether or not this is a respectable figure, or even accurate?

It’s been a good one for personal gadgetry too. My phone contract came up for renewal right at the beginning of the year so I got myself a shiny Nokia N95. It’s not so shiny anymore but it’s still serving me well. With the addition of my new MacBook Pro I’ll probably have to go for an iPhone next time (just so everything matches you understand).

Philosophically, this year I’ve looked really hard into Advaita Vedanta (Non-duality) and foolishly tried to make some sense of it. At the peak of my involvement I had a million and one troubling questions about life, the universe and everything. Luckily, it doesn’t appear that the mind can sustain this for long and after relaxing and stopping the questions I feel much better. It’s very clear to me now that that the idea of an “I” is an empty concept, stuff is just happening with no one doing it (like asking questions and looking for an answer) and it’s much better just to chill out and enjoy the show.

2008 was also the year that I started taking mustard seriously, discovered the stress of freelancing/job/side projects and had my hair cut after 3 years of solid growth, much to the delight of my friends, family and girlfriend.

New Year’s Resolutions

Sitting round doing a lot of computer work (and to a lesser extent I’m sure, my high beer consumption) has taken its toll on my body and earned me the nickname “fatty” amongst various friends. Not that I mind a little bit of extra weight, but I feel I should keep it in check before it gets out of hand. Beer bellies never looked that great with chicken legs anyway, so losing some tummy chub is the first priority.

Secondly, I want to work better. Not necessarily much harder or for longer hours, but better so that when I sit down to do some work I’m productive and not reading the news procrastinating. I’m well aware that this problem is experienced by pretty much everyone everywhere, so I don’t expect to completely solve it within a year. However, I’d like to find some effective techniques for improving my productivity during my working hours so that I can maximise my downtime.

What’s next?

2009 is set to be even crazier than 2008. I’m moving to Mountain View, CA in early January for a few months so I’ll be out of the country for a quarter of a year. And then who knows? We’ll see what happens and I’ll try to keep this blog updated a little more.

XAMPP on OSX htaccess Problem

December 8th, 2008

I’ve just finished setting up my current web projects on my shiny new MacBook Pro. One of my sites was throwing a 500 internal server error which meant that something was up with Apache, or an htaccess file.

I rewrite the URLs with mod_rewrite so my initial suspicion was that mod_rewrite wasn’t enabled in httpd.conf. This turned out to be wrong as it was enabled and it didn’t matter what was in the htaccess file, it still threw an error.

To cut a long story short I changed this line in httpd.conf from this

AllowOverride AuthConfig

to this

AllowOverride All

and the problem went away.

Hopefully this will help anyone who is having a similar issue.

Living the American Dream

December 1st, 2008

<quasi-stealth mode>

Wowee! Three weeks ago myself and Shazz flew to San Francisco and explored the SF Bay Area in the hunt for a bit of dosh for our startup. I’m very pleased to report that we found it, so luckily it wasn’t a wasted trip.

This means that I’ve well and truly said goodbye to the world of academia for the time being as I’ll be heading back out to Mountain View to live for a while at the turn of the year. As dropping out has always been a dream of mine, this suits me down to the ground.

I’d love to share more here but for the time being we’re keeping things quiet. More will be revealed in due course (although probably not before Christmas, I’m rushed off my feet).

“Sitting quietly, doing nothing, spring comes, and the grass grows by itself”

October 16th, 2008

Twitter problems

October 16th, 2008

Twitter seems to be having a few problems this evening. This is what happened when I pressed update:

Looks like a pretty odd / interesting issue!

Very glad I didn’t invest in RBS

October 13th, 2008

I thought that RBS was a bargain a few months ago when it was going for ~165. Looking back now I’m very glad I steered clear!

Man’s Search For Meaning

October 5th, 2008

I’m really getting through books fast at the moment and I’ve just finished another brilliant one - Man’s Search For Meaning by Viktor E. Frankl.

This book is split into two distinct sections. The first is a very touching, inspiring account of the authors time in concentration camps during WW2. I found his analysis of the different psychological stages they went through really fascinating and the modest prose in which he spoke about his experience was humbling.

The second section is a summary of his philosophy of Logotherapy. Although this raised a number of insightful points, towards the end I realised that as I only have a passing interest in real psychology this section was largely wasted on me. Still, it’s not too hardcore and there’s plenty to take away from it.

So if you’re looking for meaning in your life, give it a read!