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 turtle import * | |
''' | |
Animated result: http://imgur.com/H49ukwF.gif | |
This script saves each image as 000.ps, 001.ps, ..., 180.ps | |
The Postscript files can be converted to jpgs/pngs using imagemagick: | |
$ convert -density 200 -geometry 50% -flatten 180.ps 180.png |
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 re | |
ORIGINAL_FILEPATH = '/Users/chloerainezeller/Desktop/Occidental/Oxy - Fourth Year/First Semester/COMPSCI COMPS/Debiasing-Word-Embeddings/fastText/data.txt' | |
NEW_FILEPATH = 'gender_neutral_data.txt' | |
MARKER = '_CHLOE_ROCKS' | |
REPLACEMENTS = [ | |
['she','he'], | |
['her','him'], |
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 python3 | |
# vim: set fileencoding=utf-8 | |
for num_claps in range(2, 5): | |
globals()[num_claps * 'clap'] = (lambda num_claps: | |
(lambda: print(num_claps * '👏')) | |
)(num_claps) | |
clapclap() | |
clapclapclap() |
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/sh | |
export INSTALL_DIR=/usr/local | |
# download and install sqlite (required by proj) | |
curl -L https://www.sqlite.org/2020/sqlite-autoconf-3340000.tar.gz > sqlite.tar.gz | |
tar -xzvf sqlite.tar.gz | |
cd sqlite-autoconf-3340000/ | |
CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1" ./configure --prefix=$INSTALL_DIR | |
make |
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 python3 | |
"""A recursive-descent arithmetic calculator.""" | |
import re | |
from collections import namedtuple | |
from fractions import Fraction | |
Parse = namedtuple('Parse', 'value, index') | |
FAILURE = Parse(None, -1) |