This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
main() | |
{ | |
int anos; | |
printf("\nDigite o anos dos casados: "); | |
scanf("%d",&anos); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adicionando um user, isso é equivalente a um POST do REST | |
mutation { | |
addUser (userid:"24", name:"joao victor", age: 23) { | |
// Esses parâmetros são o que tu quer saber após o POST | |
userid | |
name | |
age | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, applyMiddleware, compose } from 'redux'; | |
import createSagaMiddleware from 'redux-saga'; | |
import { persistStore, persistCombineReducers } from 'redux-persist'; | |
import storage from 'redux-persist/es/storage'; | |
import rootSaga from './sagas'; | |
/* Reducers */ |
OlderNewer