Finding Your Way with an iPhone and PHP

The iPhone has undoubtedly revolutionised mobile phone technology, providing users access to vast amounts information wherever they are and more importantly information about where they are.

One of the projects I have been working is BeerMap, a location aware iPhone application which shows you nearby pubs, how people have rated beer and lets your add to the database by uploading reviews and images.

My role in this project was to produce the web service to manage all of the information, and I thought it may be useful to give a summary of the technologies used.

PHP & The Zend Framework

The Zend Framework is an extensive PHP library providing the MVC approach to code structure which is also recommended for iPhone development.

I also heavily extended the Zend_Controller_Action class to incorporate authentication and context switching depending on the response type needed.

MySQL Stored Procedures

All our data is stored in a MySQL database, so it was logical to also create a mechanism within the database to calculate distances depending on longitude and latitude. This calculation can be relatively expensive so I am looking a ways to further optimise this process, however it appears to be working relatively efficiently at the moment.

Plists

Web services generally will provide a response in XML or JSON, however using these response formats would require additional libraries to be included within the iPhone app, increasing its size and complexity. However, by generating a Plist response, the iPhone can read this without any complex parsing or processing.

For this we modified a version of the CFPropertyList library and added a better mechanism for guessing variable types which I hope will be integrated into the original library at some point soon.

Further Information

Above is just a very brief summary of the technologies used, however please contact me for more information and take a look at the websites below:

Photo Credit: Will Ockenden

Easter in Andalusia

For the last week I have been staying in Nerja (Spain) with my family and have returned in time for Easter day.

I wasn’t entirely sure what to expect, as my previous experience comes only from a hot, dusty and long drive across central Spain from Portugal to reach a horribly remote airport. However I’ve also read a fair amount about Andalusia due to my love of flamenco which I’ve played for years.

Fortunately, I was pleasantly surprised by the beauty of the region. Our villa had a magnificent view of the ocean and had a backdrop of an impressive mountain range. Every street appeared to be blooming with beautiful flowers and the fragrance of jasmine often followed you around. I even found my favorite flower growing on the Balcon de Europa; the Bird of Paradise which I first saw growing wild in South Africa.

While in Nerja I experienced some amazing food, and tapas is a wonderful way to eat. In some tapas bars you are given a little dish of food with each drink so you can spend hours relaxing with breathtaking views, enjoying an amazing variety of food and drinking small Spanish beers.

My only regret was that I didn’t see any flamenco while I was there, however I didn’t really go looking for it and gives me another reason to go back and visit!

Zopa – 1 Month Update

I wrote a while ago about “Zopa – Experimental Investment” and my initial experience and plans to use the service, so just under a month later here is my update of how things are going!

As mentioned in my previous post, my aim was to set an extremely competitive rate of interest in the hope of attracting borrowers as quickly as possible. On the whole this strategy worked, with almost the entire sum being “processed’ within the first week. However one thing to note is that just because a loan is being processed it doesn’t mean you are guaranteed that that money will be lent.

All of the money I put into Zopa has now been lent to borrowers and in my opinion that is extremely efficient. 60% of my money went to A* rated borrowers with the remaining 40% going to A rated borrowers. Looking at the information on demand, these two categories are by far the highest so it makes sense to include these in your offers.

Below is a breakdown of my current loan book with the borrowers blurred out for privacy reasons:

One thing I was pleasantly surprised to find was that magically, 4p appeared in my account. It turns our Zopa will pay you interest on money sitting in the holding account waiting to be distributed which I didn’t expect! It isn’t a high rate of interest but some is better than none.

Transporter 3 – Film Review

[imdb Transporter 3]

Transporter 3 staring Jason Statham was probably the worst out of the trilogy. That being said, it was still an extremely entertaining film with some great action scenes and the odd moment of comedy genius.

The basic plot is that Frank Martin – “The Transporter” is forced to drive a package to an unknown destination guided only by GPS coordinates given by the criminal mastermind controlling the whole situation. With an explosive bracelet locked to his wrist, Frank is unable to get further than 75ft away from his car without being blown to pieces.

Frank is accompanied by Valentina (Natalya Rudakova), a Ukrainian who is also accessorised with an explosive bracelet and provides the majority of comedy moments particularly when asking Frank in a Borat-esq way; “are you the gay?”.

I’m a big fan of the Transformer series and if you are looking for a fun, entertaining and easy to watch movie – this would be a good choice!

Bank or Betting Shop

I think it is a fitting reflection of the current economic climate that in the ‘banking sector’ of Coventry, one building society has shut up shop and the premises has promptly been taken over by a bookmakers.

We are undoubtedly entering a prolonged period of economic uncertainty where banks who once reaped huge rewards from high risk investments are now buckling under huge losses as a result of the slowdown. Furthermore, the public has lost confidence in the industry due to the collapse of something we all assumed was solid as a rock.

Understandably people are less willing to take risk, are reigning in spending in preparation for a difficult economic period and are far more cautious when they do invest. Ironically, it is exactly this pattern which will prolong this period of economic depression.

If spending increased to the rate it was 12 – 24 months ago, the economy would start to become more buoyant. Liquidity for companies would improve and the number of jobs would rise due to demand for commodities.

Interestingly, people also seem to be abandoning ship in relation to share investments. People tend to buy shares when there is confidence in a market i.e. when they are on their way up or at a high, and sell when confidence is reducing and therefore when prices are falling or at a low. This is obviously contrary to common sense which would really tell you to buy low, sell high. Fortunately for us, shares are low at the moment. Maybe not as low as they will be, however the number of shares you can get for your initial investment is probably around the highest we are likely to see in our lifetime.

Even in the market continues to fall, it will certainly grow in the future and greater rewards and lower risk are found in longer term investments.

The Incredible Hulk – Film Review

[imdb the incredible hulk]

This is a seriously good film and possibly one of the most enjoyable I have seen this year.

Staring Ed Norton and Liv Tyler it follows the story of a Dr. Bruce Banner who is exposed to a seriously high level of gamma radiation causing him to turn into an incredibly awesome monster who likes to smash stuff – what could be better?!

The acting is at a really high level throughout the film and they managed to get a good balance with the amount of special effects.

It’s worth mentioning that this is not a squeal to the atrocious 2003 film HULK which was licensed to bunch of muppets who created a rather poor attempt at a film.

Anyway, this film (The Incredible Hulk) is worth owning and 100% worth watching.

Rambo – Film Review

[imdb Rambo]

Rambo staring Sylvester Stallone as John Rambo is an awesome action film which took very little concentration to watch. That might sound like a strange reason to like a film but I think it’s a good one.

This film was definitely a piece of action genius, however it made some pitiful attempts to include political opinion and even more questionable moral values suggesting as it’s OK to kill sometimes, “When you’re pushed, killing’s as easy as breathing” (Sin City reference?) and “Live for nothing, or die for something. Your call”.

Anyway, I’m glad I bought it – particularly because it was part of 3 for £10 at blockbuster! It’s one to watch.