1
Noticias y Eventos / Re:Despliegue de servidores datasnap en nginx
« Último mensaje por noshy enero 20, 2021, 11:29:08 pm »Genial, muchas gracias, ya me registro.
Descripción:
Los servidores DataSnap son una potente tecnología de RAD Studio para la creación de aplicaciones multicapa. Estos servidores tienen diferentes opciones de despliegue, y en este webinar vamos a ver cómo realizarlo utilizando el servidor Nginx.
Nginx es un servidor web/proxy inverso ligero de alto rendimiento y un proxy para protocolos de correo electrónico (IMAP/POP3), y una de sus ventajas es ser multiplataforma, por lo que corre en sistemas tipo Unix (GNU/Linux, BSD, Solaris, Mac OS X, etc.) y Windows.
Uses System.Math;
...
Type
TPoint = record
Lat: Double;
Lng: Double;
end;
TPointRad = record
Lat: Extended;
Lng: Extended;
end;
...
function Distancia(Origin, Detiny: TPoint; Curvature: Boolean = False): Double;
var
d, s, c: Double;
OriginRad: TPointRad;
DestinyRad: TPointRad;
CurvatureAux: Double;
Const
R = 6378137; // Medium earth radius in meter
begin
OriginRad.Lat := DegToRad(Origin.Lat);
OriginRad.Lng := DegToRad(Origin.Lng);
DestinyRad.Lat := DegToRad(Detiny.Lat);
DestinyRad.Lng := DegToRad(Detiny.Lng);
if (OriginRad.Lng = DestinyRad.Lng) AND (OriginRad.Lat = DestinyRad.Lat) then
d := 0
else
begin
s := sin(OriginRad.Lat) * sin(DestinyRad.Lat);
c := cos(OriginRad.Lat) * cos(DestinyRad.Lat) * cos(DestinyRad.Lng - OriginRad.Lng);
if Curvature then
CurvatureAux := Round((s + c) * 100000000) / 100000000
else
CurvatureAux := (s + c);
if CurvatureAux <> 1 then
d := R * arccos(s + c)
else
d := 0;
end;
Result := d;
end;