This is the second time it happens to me so I've decided to write a post about it.
Problem: in the "Android SDK and AVD Manager"/"SDK Setup" selecting "Samples for SDK ..." package and clicking 'delete' deletes the content of the samples folder, but does not remove the entry from the "Android SDK and AVD Manager".
Solution:
1. Close the "Android SDK and AVD Manager"/"SDK Setup" (close the eclipse if it's running).
2. Delete the SDK specific samples folder. If the folder is locked kill any 'java.exe' process running (or reboot).
3. Restart the "Android SDK and AVD Manager"/"SDK Setup"
Sunday, February 13, 2011
Distance on earth calculation in SQL
Here's how to create an SQL function to calculate the distance (in KM) between to points on earth. This is an estimation since the distance is calculated as if the earth was round, but it's close enough for most purposes:
CREATE FUNCTION dist (@latFrom float, @longFrom float,@latTo float, @longTo float)
RETURNS float
AS
BEGIN
DECLARE @Distance float
SET @Distance =
(SIN(RADIANS(@latFrom)) *
SIN(RADIANS(@latTo)) +
COS(RADIANS(@latFrom)) *
COS(RADIANS(@latTo)) *
COS(RADIANS(@longFrom - @longTo)))
SET @Distance = (DEGREES(ACOS(@Distance))) * 69.09 * 1.609344
RETURN(@Distance)
END
Labels:
SQL Server
Subscribe to:
Posts (Atom)