REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47
AppleScript is a rather peculiar scripting language to learn.
import warnings | |
from skimage.measure import compare_ssim | |
from skimage.transform import resize | |
from scipy.stats import wasserstein_distance | |
from scipy.misc import imsave | |
from scipy.ndimage import imread | |
import numpy as np | |
import cv2 | |
## |
from __future__ import absolute_import | |
import json | |
import sys | |
import re | |
import requests | |
import urllib | |
import urlparse | |
from urllib2 import HTTPError | |
from urllib2 import URLError | |
from urllib2 import urlopen |
@pytest.yield_fixture(autouse=True) | |
def newline_before_logging(request): | |
if request.config.getoption('capture') == 'no': | |
print() # new-line | |
yield |
#!/usr/bin/env python | |
# Simple [boto3](https://github.com/boto/boto3) based EC2 manipulation tool | |
# | |
# To start an instance, create a yaml file with the following format: | |
# | |
# frankfurt: | |
# - subnet-azb: | |
# - type: t2.micro | |
# image: image-tagname |
import time | |
class PageCategoryFilter(object): | |
def __init__(self, config): | |
self.mode = config["mode"] | |
self.categories = config["categories"] | |
def filter(self, bid_request): | |
if self.mode == "whitelist": |
--- appicon.py 2015-01-23 02:21:33.000000000 +0900 | |
+++ appicon2.py 2015-01-23 02:47:26.000000000 +0900 | |
@@ -4,6 +4,7 @@ | |
import os | |
import sys | |
from wand.image import Image | |
+from wand.exceptions import BlobError, CoderError, MissingDelegateError | |
DIMENSIONS = { | |
'OSX': [ |
#!/usr/bin/env python2 | |
# coding: utf-8 | |
from __future__ import print_function | |
from tempfile import NamedTemporaryFile | |
import os | |
import sys | |
from shutil import copyfile | |
from wand.image import Image | |
DIMENSIONS = { |
q = [0] * 5000000 | |
def solve(k, n): | |
ss = 0 | |
cnt = 0 | |
prev = 1983 | |
front = 0 | |
rear = 0 | |
for i in xrange(n): | |
num = prev % 10000 + 1 |