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
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.css" integrity="sha384-vKruj+a13U8yHIkAyGgK1J3ArTLzrFGBbBc0tDp4ad/EyewESeXE/Iv67Aj8gKZ0" crossorigin="anonymous"> | |
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.js" integrity="sha384-PwRUT/YqbnEjkZO0zZxNqcxACrXe+j766U2amXcgMg5457rve2Y7I6ZJSm2A0mS4" crossorigin="anonymous"></script> | |
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"></script> | |
<script> | |
document.addEventListener("DOMContentLoaded", () => { | |
function render(src, elem, displayMode) { | |
if (elem.rendered) return; | |
try { | |
katex.render(src, elem, { displayMode }); | |
} catch (ex) { |
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
function imul(x, y) { | |
return [x[0] * y[0] - x[1] * y[1], x[0] * y[1] + x[1] * y[0]]; | |
} | |
function cross(x, y) { | |
return [x[1] * y[2] - x[2] * y[1], x[2] * y[0] - x[0] * y[2], x[1] * y[2] - x[2] * y[1]]; | |
} | |
function vdot(x, y) { | |
return x.reduce((acc, xi, i) => acc + xi * y[i], 0); |
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
# CC0 http://creativecommons.org/publicdomain/zero/1.0/ | |
phonemes = {} | |
phonemes2 = {} | |
def setphonemes(phs): | |
for ph in phs.split(): | |
p1, p2 = ph.split(",") | |
phonemes[p1] = p2 | |
if len(p1) > 1: phonemes2[p1[0]] = 1; |
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
export function* splitLines(text: string) { | |
let line = "", prev = ""; | |
for (const ch of text) { | |
if (ch == '\r') { | |
yield line; | |
line = ""; | |
} else if (ch == '\n') { | |
if (prev != '\r') yield line; | |
line = ""; | |
} else { |
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 lang="ja" style="height:100%"> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
.gutter { | |
background-color: #eee; | |
} |
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 getopt, sys, win32com.client | |
options = "lo:v:r:i:ps:" | |
def usage(): | |
print("[usage] %s -l | [-o] [-v] [-r] (-i | -p | -s | text)" % sys.argv[0]) | |
print(" -l language: case insensitive, begins-with match") | |
print(" -o output.wav") | |
print(" -v voice: case insensitive, 'Microsoft' can be dropped.") | |
print(" -r rate: -10 (slow) ... 10 (fast)") | |
print(" -i input.txt") |
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
// (0) PUBLIC DOMAIN | |
// To the extent possible under law, the person who associated CC0 with this work | |
// has waived all copyright and related or neighboring rights to this work. | |
#r "System" | |
#if NETF | |
#r "System.Drawing" | |
#r "System.Windows.Forms" | |
#else | |
//#r "nuget: System.Drawing.Common, 5.0.2" |
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
abs | |
adc | |
adcs | |
add | |
addhn | |
addhn2 | |
addp | |
adds | |
addv | |
adr |
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
// https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-wmf/4813e7fd-52d0-4f42-965f-228c8b7488d2 | |
// https://www.codeproject.com/Questions/540673/InsertplusimageplusinplusRichTextBoxpluswithoutplu | |
// https://stackoverflow.com/questions/1490734/programmatically-adding-images-to-rtf-document | |
// https://garakutatech.blogspot.com/2021/01/cwpfwinformsrichtextboxjpeg.html | |
using System; | |
using System.Drawing; | |
using System.Drawing.Imaging; | |
using System.IO; | |
using System.Text; |
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
# https://github.com/toki-pona/ilo-pi-sitelen-pona/blob/master/client/styles/fonts/tp/toki-pona.woff | |
base64 -w 0 toki-pona.woff > toki-pona.woff.b64 |