Skip to content

Instantly share code, notes, and snippets.

View steniowagner's full-sized avatar
:electron:
“Every programmer is an author.” - Sercan Leylek

Stenio Wagner steniowagner

:electron:
“Every programmer is an author.” - Sercan Leylek
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
main()
{
int anos;
printf("\nDigite o anos dos casados: ");
scanf("%d",&anos);
import numpy as np
import matplotlib.pyplot as plt
results = [128.404195237, 97.3462196942, 97.32592423, 77.4317551694]
clusters_points = [2, 3, 4, 5]
plt.xlim([2, 5])
plt.ylim([50, 140])
plt.plot(clusters_points, results, 'go') # bolinha verde
plt.plot(clusters_points, results, 'k:', color='blue') # linha pontilhada
import numpy as np
import matplotlib.pyplot as plt
results = [128.404195237, 97.3462196942, 97.32592423, 77.4317551694]
clusters_points = [2, 3, 4, 5]
plt.xlim([2, 5])
plt.ylim([50, 140])
plt.plot(clusters_points, results, 'go') # bolinha verde
plt.plot(clusters_points, results, 'k:', color='blue') # linha pontilhada
calculateDistanceBetweenCoordinates = (firstCoordinate, secondCoordinate) => {
const PI = 0.017453292519943295;
var haversine = 0.5 - Math.cos((secondCoordinate.latitude - firstCoordinate.latitude) * PI) / 2 +
Math.cos(firstCoordinate.latitude * PI) * Math.cos(secondCoordinate.latitude * PI) *
(1 - Math.cos((secondCoordinate.longitude - firstCoordinate.longitude) * PI)) / 2;
return 12742 * Math.asin(Math.sqrt(haversine)); // 2 * EARTH_RADIUS (6371);
}
import React, { Component } from 'react';
import {
StyleSheet,
View,
PermissionsAndroid,
Platform,
} from 'react-native';
import MapView from 'react-native-maps';
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000 };
import React from 'react'
import { render } from 'react-dom'
import { BrowserRouter } from 'react-router-dom'
import App from './app'
render(
<BrowserRouter>
<App />
</BrowserRouter>,
document.querySelector('[data-js="app"]')
UserController.prototype.getUserFeed = function(request, response, next) {
var _id = request.params._id;
var context = this;
this.model.findOneAsync(_id)
.then(handleNotFound)
.then(function(user) {
return user;
})
.then(function(user) {