I hereby claim:
- I am stepheweffie on github.
- I am savantlab (https://keybase.io/savantlab) on keybase.
- I have a public key ASDk8RYspeKagwvOjFUG8wqHOfDDZWU_nDgqvjHJyXPJOQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
''' | |
Takes a screen shot of user completing a drawing in the browser at | |
http://mrdoob.com/projects/harmony/#shaded, searches for a Phash of screenshot as a repeat drawing. | |
''' | |
import subprocess | |
from selenium import webdriver | |
from selenium.common.exceptions import WebDriverException | |
import shutil | |
import os.path |
import os | |
directory = "/dir/" | |
os.chdir(directory) | |
files = filter(os.path.isfile, os.listdir(directory)) | |
files = [os.path.join(directory, f) for f in files] # add path to files | |
files.sort(key=lambda x: os.path.getmtime(x)) |
n = input('Please provide a number n: ') | |
def factor_ial(number): | |
count = 1 | |
arr = list() | |
num = number + 1 | |
for i in range(int(num)): | |
if i == 1: | |
count += 1 | |
#print(i, i * count) |
''' | |
Write a program that prints out the numbers 1 to 100 (inclusive). If the number is divisible by 3, print Crackle instead of the number. | |
If it's divisible by 5, print Pop. If it's divisible by both 3 and 5, print CracklePop. | |
''' | |
def main(): | |
for i in range(1, 101): | |
if i % 3 == 0: | |
print('Crackle') | |
elif i % 5 == 0: | |
print('Pop') |
# the long way | |
def main(a, l): | |
for i in a: | |
if a.index(i) < a.index(a[-1]): | |
n = i * a[a.index(i) + 1] | |
l.append(n) | |
print(max(l)) | |
return max(l) | |
if __name__ == '__main__': |
def binary_search(array, target): | |
lower = 0 | |
upper = len(array) | |
while lower < upper: | |
x = lower + (upper - lower) // 2 | |
value = array[x] | |
if target == value: | |
return x | |
elif target > value: | |
if lower == x: |
def firstDupe(a): | |
""" | |
Finding the first occurrence of any duplicates with the first second occurrence of a value | |
as long as params are met. | |
Returns -1 if outside params. | |
""" | |
if len(a) == len(set(a)): | |
return -1 |