Skip to content

Instantly share code, notes, and snippets.

Avatar

Dmitry Groza boxfrommars

View GitHub Profile
View build_timeline.py
def build_timeline(builder_input, builder_output, solver_output):
solver_input = builder_output['solver_input']
courier_map = {c['index']: c['number'] for c in builder_output['maps']['couriers']}
points_map = {p['index']: p for p in builder_output['maps']['waypoints']}
approved_points = {p[0] for p in solver_input['vehicles_assigned_to_points']}
route_points = []
for driver_ind, route in enumerate(solver_output['routes']):
cursor = solver_input['vehicle_shifts'][driver_ind][0] + 1
View Test Distances Pandas.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Geopoint Distances.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View forecast.py
import forecastio
import pandas as pd
import time, datetime
from shapely import wkt
import os
api_key = 'Your key'
curr_dir = os.path.dirname(__file__)
groups = pd.read_csv('%s/data/hexagon-groups.csv' % curr_dir, index_col=0)
View DST.md

Определения

везде я буду указывать только время начала периода, то есть 2015-06-01 03:20 это интервал [2015-06-01 03:20, 2015-06-01 03:30) -- правое значение исключено, т.е. точнее [2015-06-01 03:20, 2015-06-01 02:29:59.999]

запись 2015-11-01 06:20Z указывает на UTC-время

Переход на зимнее время (UTC-4h -> UTC-5h)

UTC Boston Local Interval
View load_weather.py
import numpy as np
import pandas as pd
import time
base_url = 'https://www.wunderground.com/history/airport/KBOS/{}/{}/{}/DailyHistory.html?&reqdb.zip=&reqdb.magic=&reqdb.wmo=&format=1'
d_range = pd.to_datetime(np.arange('2015-12-29', '2016-06-15', dtype='datetime64[D]'))
print(d_range)
View readme.md

%PROJECT_NAME%

Description of the project

Install

Production Requirements

  • PHP >= 5.5.9
View tolls.js
// Константы для определения меры принадлежности точки
var ANGLE_MAX = 10; // максимаьное значение для меры угла (максимальное значение cos -- 1)
var ANGLE_POWER = 4; // чувствительность к углу (чем больше число, тем меньшая ошибка будет приводить к большему уменьшению меры угла)
var DISTANCE_COEFF = .17; // коэффициент подстройки (грубо говоря, сколько метров считаем за единицу меры)
var DISTANCE_POWER = 1; // чувствительность к расстоянию
var DISTANCE_MAX = 10; // максимаьное значение для меры расстояния
/**
View gist:44f70311e842be1f4451
/9j/4AAQSkZJRgABAQEASABIAAD//gA8Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NjIpLCBxdWFsaXR5ID0gMTAwCv/bAEMABgQFBgUEBgYFBgcHBggKEAoKCQkKFA4PDBAXFBgYFxQWFhodJR8aGyMcFhYgLCAjJicpKikZHy0wLSgwJSgpKP/bAEMBBwcHCggKEwoKEygaFhooKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKP/CABEIAckBLAMBEQACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAAEAQIDBQYABwj/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIQAxAAAAHOExESCDSQ4QhHkQwYcIOHEJKSFwOJSQcOFFFFOFHHHDhTKkooowQecINEIyEhEOGEQgWFFsEDiQUcKKKKcOEFFFFMsKKSkQ44eNIiAkICEgBCvGCjg0vS/JiQcKOFEFFFFOFFFM2RDzhhMMEJBpERg4EQlURHHCChRoS0LoeKOOOFFFFOOFFMscPFGijBR40hOKorhgORnDThSY0o4eagmOHHCiinCnDhTKDhwo0QYOOFBxhlRRCQGJhpxGEF+EBBWGgLgccOFOFFOFHGWFIRSUaOISQkByuMqTDy8AggQkK8jDS2CwwoC7L44cKKKccKKZYeMJBohww4lIDOFKTBhcEI0NJAMcFF4PJgUzxpizFFFOOOOHGVCAc4lGnDSMmIDLlUThoeQhpMMCgkOLQkEAypBDYCnCiHCiimWCwUUJIiIYMJwcxBCHDgkGL0KGkwUWQSWRKRABijcDxRTjhThTLhBCcTiEQ0iJSEwIwJOEHB4cGBQaWJehpOAlKYw2QScKccKKcZ0cRnE4pAOBRR554REg0sixAB4aTBhtS+HjCIBMQasU4U4U4UQzpIcQkopGKQjQkwJXjyyN+Z4ritJQ03JpiclGkIMAiHHHHD
View request.sh
curl -X POST -H "Content-Type: application/json" -d '{"application_id": "2", "auth_key": "DtF9cZPqTF8Wy9Q", "timestamp": "1333630580", "nonce": "1340569516", "signature": "13293a5bd2026b957ebbb36c89d9649aae9e5503", "user": {"login": "injoit", "password": "injoit", "owner_id": "4"}}' https://api.quickblox.com/auth.json
You can’t perform that action at this time.