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 csv | |
import math | |
# the files are encoded in gb but I converted them to utf-8 | |
# csv reader wants newlines as '' | |
with open("CharFreq_inform.txt", newline = '', encoding = "utf-8") as unigrams: | |
fieldnames = ["index", "char", "freq"] | |
reader = csv.DictReader(unigrams, delimiter = '\t', fieldnames = fieldnames) | |
# skip the first six rows, including the header | |
for i in range(6): |
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
// Example of a flawed graph for inserting nodes based on RPO ordering | |
// image | |
digraph { | |
0 | |
3 | |
4 | |
19 | |
21 | |
22 | |
23 |
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
var handleSize = 5; | |
var width = 500, height = 500; | |
function init() { | |
var canvas = document.getElementById("canvas"); | |
var ctx = canvas.getContext("2d"); | |
var shape = {x: 100, y: 300, X: 400, Y: 50, cornerX: 50, cornerY: 450}; | |
var drag = {inner: false, outer: false}; | |
canvas.addEventListener("mousedown", (e) => mouseDown(e, shape, drag), false); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Text input</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/94/three.min.js"></script> | |
<script src="https://cdn.rawgit.com/jeromeetienne/threex.keyboardstate/master/threex.keyboardstate.js"></script> | |
<script src="model.js"></script> | |
<script src="main.js"></script> | |
<style> | |
body { |
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
if [ $# -ne 2 ]; then | |
echo "merge src patch" | |
exit 1 | |
fi | |
num=$(ls -1q $1 | wc -l) | |
extra=$(ls -1q $2 | wc -l) | |
for x in $(seq 0 $((extra - 1))); do |
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 sys import argv | |
import requests | |
import json | |
import os | |
import itertools | |
endpoint_url = "https://ssl.seiga.nicovideo.jp" | |
OUT_DIR = "out" | |
# endpoint + "/api/v1/comicwalker/episodes/" + episode_id + "/frames" |
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
@echo off | |
setlocal enabledelayedexpansion | |
for %%f in (Album/pri_l_*.unity3d) do @( | |
set id=%%~nf | |
unpack.py Album/%%f Processed/!id:~6!_large.png | |
) | |
for %%f in (Album/pri_s_*.unity3d) do @( | |
set id=%%~nf | |
unpack.py Album/%%f Processed/!id:~6!_small.png | |
) |