Skip to content

Instantly share code, notes, and snippets.

@millawell
millawell / pgn2png.py
Last active July 22, 2022 09:49
board position pgn to png
import chess.pgn
import chess.svg
from cairosvg import svg2png
from PIL import Image
from io import BytesIO
colors = ["#ced27b", "#aaa346"]
with open("mar4058_1.pgn", "r") as fin:
game = chess.pgn.read_game(fin)
from lxml import etree
from pathlib import Path
from standoffconverter import Standoff, View
from tqdm import tqdm
def get_namespaces():
return {
"pos":"http:///de/tudarmstadt/ukp/dkpro/core/api/lexmorph/type/pos.ecore",
"tcas":"http:///uima/tcas.ecore",
"xmi":"http://www.omg.org/XMI",
import typer
from pathlib import Path
from functools import partial
from tqdm import tqdm
from lxml import etree
from spacy.tokens import DocBin
from spacy.util import get_lang_class
@millawell
millawell / pandoc.css
Created June 19, 2017 15:29 — forked from killercup/pandoc.css
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
import pandas as pd
import numpy as np
import scipy as sc
from scipy import stats
import matplotlib.pyplot as plt
data = np.loadtxt('Implementation2.mat')
data = pd.DataFrame(data, columns=['time', 'q0', 'q1', 'q2', 'dq0', 'dq1', 'dq2', 'qd0', 'qd1', 'qd2', 'tau0', 'tau1', 'tau2', 'x0', 'x1', 'x2', 'dx0', 'dx1', 'dx2', 'xd0', 'xd1', 'xd2' ])
X = data[['time','q0','q1', 'q2','qd0','qd1', 'qd2']]