Archive

Archive for the ‘How To’ Category

Calculating Distances in SQL

April 30th, 2010 1 comment

Sooner or later when dealing with data that contains addresses, you’ll need to perform distance calculations. Some examples might be “which store is nearest to location X” or “display all hotels within 20 miles of the customer’s location sorted by distance”. This post deals with such calculations based on positions designated by latitude and longitude. The process of determining the latitude and longitude of an address is called geocoding and is outside the scope of this article.

Read more…
Categories: How To, MySQL Tags: , ,

Creating OS X-style DMG volumes in Linux

March 20th, 2010 4 comments

Working in a cross-platform environment, I sometimes find it necessary to deal with DMG files (Apple disk images). Instead of finding a coworker with a Mac, I have found it easier to equip my linux machine to be able to read, write, and create these images (uncompressed only) natively.

The key is the fact that a DMG image is merely a HFS+ filesystem in a single file (similar to the way a .iso file is a CDROM filesystem in a single file). While I’m not sure how the extra DMG options (such as encryption, compression, or being “internet enabled”) work under OS X, I have verified that it is easy to create simple, uncompressed DMG images from scratch in linux. Here’s what works for me under Ubuntu Dapper & Feisty.

Read more…
Categories: How To, Linux, OS X Tags: , , ,