This file contains hidden or 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 cv2 | |
def paddedzoom(img, zoomfactor=0.8): | |
''' | |
Zoom in/out an image while keeping the input image shape. | |
i.e., zero pad when factor<1, clip out when factor>1. | |
there is another version below (paddedzoom2) | |
''' |
This file contains hidden or 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 pylab import * | |
val=range(4) | |
cmaps = [('Sequential', ['Blues', 'BuGn', 'BuPu', | |
'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', | |
'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu', | |
'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd']), | |
('Sequential (2)', ['afmhot', 'autumn', 'bone', 'cool', 'copper', | |
'gist_heat', 'gray', 'hot', 'pink', | |
'spring', 'summer', 'winter']), |
This file contains hidden or 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, sys | |
from direct.showbase.ShowBase import ShowBase | |
from panda3d.core import ClockObject | |
cmdstring = ('ffmpeg.exe', # put it in the same dir | |
'-y', # overwrite the file w/o warning | |
'-r', '%f' % 30.0, # frame rate of encoded video | |
'-an', # no audio | |
'-analyzeduration', '0', # skip auto codec analysis |
This file contains hidden or 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 division | |
import os | |
import cv2 | |
import numpy as np | |
from panda3d.core import Texture, CardMaker | |
from direct.showbase.ShowBase import ShowBase |
This file contains hidden or 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 cStringIO import StringIO | |
from time import sleep | |
from PIL import Image | |
import win32clipboard | |
def copy2clipboard(fig=None): | |
''' | |
copy a matplotlib figure to clipboard as BMP on windows |
This file contains hidden or 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 | |
import glob, os, shutil | |
VERSION = '1.25' | |
DEST = r'C:/libs' | |
# header files | |
shutil.rmtree(r'%s\include\geany' % DEST, ignore_errors=True) | |
shutil.copytree(r'geany-%s\include\geany' % VERSION, r'%s\include\geany' % DEST) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 datetime | |
from bs4 import BeautifulSoup | |
import pandas as pd | |
import requests | |
def getData(year=2014, month=1, proxies={}): | |
url = 'http://en.tutiempo.net/climate/%02d-%d/ws-66010.html' % (month, year) |
This file contains hidden or 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 multiprocessing, os, Queue, subprocess, sys | |
from time import sleep | |
class Worker(multiprocessing.Process): | |
'''http://jeetworks.org/node/81 modified example in the comments''' | |
def __init__(self, work_queue): | |
# base class initialization | |
multiprocessing.Process.__init__(self) |
This file contains hidden or 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
# ======================================================== # | |
# File automagically generated by GUI2Exe version 0.5.3 | |
# Copyright: (c) 2007-2012 Andrea Gavana | |
# ======================================================== # | |
# Let's start with some default (for me) imports... | |
from distutils.core import setup | |
from py2exe.build_exe import py2exe |