A new way to find furniture

In February of this year we invested in a startup called Furnish.co.uk, and I’m pleased to say that as of yesterday they have now gone live with their sleek new website.

furnish screenshot

Furnish.co.uk, as it’s name suggests, is a new way to find and buy luxury home furniture online. The site acts as a shop window for a variety of boutique stores and exclusive designers, allowing you to compare a huge range of options in one place. So if you were decorating a new bedroom, and wanted to find the perfect bedside lamp, Furnish.co.uk would let you drill down to the exact style you wanted – you can filter by price, colour, material, and size.

Furnish is aimed at the mid to high end of the furniture market and includes products you won’t typically find in the major high street retailers. They are adding more products every day, and hope to include over 100 stores over the course of the next few months, so keep checking back!

Shared Calendars on the Mac & iPhone with Google Sync

Today I have been attempting to set up Google Calendar so that it automatically synchronises with an iPhone and also iCal on a Mac computers. It was a bit trickier than I expected, so here are some of my observations. Hopefully they will help someone else!

Google Sync 

Here are some of the main things you need to remember to do:

  1. Make sure you have enabled Google sync for mobiles in your Google Apps account. From your Google Apps Dashboard, click the Mobile link. Then tick the Enable Google Sync box on the next page and press save.
  2. Set up Google Sync on your iPhone to sync calendars and contacts from Google. Basically you just add a Microsoft Exchange account with your google apps login details, and then select calendars and contacts in the syncing options.
  3. You must also choose which calendars you want to sync to your iPhone via the Google Mobile website. Visit http://m.google.com in Safari on your iPhone.

iCal

You can set up iCal to subscribe to your Google Calendars via a caldav url. First you add a new account under preferences, and then under the delegation tab you select the calendars you wish to subscribe to.

Sharing Google Calendars 

You can share a calendar with other users in your google apps domain, or external users on other domains. There are various ways to do this such as sending a link to the ical url or sending an invite within the calendar sharing pages on the Google Calendar website.

How to upgrade iphone 3.0 beta to full official release

If you are an iPhone developer and have been running one of the beta versions of the 3.0 firmware then you might find that iTunes will not update you to the latest official 3.0 release, as it already thinks you are using the most recent version.

It’s taken me a while, but I’ve finally found out how to do it!

NB: Before you do anything, make sure you have backed up your phone in case something goes wrong!

  1. Download the latest firmware directly from Apple’s Content Delivery Network:
  2. The file may have a .zip extension, if so remove this by renaming the file so that it ends with .ipsw
  3. Open up iTunes, and Option-Click the restore button. You should then select the ipsw file you downloaded.
  4. Follow the on-screen instructions as it upgrades your firmware.

Warning – do this at your own risk. It may break your phone.

Testing the Yii Framework

Installing

First, download the Yii Framework to somewhere sensible. I prefer to use subversion to check out the code:

svn co http://yii.googlecode.com/svn/branches/1.0 /usr/share/php/Yii

This will take a few minutes. Once it’s done, you can use the Yii Command Runner (yiic) to set up your web application:

/usr/share/php/Yii/framework/yiic webapp /var/www/html/appname

If everything went well, you should be able to access your web app with:

http://hostname/appname/

You should see a screen like the following one:

yii-default-screen

Configuring

Set up the config script to be able to connect to your database.

/var/www/html/webapp/protected/config/main.php

Uncomment the DB section, and add in your database connection details:

'db'=>array(
			'connectionString'=>'mysql:host=localhost;dbname=http_auth',
			'username'=>'root',
			'password'=>'d2x@1A1!aa!a!',
			'emulatePrepare'=>true
		),

Developing with Subversion, Unfuddle and OSX

Today I’m going to be helping one of our investment companies, ByteWire set themselves up with a subversion based development environment for their Street Crime game. They will use a straight forward workflow whereby they will develop and test their code locally on their iMacs, commit working code to a subversion repository, and then check out code the live site when they are happy with it.

UNFUDDLE

We’re going to be using Unfuddle to provide subversion hosting, project management and bug tracking.

  • Create a free unfuddle account, e.g. Bytewire
  • Set up your first project e.g. Street Crime
  • Create a repository: http://bytewire.unfuddle.com/svn/bytewire_streetcrime/

LOCAL DOMAIN ON OSX

Set-up a local test domain on OS X

  • Add it to the hosts file
printf "127.0.0.1\tstreetcrime\n" | sudo tee -a /etc/hosts
  • This should now be accessible via http://streetcrime/

MAMP

MAMP is an excellent bundle of Apache, MySQL and PHP for use on Macs. These tools do come pre-installed with Leopard by default, but php in particular is missing a fair few modules which you can only really add by re-compiling – MAMP makes it a lot easier. It installs new versions of PHP, MySQL and Apache alongside the default versions (on different ports), so that both can be run at the same time.

    • Create a folder where the site code will be placed, e.g. /Applications/MAMP/htdocs/streetcrime/http/
    • Open up /Applications/MAMP/conf/apache/httpd.conf with a text editor.
    • Uncomment the NameVirtualHost line, and add a couple of news lines to define the new virtual host. It should look like:
NameVirtualHost *

<VirtualHost *>
DocumentRoot /Applications/MAMP/htdocs/
ServerName localhost
</VirtualHost>

