While I haven't been paid to write computer programs since 1993, I've always found that maintaining a hobby interest in the area has offered great benefits when dealing with development issues and especially when debunking IT suppliers' FUD and nonsense. So here's a small hobby project that ticked a number of interesting boxes in 2008 - open source, PHP, web services, AJAX and mashups.
Since I started building my own web sites - again for recreational rather than business purposes - about 20 years ago I've had a fascination with who visits my sites and how they find their way there. Since Google Analytics came along it's been easy for webmasters to track this, but one thing that's lacking from an otherwise impressive package is the ability to publish visitor information back to the website itself.
When establishing Cogitant I thought it was important to set up a simple website, which I did in a couple of hours using the excellent Joomla Content Management System. Joomla is a free, open source application written in PHP and using the equally free mySQL database. Like many open source frameworks it is designed to be extensible via user-written modules. A great many have been written and shared - some under free-to-use open-source licenses like GPL, others under commercial licenses. A while back I had a play around with building an add-on to track users for my personal site which was running on the Joomla predecessor Mambo at the time, so I thought I'd dust this work down and update it for Joomla.
Another great advantage of open source software is that as a developer you can re-use and extend existing functionality. My starting point was the built-in Joomla module whosonline which displays how many users are logged on. This provided the structure needed for the new Joomla module and along with other sections of code working example of how to access the database, display results etc.
The solution has been built as two inter-related modules. One uses a web service provided by geoplugin.com to look up a new visitor's IP address and determine their lat / long, nearest town etc. and add this to the site database where it can be retrieved from later. This method doesn't work for every IP or provide great accuracy, but gives an approximate fix for most users. HTML 5 browsers offers new approaches to geolocation offering support for mobile devices, but these (quite rightly) ask your permission before disclosing your location to the host so not so useful here. This module also generates the table of recent visitors you'll see to the left of this page.
The second module reads locations from the database and then uses the Google Maps API to plot the recent visitors on a map. Click on the Recent Visitors link on the main menu to see the results. If you are puzzled by the regular visits from distant lands including China, Turkey and Russia, this is where many script-based attacks on the website originate from, looking for a weakness that would allow the attacker to take control of the site. Safe to say that every day someone is trying to break into any internet-connected device you have, so keep those patch levels up to date!
In 2008 there were already around 1.2 million limited companies registered in the UK and the dot-com era promise of internet riches had led to the registration of more than 7 million .uk domain names. Finding an name that was available for use both as a company name and a domain name, that was reasonably short and memorable, and that was related in some way to the activity of the new company proved to be quite a challenge. I came across cogitant during a trawl of Latin words with somewhat relevant meanings - it's the present participle of cogitare, to think - and appears in the OED as a rare English word of the same meaning i.e. "thinking", and also "that thinks".
How do you pronounce it?
For what it's worth, I say it like cogitate rather than like cog. For the linguists among you that's kɒʤɪʈəŋʈ. Latin scholars differ in their opinions about how the Romans might have pronounced it, so as long as you spell it correctly, pronounce it how you like .