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
/* | |
* Copyright 2013 Google Inc. | |
* | |
* Use of this source code is governed by a BSD-style license that can be | |
* found in the LICENSE file. | |
*/ | |
#include "Benchmark.h" | |
#include "SkBlurMask.h" | |
#include "SkCanvas.h" |
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 scandir import scandir | |
def recursive_scandir(dir): | |
stack = [] | |
it = scandir(dir) | |
while it or stack: | |
it = it or stack.pop() | |
try: | |
item = next(it) |
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
#!/usr/bin/env python | |
from __future__ import print_function | |
import sys | |
import gc | |
from scandir import scandir | |
def recursive_scandir(dir): | |
stack = [] |
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
#!/bin/bash | |
SRC=$1 | |
RUNS=5 | |
IM="~/ImageMagick8/bin/convert -bench $RUNS -limit thread 1" | |
# IM="gm benchmark -iterations $RUNS convert -limit threads 1" | |
RES="2>&1 | grep '=>/dev/null' | grep -Po '\d+:\K\d+\.\d+' | sort | sed '3!d'" | |
echo -n "Triangle 16x16 " | |
eval "$IM -verbose $SRC -filter Triangle -resize 16x16! bmp:/dev/null $RES" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<canvas id="c"></canvas> | |
<style type="text/css"> |
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
#!/bin/bash -e | |
BRANCHES=( 3.2.0 new-filters resample-adaptve | |
v3.2.0.post1 v3.2.0.post3 resample-sse-next simd/resample-adaptive ) | |
echo ">>> CPU INFO" | |
cat /proc/cpuinfo | |
virtualenv env | |
source ./env/bin/activate |
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 time | |
import thread | |
import urllib2 | |
from yurl import URL | |
from bs4 import BeautifulSoup | |
class Spider(object): | |
def __init__(self, base_url, max_threads=50): |
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
#!/usr/bin/env python | |
from PIL import Image | |
from timeit import repeat | |
def prepare_test_images(dim): | |
"""Plese, be careful with dim > 32. Result image is have dim ** 4 pixels | |
(i.e. 1Mpx for 32 dim or 4Gpx for 256 dim). | |
""" | |
i1 = bytearray(dim ** 4 * 2) |
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 PIL import Image | |
from timeit import repeat | |
from image import paste_composite | |
im1 = Image.open('in1.png') | |
im1.load() | |
im2 = Image.open('in2.png') | |
im2.load() |
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 __future__ import print_function | |
import re | |
ws_match = re.compile(r'[ \t\n\r]*').match | |
number_match = re.compile( | |
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?[ \t\n\r]*', | |
(re.VERBOSE | re.MULTILINE | re.DOTALL)).match | |
nan = float('nan') | |
inf = float('inf') |