Friday, 24 February 2012

Apple Higher Education discount for the Open University

I'm currently looking at replacing my 2007 iMac 24" with one of the current 27" core i5 models. In the past I have received HE discount from Apple by providing my student information over the phone to Apple but today I have managed to secure a link directly to the Open University store.

So if you are an Open University student and would like to earn between 12-15% off a new Apple computer click this link
http://store.apple.com/uk_edu_5000751/ Quidco are also providing an extra 6% cashback which can bring the saving up to the 20% mark which is nothing to be sniffed at!

I'll let you know if I take the plunge and upgrade...

Thursday, 9 February 2012

TM470 General progress update

I've now been allocated my tutor for TM470 and I have sent off an e-mail with a few paragraphs documenting my project intentions for review.

The project choice forum has been fairly active with lots of people and a diverse array of project ideas which seem to have been growing as the late sign ups have been arriving onto the module website. It's odd really, the early sign ups have had access to the site from October/November time, around 4 months before the course start and then there are those who turned up last week just before go day!

All in all things are going well and I am slowly working towards the first TMA, I have purchased a project book that was recommended by the course, and just about every other computing course run by a higher education establishment.


Projects in Computing and Information Systems: A Student's Guide

This book is fairly recent and gives fantastic guidance to working on a software development project as well as a research based project so it should be suitable for all students of TM470 or any other similar course. I'd highly recommend it.

That's about all for now, I should be getting into the project quite intensively going forward, I'm going to use this blog to capture my progress as well as documenting research and ideas so apologies in advance.

Simon

Geo Spatial data and the google maps API

Ok so here's the first of many blog posts that I will be capturing thoughts and research around my project, so apologies for those who read this regularly its going to get busy and I guess over time it will also become quite technical.

I have been carrying out some research on geo information as it is going to be fairly critical for my project, firstly for user registration and location management and secondly for identifying things that are close to a given latitude and longitude. In particular I have spent some time digging around the Google Maps API, documentation for which can be found here http://code.google.com/apis/maps/documentation/geocoding/.

This API allows you to pass a partial or fully constructed address and get a fully geo located JSON or XML response with the address modelled including and missing attributes. An example for Brick Lane in London is outlined below.

http://maps.googleapis.com/maps/api/geocode/json?address=1+Brick+Lane,London&sensor=false

As you can see this isn't exactly a complete address, but look at the JSON response below that documents the full geocode information


{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "1",
               "short_name" : "1",
               "types" : [ "street_number" ]
            },
            {
               "long_name" : "Brick Ln",
               "short_name" : "Brick Ln",
               "types" : [ "route" ]
            },
            {
               "long_name" : "London",
               "short_name" : "London",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "London Borough of Tower Hamlets",
               "short_name" : "London Borough of Tower Hamlets",
               "types" : [ "administrative_area_level_3", "political" ]
            },
            {
               "long_name" : "Greater London",
               "short_name" : "Gt Lon",
               "types" : [ "administrative_area_level_2", "political" ]
            },
            {
               "long_name" : "United Kingdom",
               "short_name" : "GB",
               "types" : [ "country", "political" ]
            },
            {
               "long_name" : "E1 6PU",
               "short_name" : "E1 6PU",
               "types" : [ "postal_code" ]
            },
            {
               "long_name" : "E1",
               "short_name" : "E1",
               "types" : [ "postal_code_prefix", "postal_code" ]
            }
         ],
         "formatted_address" : "1 Brick Ln, London Borough of Tower Hamlets, London E1 6PU, UK",
         "geometry" : {
            "location" : {
               "lat" : 51.5173560,
               "lng" : -0.0709070
            },
            "location_type" : "ROOFTOP",
            "viewport" : {
               "northeast" : {
                  "lat" : 51.51870498029150,
                  "lng" : -0.06955801970849797
               },
               "southwest" : {
                  "lat" : 51.51600701970850,
                  "lng" : -0.07225598029150203
               }
            }
         },
         "types" : [ "street_address" ]
      }
   ],
   "status" : "OK"
}



Not only do I now have a fully modelled address that I can easily parse into a Javascript or Java object, I also have the lat/long information that I can use to base geo spatial searching e.g. show me all locations in my database that live within 5 miles of point x, I think it is pretty incredible!

From my research this can be done in any database using the Haversine formula, one solution for MySQL specifically is documented here http://qnatech.wordpress.com/2011/07/06/how-to-use-geo-spatial-with-mysql/


When playing around with example addresses I noticed that if the street name is unique enough all you need to provide is the house number / street and you get the same level of detail which is great if your working with malformed user data.