Skip to content

Instantly share code, notes, and snippets.

@bellbind
bellbind / eigenvalues.js
Last active December 27, 2021 17:37
[javascript] compute eigenvalues with QR method and Householder Trans
"use strict";
// helpers
function mat2d(mat) {
const n = Math.sqrt(mat.length);
return Array.from(Array(n), (_, i) => mat.slice(i * n, i * n + n));
}
function range(n, f = v => v) {
return Array.from(Array(n), (_, i) => f(i));
}
@MightyPork
MightyPork / usb_hid_keys.h
Last active June 30, 2024 10:41
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/