Subscribe to Grim's Projects        RSS Feed

Geolocation and Hits

Icon Leave Comment
As of yet I've not uploaded v3.0 to the web. Still translating all the previous PHP code within the site to work with the newest version. However, I did upload a preview of what the new Mimesis class looks like. You can find two new Mimesis powered scripts under the Tutorials page of my Mimesis site: geolocation and hits counter.

Of particular interest will be the geolocation tutorial as it makes use of intelligent key-value store creation in order to optimize the querying that is later performed. I know I can still cut the key-value store size down by 44kB but meh. Most people will find it daunting that the geolocation script uses 186 distinct KVS's comprised of 562 files. However, only 3 file access operations are performed for any particular lookup so it does so fairly quickly. The number of stores is purposely high for issues of enhanced speed. It worked just fine when it was only two KVS's though (one of them contained the entirety of 45,571 different ips, these are now split into various KVS's).

Both scripts also illustrate the ease of capturing errors returned from the Mimesis class and a simple way of utilizing them to your advantage. Hope someone here is still curious enough to give them a once over.

Also, if you happen to visit the homepage please let me know if the geolocation script shows the proper country you're visiting from.

0 Comments On This Entry