## Jan 18, 2010

### PHP: calculate distance between two points

Each point is an one-dimensional array, each value in the array is a coordinate, so dimension of coordinates in this function is arbitriary.
 /*
* Calculates Euclidian distance between two points in p-norm
* Points $p1 and$p2 are Nx1 matrices
*/
function euclidian_distance($p1,$p2) {
if(count($p1) != count($p2)) return false;
$distances = 0;$p1 = array_values($p1);$p2 = array_values($p2);$norm = count($p2); for($i=0;$i<$norm;$i++)$distances += pow(abs($p1[$i]-$p2[$i]),2);

return pow(\$distances,1/2);
}


## Jan 8, 2010

### Windows 7/Vista & ArcGIS & ESRI License Manager

It seems that ESRI License Manager has difficulties running in Windows 7 or Vista – the License server fails to start at boot or on demand in License Manager Tools.
Consequently, ArcGIS didn’t start because there was no license server running. Obviously this problem doesn’t occur if the license server is running on another machine in the network.
At first I tried the quick and dirty solution – to manually start the server daemon and see where it fails.
I ran Command Prompt as an administrator:

Now, the server is called lmgrd.exe, so if you navigate to C:\Program Files\ESRI\License\arcgis9x and start lmgrd, it says that there is no license specified.
So I typed the location of the license (it was in the same folder), ran the program in the foreground: