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 json | |
from urllib.parse import urlparse | |
def parse_har(filename): | |
with open(filename) as h: | |
data = json.loads(h.read()) | |
urls = list(set([i['request']['url'] for i in data['log']['entries']])) | |
domains = list(set([urlparse(i).netloc for i in urls])) | |
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
from collections import defaultdict | |
def solution(A): | |
ordered_values = get_ordered_values(A) | |
ocurrences = get_ocurrences(A) | |
max_left = max(A) | |
max_right = 0 | |
max_diff = 0 | |
left = A |
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
def prime_factors(val): | |
x = 2 | |
factors = [] | |
while x*x <= val: | |
if val%x: | |
x += 1 | |
else: | |
val //= x | |
factors.append(x) |
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
<link rel="import" href="../ace-element/ace-element.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |