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 pickle | |
import re | |
import os | |
from time import sleep | |
import urllib.parse | |
from pandas import read_csv | |
from selenium.webdriver.common.by import By | |
from selenium import webdriver |
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
# generates an svg topographical map from a GeoTIFF file. | |
import rasterio | |
from shapely.geometry import Point, LineString | |
from skimage.measure import find_contours | |
from numpy import rot90, fliplr, flipud | |
# this data was downloaded from https://maps.canada.ca/czs/index-en.html | |
fp = r'dataset/DEM.tif' | |
dataset = rasterio.open(fp) | |
_min = None |
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 svgwrite | |
from svgwrite.path import Path | |
from svgwrite.shapes import Polygon, Polyline | |
from svgwrite.container import Group | |
from svgwrite.mixins import Transform | |
from math import sin, cos, pi, sqrt | |
width = 50 | |
angle = 60*pi/360.0 | |
margin = 10 | |
scale_ratio = (width-margin)/width |
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
--- | |
- hosts: localhost | |
vars: | |
po: en_US | |
username: CatherineH | |
branch: change-pip-url | |
tasks: | |
- name: install debian packages | |
become: true | |
apt: |
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 latest version of this code is available at https://github.com/CatherineH/python-sewing/blob/master/patchwork.py |
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 random import randint | |
import matplotlib.pyplot as plt | |
from matplotlib.ticker import FormatStrFormatter | |
from qutip import tensor, basis, hadamard_transform, identity | |
# initialize the |0> and |1> qubit states | |
zero = basis(2, 0) | |
one = basis(2, 1) | |
# how many times have we applied the oracle and diffuser? |
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 wsvg, Line, QuadraticBezier, Path | |
from freetype import Face | |
def tuple_to_imag(t): | |
return t[0] + t[1] * 1j | |
face = Face('./Vera.ttf') |
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
<html> | |
<body> | |
<p>Quick SVG</p> | |
<svg id="quickSVG"></svg> | |
<p>DOM SVG</p> | |
<svg id="appendSVG"></svg> | |
<script> | |
var circle ="<svg>\n" + | |
" <ellipse\n" + |
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 | |
from openzwave.option import ZWaveOption | |
from libopenzwave import PyManager | |
import csv | |
from matplotlib import pyplot | |
device="/dev/ttyUSB0" | |
options = ZWaveOption(device, config_path="/etc/openzwave/", user_path=".", cmd_line="") | |
options.set_console_output(False) | |
options.lock() |
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 os.path import join, dirname, abspath | |
from matplotlib import pyplot | |
from matplotlib.cbook import get_sample_data | |
from numpy import linspace | |
from numpy.core.umath import pi | |
from numpy.ma import sin | |
# poo-mark came from emojipedia: | |
# https://emojipedia-us.s3.amazonaws.com/thumbs/120/apple/96/pile-of-poo_1f4a9.png | |
poo_img = pyplot.imread(get_sample_data(join(dirname(abspath(__file__)), "poo-mark.png"))) |
NewerOlder