Using Requests and Beautiful Soup, with the most recent Beautiful Soup 4 docs.
Install our tools (preferably in a new virtualenv):
pip install beautifulsoup4
from __future__ import division | |
from numpy.fft import rfft | |
from numpy import argmax, mean, diff, log, nonzero | |
from scipy.signal import blackmanharris, correlate | |
from time import time | |
import sys | |
try: | |
import soundfile as sf | |
except ImportError: | |
from scikits.audiolab import flacread |
# Mathieu Blondel, September 2010 | |
# License: BSD 3 clause | |
import numpy as np | |
from numpy import linalg | |
import cvxopt | |
import cvxopt.solvers | |
def linear_kernel(x1, x2): | |
return np.dot(x1, x2) |
#!/usr/bin/env python2 | |
# coding: utf-8 | |
import os,socket,threading,time | |
#import traceback | |
allow_delete = False | |
local_ip = socket.gethostbyname(socket.gethostname()) | |
local_port = 8888 | |
currdir=os.path.abspath('.') |
# -*- coding: utf-8 -*- | |
""" | |
You need to fill in your API key from google below. Note that querying | |
supported languages is not implemented. | |
Language Code | |
-------- ---- | |
Afrikaans af | |
Albanian sq | |
Arabic ar |
Using Requests and Beautiful Soup, with the most recent Beautiful Soup 4 docs.
Install our tools (preferably in a new virtualenv):
pip install beautifulsoup4
As configured in my dotfiles.
start new:
tmux
start new with session name:
# Public Domain, i.e. feel free to copy/paste | |
# Considered a hack in Python 2 | |
import inspect | |
def caller_name(skip=2): | |
"""Get a name of a caller in the format module.class.method | |
`skip` specifies how many levels of stack to skip while getting caller | |
name. skip=1 means "who calls me", skip=2 "who calls my caller" etc. |
#!/usr/bin/env bash | |
mkdir vim | |
curl https://s3.amazonaws.com/heroku-vim/vim-7.3.tar.gz --location --silent | tar xz -C vim | |
export PATH=$PATH:/app/vim/bin |
import matplotlib | |
import matplotlib.pyplot as plt | |
# Iris petal length/width scatterplot (greatest class correlation) | |
# Dataset: http://archive.ics.uci.edu/ml/datasets/Iris | |
# Output: https://imgur.com/9TWhn | |
def data(): | |
lists = [line.strip().split(",") for line in open('flowerdata.txt', 'r').readlines()] | |
return [map(float, l[:4]) for l in lists], [l[-1] for l in lists] |