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
# Get last hour logs from container instance | |
az monitor log-analytics query -w 58ca4766-72b7-4610-8d1c-4b6a88a49a01 \ | |
--analytics-query "ContainerInstanceLog_CL | where ContainerGroup_s == 'ds-tr-retail-price-engine-training-dev-process' | project Message" \ | |
-t P0DT1H --output tsv | sed 's/PrimaryResult//' |
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
CREATE FUNCTION dbo.itemAtIndexInASplitString( @stringToSplit VARCHAR(MAX), @delimiter VARCHAR(5), @indexToReturn int) | |
RETURNS | |
varchar(max) | |
AS | |
BEGIN | |
DECLARE @returnList TABLE ([ID] int, [Name] [nvarchar] (500)) | |
DECLARE @name NVARCHAR(255) | |
DECLARE @pos INT | |
DECLARE @index INT | |
DECLARE @return_value varchar(max) |
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
# | |
# Run in the foreground locally | |
# nginx -p . -c nginx.conf | |
# | |
user nginx; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log notice; | |
pid /var/run/nginx.pid; |
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
yarn jar /usr/lib/hadoop-mapreduce/hadoop-streaming.jar -Dmapred.output.compress=true -D mapred.output.compression.codec=org.apache.hadoop.io.compress.BZip2Codec -input s3://acg-tests/dwell_plus/20161001 -output s3://acg-tests/bzip/dwell_plus/20161001/ -mapper /bin/cat -numReduceTasks 0 |
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 web | |
import random | |
import json | |
import time | |
urls = ( | |
'/cells(.*)', 'CellFinder', | |
'/domains(.*)', 'DomainFinder', | |
'/cats(.*)', 'CategoryFinder', |
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
colors16 = [ [51, 102, 255, 0xff], | |
[102, 51, 255, 0xff], | |
[204, 51, 255, 0xff], | |
[255, 51, 204, 0xff], | |
[255, 51, 102, 0xff], | |
[255, 102, 51, 0xff], | |
[255, 204, 51, 0xff], | |
[204, 255, 51, 0xff], | |
[102, 255, 51, 0xff], | |
[51, 255, 102, 0xff], |
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 shapefile | |
import pandas as pd | |
from shapely.geometry import Polygon, Point | |
provinces = shapefile.Reader("/data/geobrowsing/spain_gis/SHP_WGS84_PROVINCIAS_SIMPLE/PROVINCIAS_SIMPLE_OK.shp") | |
provs = list() | |
for sr in provinces.shapeRecords(): | |
provs.append(sr.record + [Polygon(sr.shape.points),] ) | |
#print sr.record |
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 pandas as pd | |
from shapely.geometry import Polygon, Point | |
# Read polygons from shapefile | |
provinces = shapefile.Reader("/data/geobrowsing/spain_gis/SHP_WGS84_PROVINCIAS_SIMPLE/PROVINCIAS_SIMPLE_OK.shp") | |
# Store as shapely Polygons along with the data for each of them | |
provs = list() | |
for sr in provinces.shapeRecords(): | |
provs.append(sr.record + [Polygon(sr.shape.points),] ) |
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 shapefile | |
import pandas as pd | |
# Point in polygon | |
def pip(point,poly): | |
x = point[0] | |
y = point[1] | |
n = len(poly) | |
inside = False |
NewerOlder