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
"""Defines some shared data structures.""" | |
from collections import OrderedDict | |
from typing import Generic, Hashable, TypeVar, overload | |
Tk = TypeVar("Tk", bound=Hashable) | |
Tv = TypeVar("Tv") | |
class LRUCache(Generic[Tk, Tv]): |
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 argparse | |
import contextlib | |
import logging | |
import math | |
import random | |
import time | |
from dataclasses import dataclass | |
from pathlib import Path | |
from typing import Callable |
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 argparse | |
import contextlib | |
import logging | |
import math | |
import random | |
import time | |
from dataclasses import dataclass | |
from pathlib import Path | |
from typing import Callable |
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
// Mount for my ESP 32 above my workbench. | |
cam_diam = 7.7 + 1.0; | |
cam_offset = 2.1; | |
other_offset = 1.9; | |
rect_height = 39.6 + 1.0; | |
rect_width = 27.0 + 4.0; | |
cam_from_top = 10.4; | |
leng = 55; |
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/env python | |
import argparse | |
from datetime import datetime | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
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
// Total dimensions. | |
height = 120; | |
width = 40; | |
padding = 10; | |
module col(h, sph=false) { | |
difference() { | |
cube([width, width, h]); | |
if (sph) | |
translate([width / 2, width / 2, h]) |
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
/* | |
A combination for a lock has 3 wheels, X, Y, and Z, each of which | |
can be set to eight different positions. The lock is broken and when | |
any two wheels of the lock are in the correct position, the lock | |
will open. Thus, anyone can open the lock after 64 tries (let A and | |
B run through all possible permutations). However, the safe can be | |
opened in fewer tries! What is the minimum number of tries that can | |
be guaranteed to open the lock? | |
*/ |
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/env python3 | |
"""Problem statement: | |
There is a teacher and 2 students in a classroom. The students are A and B. | |
The teacher thinks of 2 positive integers and tells the sum of those numbers | |
to student A without student B hearing it. Then tells their product to student | |
B without student A hearing it. After this, the teacher asks the 2 students | |
what was the 2 numbers. | |
First student A says: I don't know. |
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
thickness = 3; | |
padding = 1; | |
slat_size = 3; | |
short_length = 46.36; | |
long_length = 61.76; | |
height = 51.76; | |
first_indent = 15.92; | |
second_indent = 29.97; |
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
// Parametric OpenSCAD design for a laptop stand. | |
// Laptop dimensions. | |
lwid = 304.1; | |
lhei = 212.4; | |
ldep = 15; | |
// Stand long dimensions. | |
slen = 200; | |
sswid = 60; |
NewerOlder