public static function distance($_y1, $_x1, $_y2, $_x2)
{
$pi = pi();
$c_A = 6378137;
$c_a = 1 / 298.257223563;
$c_e2 = 2 * $c_a - $c_a * $c_a;
$fSinB1 = sin($_y1 * $pi / 180);
$fCosB1 = cos($_y1 * $pi / 180);
$fSinL1 = sin($_x1 * $pi / 180);
$fCosL1 = cos($_x1 * $pi / 180);
$fSinB2 = sin($_y2 * $pi / 180);
$fCosB2 = cos($_y2 * $pi / 180);
$fSinL2 = sin($_x2 * $pi / 180);
$fCosL2 = cos($_x2 * $pi / 180);
$N1 = $c_A / sqrt( 1 - $c_e2 * $fSinB1 * $fSinB1 );
$X1 = $N1 * $fCosB1 * $fCosL1;
$Y1 = $N1 * $fCosB1 * $fSinL1;
$Z1 = ( 1 - $c_e2 ) * $N1 * $fSinB1;
$N2 = $c_A / sqrt( 1 - $c_e2 * $fSinB2 * $fSinB2 );
$X2 = $N2 * $fCosB2 * $fCosL2;
$Y2 = $N2 * $fCosB2 * $fSinL2;
$Z2 = ( 1 - $c_e2 ) * $N2 * $fSinB2;
$D = sqrt( ( $X1 - $X2 ) * ( $X1 - $X2 ) + ( $Y1 - $Y2 ) * ( $Y1 - $Y2 ) + ( $Z1 - $Z2 ) * ( $Z1 - $Z2 ) );
$R = $N1;
return 2 * $R * asin( 0.5 * $D / $R );
}
return $http.get("tasks.json").then(function(response){
return response.data;
});
<?php if (JURI::current() == JURI::base()) : ?><?php endif; ?>
byte cmd[] = {0x01, 0x05, 0x00, 0x00, 0x00, 0x00, crc low, crc hi}
SomeStream s = ...
s.write(smd);
byte b = (byte)(0xFF & 0x90); // b == 144
grunt serve
grunt serve:dist
bower install --save module-name
npm install --save module-name
$ yo angular-fullstack:endpoint post
[?] What will the url of your endpoint to be? /api/posts
var myApp = angular.module('myApp', []);
// make a factory to share data between controllers
myApp.factory('Data', function(){
var data = {
firstName: ''
};
return {
getFirstName: function () {
return data.firstName;
},
setFirstName: function (firstName) {
data.firstName = firstName;
}
};
});
$user = JFactory::getUser();
$time = $user->getParam('timeShowCaptcha', 0);
if((time() - $time) < 3600){
return '';
}
$user->setParam('timeShowCaptcha', time());
$user->save();
<html ng-app="myApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<meta charset="UTF-8" />
<title>Document</title>
<script>
var app = angular.module('myApp', []);
app.controller('example', function($scope){
$scope.home = 'Hello';
});
</script>
</head>
<body ng-controller="example">
{{home}}
</body>
</html>