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
#SingleInstance force | |
#End::Volume_Mute | |
#PgUp::Volume_Up | |
#PgDn::Volume_Down | |
#!Up:: | |
#!Right:: | |
Run nircmd changebrightness +5 | |
Return |
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 subprocess | |
import threading | |
import time | |
import Queue | |
import setq | |
def get_conf(): | |
while True: | |
time.sleep(1) |
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 itertools | |
import sys | |
inp = open(sys.argv[1]) | |
for field_count in itertools.count(1): | |
a, b = map(int, inp.readline().split()) | |
if a == 0: | |
break | |
field = [inp.readline().strip() for _ in xrange(a)] | |
out = [[0]*b for _ in xrange(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
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import Select, WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from time import sleep, strftime | |
def waituntil(s): | |
while strftime('%H:%M:%S') < s: | |
print strftime('%H:%M:%S') | |
sleep(1) |
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 | |
from itertools import combinations | |
l = defaultdict(list) | |
for i, j in combinations(xrange(1, 10**3), 2): | |
k = i*i + j*j | |
l[k].append((i, j)) | |
if len(l[k]) > 2: | |
# if k is a perfect square -- approximation | |
if int(k**.5)**2 == k: |
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
n = int(raw_input()) | |
width = len(bin(n)) - 2 | |
for i in xrange(1, n + 1): | |
print '{n:{w}} {n:{w}o} {n:{w}X} {n:{w}b}'.format(n=i, w=width) |
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 random import randint | |
class ARR(object): | |
def __init__(self): | |
self.arr = [] | |
self.pos = {} | |
self.len = 0 | |
def append(self, 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
from contextlib import contextmanager | |
from sys import stderr | |
from timeit import default_timer as now | |
import atexit | |
@contextmanager | |
def timeit(s=''): | |
start = now() | |
yield | |
print >>stderr, '-- %06.3fs' % (now() - start), '|', s |
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 <bits/stdc++.h> | |
using namespace std; | |
namespace __io__ { | |
static struct IN { | |
char buff[1 << 10]; | |
char c; | |
inline operator bool() { | |
return c > 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
from itertools import imap | |
import numpy | |
def main(): | |
limit = 2147483647**.5 | |
prime = numpy.ones(limit/2, dtype=numpy.bool) | |
for i in xrange(3, int(limit**.5) + 1, 2): | |
if prime[i/2]: |