This file contains hidden or 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 cv2 | |
| import numpy as np | |
| UNITS = np.array([ | |
| [1, 0], | |
| [0, 1], | |
| [-1, 0], | |
| [0, -1], |
This file contains hidden or 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 random | |
| import cv2 | |
| import numpy as np | |
| import torch | |
| CAM_POS = torch.tensor([-5, 0, 2], dtype=torch.float) | |
| FOCAL_LEN = 1 | |
| # Facing +X |
This file contains hidden or 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 json | |
| import mido | |
| import pyautogui | |
| inputs = mido.get_input_names() | |
| for i, inp in enumerate(inputs): | |
| print(i, inp) | |
| choice = int(input("Choose input: ")) |
This file contains hidden or 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 math | |
| import time | |
| import cv2 | |
| import numpy as np | |
| def get_top_index(pos, n): | |
| top_index = math.floor(n * (3/4 - pos / (2*np.pi)) + 0.5) % n |
This file contains hidden or 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 time | |
| import cv2 | |
| import numpy as np | |
| def main(): | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("-n", type=int, default=3) |
This file contains hidden or 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 | |
| import os | |
| os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "1" | |
| import cv2 | |
| import numpy as np | |
| import pygame |
This file contains hidden or 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
| """ | |
| Simulate inverted pendulum PID controller. | |
| Run the python file to run; requires pygame. | |
| Use left/right to apply angular impulse, and up/down to apply linear impulse. | |
| """ | |
| import random | |
| import time | |
| from dataclasses import dataclass | |
| from math import sin, cos |
This file contains hidden or 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
| STRETCH = ( | |
| -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, | |
| -8, -7, -6, -6, -5, -5, -4, -4, -4, -4, -4, -3, | |
| -3, -3, -3, -3, -3, -3, -3, -3, -3, -2.5, -2.5, -2, | |
| -2, -2, -2, -2, -2, -2, -1.5, -1, -1, -1, -1, -1, | |
| 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, | |
| 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, | |
| 6, 7, 8, 9, 10, 11, 12, 13, 15, 17, 19, 21, | |
| 23, 25, 27, 30 | |
| ) |
This file contains hidden or 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
| """ | |
| Discord bot that performs semantic search. | |
| Storage format in data directory: | |
| For each server, there is one pytorch file (server_id.pt) with two keys: | |
| - "embeddings": list of message embeddings | |
| - "messages": list of message IDs, corresponding to the embeddings | |
| """ | |
| import argparse |
This file contains hidden or 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 time | |
| import mido | |
| import pyautogui | |
| class Player: | |
| keys = list("awsedftgyhuj") |
NewerOlder