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/python | |
import argparse | |
import os | |
import shlex | |
import sys | |
import tempfile | |
import yaml | |
config = yaml.full_load(open(os.path.expanduser("~/.config/sandbox.yml"))) |
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 math | |
import numpy as np | |
import tensorflow as tf | |
data = np.zeros((1000, 500)) | |
def get_mdn_loss(n_kernels, n_dims): | |
def mdn_loss(y_true, y_pred): | |
logit_alpha, log_scale, mu = tf.split(y_pred, axis=1, num_or_size_splits=[n_kernels, n_kernels, n_dims*n_kernels]) |
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/python | |
""" | |
MDB_page_header: | |
pgno: size_t | |
keysize: uint16_t // for LEAF2 pages, unused otherwise | |
flags: uint16_t // 1 = BRANCH, 2 = LEAF, 4 = OVERFLOW, 8 = META, 16 = DIRTY, 32 = LEAF2, 64 = SUBP, 0x4000 = LOOSE, 0x8000 = KEEP | |
union { | |
{ lower, upper: uint16_t } | |
pages: uint32_t // overflow pages |
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/node | |
// Install dependencies: npm install @mozilla/readability jsdom got argparse | |
// Usage: node mkebook.js --title Test url1 url2 > test.epub | |
const fs = require('fs').promises; | |
const { spawn } = require('child_process'); | |
const { JSDOM } = require('jsdom'); | |
const { Readability } = require('@mozilla/readability'); |