Skip to content

Instantly share code, notes, and snippets.

View pqcfox's full-sized avatar
❄️
bapping bits!

kat watson 🦊 pqcfox

❄️
bapping bits!
View GitHub Profile
@pqcfox
pqcfox / nwab.py
Created February 6, 2022 07:08
The script running nWab (@nwab_uwu)
# All credit to Daniel Liu (https://github.com/Daniel-Liu-c0deb0t/uwu) for the uwuification algorithm
import random
import requests
import tweepy
from bs4 import BeautifulSoup
from string import ascii_lowercase
from subprocess import Popen, PIPE
r = requests.get('https://ncatlab.org/nlab/all_pages')
@pqcfox
pqcfox / finite.py
Last active November 16, 2021 07:25
An implementation of finite fields in Python.
# K is the exponent in our field GL(2^K)
K = 8
# MOD is the coefficients of the polynomial modulus we choose for GL(2^K),
# which here is x^8 + x^4 + x^3 + x + 1
MOD = [1, 0, 0, 0, 1, 1, 0, 1, 1]
# trim leading zeros from a polynomial (list of coefficents, starting with
# the largest-degree monomial)
def _trim(poly):
@pqcfox
pqcfox / points.py
Created August 8, 2020 03:08
A quick script to plot the density of points when placing points in [-1, 1] greedily to maximize distance from previous points.
import numpy as np
from scipy import optimize
from tqdm import tqdm
from matplotlib import pyplot as plt
NUM_POINTS = 1000
STEP = 0.001
BIN_SIZE = 0.05
grid = np.reshape(np.arange(-1, 1 + STEP, STEP), (-1, 1))
@pqcfox
pqcfox / points.py
Created August 8, 2020 03:08
A quick script to plot the density of points when placing points in [-1, 1] greedily to maximize distance from previous points.
import numpy as np
from scipy import optimize
from tqdm import tqdm
from matplotlib import pyplot as plt
NUM_POINTS = 1000
STEP = 0.001
BIN_SIZE = 0.05
grid = np.reshape(np.arange(-1, 1 + STEP, STEP), (-1, 1))
@pqcfox
pqcfox / comic.js
Created April 3, 2020 16:49
Beautified JS behind the xkcd collector's edition stuffs.
/*! code by chromako.de. */ ! function(e) {
var t = {};
function n(r) {
if (t[r]) return t[r].exports;
var i = t[r] = {
i: r,
l: !1,
exports: {}
};
@pqcfox
pqcfox / questions.txt
Created January 30, 2020 18:04
Questions for ME469
Slide 3:
Claim that each differential operator is equal to corresponding integral?
Purpose of lambda in generalized Laplace operator?
Slide 4:
What exact value is A?
Slide 6:
Motivation for choosing B_1 = -tau L?
Skew-adjoint operators yield L = DG?
This file has been truncated, but you can view the full file.
3.0
0.0
---
Multiply
0.0
---
0.0
---------
1.0
0.0
This file has been truncated, but you can view the full file.
3
0
---
Multiply
0
---
0
---------
1
0
This file has been truncated, but you can view the full file.
3
0
---
Multiply
0
---
0
---------
1
0
@pqcfox
pqcfox / build.txt
Created November 4, 2019 01:34
Ant failure when building openrockoon
build:
[echo] Compiling main classes
[javac] Compiling 25 source files to /Users/watsonc/openrockoon/swing/build/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] /Users/watsonc/openrockoon/swing/src/net/sf/openrocket/startup/HeadlessRockoonDataGen.java:114: error: method runSimulation in class HeadlessRockoon cannot be applied to given types;
[javac] new HeadlessRockoon().runSimulation(document, sim);
[javac] ^
[javac] required: OpenRocketDocument,Simulation,double,double,double,double
[javac] found: OpenRocketDocument,Simulation
[javac] reason: actual and formal argument lists differ in length