PR update

Oct 01

I just noticed on Shoemoney that there’s a Google PR update underway.

Sure enough, this site has dropped from PR6 down to PR5. It’s a bit annoying obviously but not a lot I can do about it. How have you fared?

No Comments » | Add yours



Light emitting material

Sep 07

Phillips have made some serious advancement in the light emitting material arena, as this video on YouTube shows.

How long before we have couches linked up to TV sets to give ambient lighting effects that engulf where you’re sitting?

That would be cool.

No Comments » | Add yours



Calculating distance with latitude/longitude in MySQL

Sep 03

I’ve created a few sites in the recent past that have required some kind of distance calculation. Each of these sites have been solely UK-based and therefore I’ve used a MySQL setup whereby the table contains an X and Y column consisting of the Ordnance Survey grid reference (OSGB) for a particular UK postal code.

From this I can do a simple query such as:

  1. SELECT id,name,((sqrt((($x - x) * ($x - x)) + (($y - y) * ($y - y))) / 1000) * 0.621) AS distance FROM companies HAVING distance <= $miles ORDER BY distance ASC LIMIT xx

Passing in the variables $x and $y as the starting point and $miles as the maximum distance to travel we can then produce a result set of all the companies in the database ordered by distance in miles.

This is all well and good for UK datasets, but what about mapping distance anywhere in the world?

Instead we need to switch to using the latitude and longitude of the location instead of the X/Y grid references and use a much more mathematical query:

  1. SELECT id,name,(((acos(sin(($lat*pi()/180)) * sin((latitude*pi()/180)) + cos(($lat*pi()/180)) * cos((latitude*pi()/180)) * cos((($lng - longitude)*pi()/180))))*180/pi())*60*1.1515) as distance FROM companies HAVING distance <= $miles ORDER BY distance ASC LIMIT xx

So in this instance we pass in the variables $lat and $lng for the starting point as well as $miles for the max distance to search, with the database containing columns “latitude” and “longitude” for the dataset. This query is easy enough to alter for mapping in kilometers instead of miles.

You’ll want to index latitude and longitude in the db to ensure the queries aren’t uber slow, and I haven’t tested this on a table with more than 3000 rows so performance could be an issue.

Something else to consider is the value of pi() within MySQL. For greater accuracy you may want to include a static value to greater decimal places.

8 Comments » | Add yours



Flickr bit of Cake on the table

Aug 31

This is a screencast of a recreation of the RoR Flickr app but built using CakePHP. I recorded this screencast back at the beginning of May but due to sound quality issues I never posted it up or re-recorded it.

A friend of mine mentioned it’s existence in #cakephp on irc.freenode.net and I noticed that they had another version up on the website by Ros-soft. Whether it was the reason it was made I dont know but I didnt feel the need to release this one afterwards, but here it is anyhow.

The sound was very quiet so I exported the .wav, bumped it up and re-imported it back in. Quality is not all the brilliant and it goes a bit out of synch but it will do spacer

It’s only in Flash .SWF format right now, if someone could convert it to a Quicktime .mov I’d be uber grateful.

Also, this was my first attempt at recording, and it’s my first ever screencast so it’s not too brilliant and I made some schoolboy errors along the way there — just cut me some slack…

spacer

Direct link to SWF (16Mb).

1 Comment » | Add yours



TechCrunch UK

Aug 29

I must be behind the times this week, I didn’t even know that TechCrunch had launched a UK specific site.

So far it looks pretty good. I’ve said before that the UK is really lacking in a quality Web 2.0 blog and it was obvious TC would get in the act at some point even if someone else beat them to the punch.

I’ve subscribed so we’ll see how it fares.

No Comments » | Add yours



Thought Crimes is the blog of Ben Milleare, a 25 year old British guy who's interested in all things Internet.

He's newly married and finds it strange talking about himself in the 3rd person.

Monthly Archives

  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • August 2005
  • May 2005
  • February 2005
  • January 2005
  • October 2004
  • September 2004
  • August 2004
  • July 2004
  • June 2004
  • May 2004
  • April 2004
  • March 2004
  • February 2004
  • January 2004
  • December 2003
  • November 2003
  • October 2003
  • September 2003
  • August 2003
  • July 2003
  • June 2003


spacer spacer
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.