<VirtualHost *>
DocumentRoot /Applications/MAMP/htdocs/streetcrime/http/
ServerName streetcrime
</VirtualHost>
  • Restart MAMP through the MAMP control applet or widget. You should then be able to access the site at http://streetcrime:8888/

INITIAL COMMIT OF CODE

  • Make the trunk folder inside the repository where your site code will initially be kept.
svn -m '' mkdir http://bytewire.unfuddle.com/svn/bytewire_streetcrime/trunk/
  • Check out the trunk to your project top level folder
svn co http://bytewire.unfuddle.com/svn/bytewire_streetcrime/trunk/ /sites/street-crime.com/
  • Check through the folder structure and look for anything that should be excluded:
du -h --max-depth=1 /sites/street-crime.com/http/
  • Edit the svn:ignore property
svn add /sites/street-crime.com/http/
svn propedit svn:ignore /sites/street-crime.com/http/
  • List the files & folders that you want to ignore, and then save and quit.
PSD
gangster-game-forum
gangster-game-wiki
gangster-game-blog
logs
uploads
  • Add the remaining files and commit (excluding uploads etc with svn:ignore)
svn add --force /sites/street-crime.com/http/
svn commit -m 'Importing main files'

CHECKING OUT CODE TO THE OSX DEVELOPMENT WORKSTATION

  • Change directory to the folder you set up locally for development.
cd /Applications/MAMP/htdocs/streetcrime/
rmdir http
svn co http://bytewire.unfuddle.com/svn/bytewire_streetcrime/trunk/ .

TESTING THE SITE

  • Visit http://streetcrime:8888/ – it showed a blank page for me. That would suggest error reporting is off, so enable in /Applications/MAMP/conf/php5/php.ini


WAMP SMTP Server – Send outgoing emails

If you are running WAMP and you want to be able to send outgoing e-mails via PHP’s mail function, then you will need to edit the php.ini file and change

SMTP = localhost

to

SMTP = smtp.yourisp.com

Replacing smtp.yourisp.com with the address of your ISP’s SMTP server, e.g. smtp.ntlworld.com. The php.ini is in the bin directory of the active Apache, which will be something like:

c:\wamp\bin\apache\apache2.2.8\bin

However, if you are using Zend Mail and you get an error along the lines of

Warning: mail() [function.mail]: SMTP server response: 501 <"Bill Gates" <bill@microsoft.com>>: "@" or "." expected after """"

Then you should probably bypass PHP’s mail functions altogether, and connect directly to the SMTP server from Zend Mail:

require_once 'Zend/Mail/Transport/Smtp.php';
$tr = new Zend_Mail_Transport_Smtp('mail.example.com');
Zend_Mail::setDefaultTransport($tr);

So to send a mail from WAMP using Zend Framework’s Mail functions, you would use the following:

require_once 'Zend/Mail.php';
require_once 'Zend/Mail/Transport/Smtp.php';

$tr = new Zend_Mail_Transport_Smtp('mail.example.com');
Zend_Mail::setDefaultTransport($tr);

$mail = new Zend_Mail();
$mail->setBodyText($setBodyHtml);
$mail->setFrom('bill@microsoft.com', 'Bill Gates');
$mail->addTo($email, $name);
$mail->setSubject($subject);
$mail->send();

Effective 2009-2010 Tax Rates

If you factor Employee’s and Employer’s National Insurance Contributions into the total deductions made by the tax man, then most people pay closer to 30% tax than the headline basic rate of 20%.

The following graph shows the total % tax paid by an employer + employee for a given nominal gross salary. This includes income tax and employee / employer national insurance.

MySQL one database versus multiple databases

When designing an application – should you put each customer in a separate database or keep them all in one large central database?

When it came to start work on our new Clear Books accounting software last year, we had to make a fundamental database design choice between using a single database for all clients, or having a separate database for each one.

Since there was going to be a fairly large amount of data for each client, we decided to go for the latter, and one year on – I am very happy with our decision.

Advantages

  • Easier to balance load. Since each client is in a separate database, it is relatively easy to move them between database servers.
  • Faster. One client’s tables being locked won’t affect another clients. Indexes are smaller. If MySQL has to do a row scan (let’s hope it doesn’t!), it’ll be faster.
  • MyISAM rsync backups will be faster.
  • Easier to clone a clients database for testing purposes (just simply copy the whole db, no need to write a special script to extract their data).

Disadvantages

  • Upgrading the database is more complicated, as you have to add new fields to each client database, rather than just once globally. If you are successful you could be dealing with thousands of databases, and so an upgrade script is definitely needed. However, this is also a blessing in disguise as it allows you to test upgrades on a small set of databases before rolling them out generally.
  • More complicated to implement in general.

I think the ultimate decision would come down to how much data your store for each client. If it’s a fair amount, then I think separate databases is worth the extra development effort.

UK House Prices 1999-2009 in GBP, USD, EUR

You can view the Google Spreadsheet with the raw data here.

Sources

  1. Exchange Rates – Bank of England (GBP:USD XUQAUSS / GBP:EUR XUQAERS)
  2. Real House Prices – Nationwide

Unemployment versus House Prices 1975-2008

The following graph shows the quarterly unemployment rate compared to real house prices. House prices have been adjusted for inflation and are given in 2009 Q1 prices.

unemployment-house-prices-1975-2008

Sources