Frequency Calculation = CLK / 16 * TP
- Lowest Possible Note: B0 (30.87Hz ~=
0xFD1) - Highest Possible Note: G#8 (6644.88Hz ~=
0x013) - Possible loss of accuracy; verify effective frequency with oscilloscope.
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>Quantum Optical Lab</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.min.js"></script> | |
| <style> | |
| body { margin: 0; padding: 0; overflow: hidden; background: #000; } | |
| canvas { display: block; } |
| const _ = require('lodash') | |
| const tournaments = _.range(1, 100000) | |
| const dieA = [1, 1, 4, 4, 4, 4] | |
| const dieB = [3, 3, 3, 3, 3, 3] | |
| const dieC = [2, 2, 2, 2, 5, 5] | |
| const roll = (die) => _.sample(die) | |
| const count = (as, e) => _.filter(as, (x) => x === e).length |
| <main class="container"> | |
| <section class="content"> | |
| <canvas class="canvas" id="canvas" resize></canvas> | |
| </section> | |
| </main> |
| <main class="container"> | |
| <section class="content"> | |
| <canvas class="canvas" id="canvas" resize></canvas> | |
| </section> | |
| <footer class="footer"> | |
| <div class="footer__body"> | |
| <p class="footer__text">A template for quickly starting a PaperJS project. <span class="signature">-CH</span></p> | |
| </div> | |
| <nav class="footer__nav"> | |
| <a href="https://codepen.io/cooper_hu" target="_blank">Other Pens</a> |
| // Primitives | |
| type Theorem = string | |
| type Parenthesis<T> = `(${T extends Theorem ? T : never})` | |
| type P = 'P' | |
| type Q = 'Q' | |
| type R = 'R' | |
| type And<A extends Theorem, B extends Theorem> = `(${A}&${B})` | |
| type Or<A extends Theorem, B extends Theorem> = `(${A}|${B})` |
| import chisel3._ | |
| def bits(x: Int) = Math.ceil((Math.log(x) / Math.log(2))).toInt | |
| class hvsync_generator( | |
| h_display: Int, h_back: Int, h_front: Int, h_sync: Int, | |
| v_display: Int, v_top: Int, v_bottom: Int, v_sync: Int) extends Module { | |
| val h_sync_start = h_display + h_front | |
| val h_sync_end = h_display + h_front + h_sync - 1 |
From the rant channel, here comes the recommended books to live in (and with) these crazy times:
| import fc = require('fast-check') | |
| import isArraySorted = require('is-array-sorted') | |
| class AsyncSemaphore { | |
| private promises = Array<() => void>() | |
| constructor(private permits: number) {} | |
| signal() { | |
| this.permits += 1 |