We're getting ripped off. No matter what, we need to do something about 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
"""Downloads ArXiv papers linked to in a Google Doc converted to HTML. | |
Notes: | |
------ | |
* tested on OS X with Python 3 | |
* Requires arxiv (`pip install arxiv`) | |
* Names of PDFs will be the papers' titles on ArXiv (with some | |
slight formatting changes). | |
""" |
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
"""Scrape the definition of a word (or phrase) from dictionary.com | |
Usage: | |
====== | |
python define.py onomatopoeia | |
Warning: | |
======== | |
Sometimes (at least with phrases) you'll be unexpectedly redirected | |
to the definition of another only loosely related word, |
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
"""The goal of this gist is to show how to compute many points on a path | |
quickly using NumPy arrays. I.e. there's a much faster way than using, say | |
[some_path.point(t) for t in many_tvals]. The example below assumes the | |
`Path` object is composed entirely of `CubicBezier` objects, but this can | |
easily be generalized to paths containing `Line` and `QuadraticBezier` objects | |
also. | |
Note: The relevant matrix transformation for quadratics can be found in the | |
svgpathtools.bezier module.""" | |
import numpy as np |
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
""" | |
An example of how to determine if an svg path is contained in another | |
svg path in Python. | |
Note: for discontinuous paths you can use the svgpathtools | |
Path.continuous_subpaths() method to split a paths into a list of its | |
continuous subpaths. | |
""" | |
from svgpathtools import * |
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 svgpathtools import * | |
# create some example paths | |
path1 = CubicBezier(1,2+3j,3-5j,4+1j) | |
path2 = path1.rotated(60).translated(3) | |
# find minimizer | |
from scipy.optimize import fminbound | |
def dist(t): | |
return path1.radialrange(path2.point(t))[0][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
""" | |
Description: | |
Takes in a color image and creates a two CSV files storing downsized | |
matrix (grayscale) and 3-tensor representations of the image. | |
Instructions: | |
Put your image in the same folder as this file (tool4c.py), | |
then open a terminal in that folder and enter: | |
python tool4c <your_image> |
NewerOlder