sed '5!d' file
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 matplotlib.pyplot as plt | |
fig, ax = plt.subplots(ncols=1, nrows=3, figsize=(10, 15)) | |
ax[0].hist(scores1, bins=100, range=(0, 100)) # bins is number of columns, range is upper and lower bound | |
ax[1].hist(scores2, bins=100, range=(0, 100)) # bins is number of columns, range is upper and lower bound | |
ax[2].hist(diff, bins=100, range=(-300, 300)) # bins is number of columns, range is upper and lower bound | |
fig.tight_layout() | |
plt.show() |
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
python -m json.tool ajsonfile.json |
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
# currying | |
def make_in_list(alist): | |
def in_list(e): | |
return e in alist | |
return in_list | |
in_list = make_in_list([1,2,3,4,5]) | |
in_list(9) |
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
version: '3' | |
services: | |
linguistic-server: | |
image: "linguistic-server" | |
ports: | |
- "8888:8888" | |
# volumes: | |
# - .:/code | |
language-tool: | |
image: "language-tool" |
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 numpy | |
a = numpy.array([1,2,3,4,5]) | |
a.mean() | |
a.std() | |
a.max() | |
a.min() |
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 PIL.Image | |
img = PIL.Image.open('img.jpg') | |
exif_data = img._getexif() | |
import PIL.ExifTags | |
exif = { | |
PIL.ExifTags.TAGS[k]: v | |
for k, v in img._getexif().items() | |
if k in PIL.ExifTags.TAGS |
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 wand.image import Image | |
exif = {} | |
with Image(filename='wandtests/assets/beach.jpg') as image: | |
exif.update((k[5:], v) for k, v in image.metadata.items() | |
if k.startswith('exif:')) |
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
version: '3' | |
services: | |
eudb: | |
image: "192.168.10.200:5000/zhparser:9.6" | |
environment: | |
POSTGRES_DB: "campus" | |
POSTGRES_USER: "osqa" | |
POSTGRES_PASSWORD: "RenCaiXue1234$$" | |
volumes: | |
- "./eudb/log:/var/log/postgres" |
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 matplotlib.pyplot as plt | |
import matplotlib.dates as mdates | |
import matplotlib.ticker as mticker | |
from matplotlib.finance import candlestick_ohlc | |
import datetime | |
from matplotlib.dates import date2num | |
fig = plt.figure() | |
ax1 = plt.subplot2grid((1,1), (0,0)) |
OlderNewer