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 warnings | |
| import matplotlib.pyplot as plt | |
| from typing import Callable, Dict, Iterable, List | |
| warnings.filterwarnings("ignore") | |
| Nodes: List['Node'] = [] # List of every node to make column for | |
| Vars: Dict[str, bool] = {} # Dictionary of every variable and its value | |
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 | |
| class PrimesConstants: | |
| SMALL_PRIMES = [ | |
| 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, | |
| 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, | |
| 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, | |
| 173, 179, 181, 191, 193, 197, 199 | |
| ] |
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
| /** | |
| * MIT License | |
| * | |
| * Copyright (c) 2022, Samuel Robert Belliveau | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
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
| /** | |
| * MIT License | |
| * | |
| * Copyright (c) 2022, Samuel Robert Belliveau | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
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
| from math import log2, floor, ceil, sqrt | |
| # Class that represents a polynomial mod (x^r - 1, n) | |
| class Polynomial: | |
| # Create polynomial that equals 0 mod (x^r - 1, n) | |
| def __init__(self, r, n, coeff=None): | |
| self.r = r | |
| self.n = 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
| from typing import Union | |
| import asyncio | |
| from emoji import is_emoji | |
| from time import time | |
| from discord import Client, Intents | |
| from openai import Completion | |
| OPENAI_MODELS = { |
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 java.util.ArrayDeque; | |
| import java.util.Queue; | |
| public class ArmBFSField { | |
| public interface Constraint { | |
| public boolean isInvalid(double armDeg, double wristDeg); | |
| public default Constraint add(Constraint next) { | |
| return (a, w) -> this.isInvalid(a, w) || next.isInvalid(a, w); |
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
| /** | |
| * Copyright 2023 Sam Belliveau | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the “Software”), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is | |
| * furnished to do so, subject to the following conditions: |
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
| // Copyright (c) 2023 Sam Belliveau. All rights reserved. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: | |
| // | |
| // The above copyright notice and this permission notice shall be included in all |
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
| // Copyright (c) 2024 Sam Belliveau. All rights reserved. | |
| // | |
| // This work is licensed under the terms of the MIT license. | |
| // For a copy, see <https://opensource.org/licenses/MIT>. | |
| /** | |
| * Below is a test ran on my M2 Max Macbook Pro. The results are not | |
| * guaranteed to be the same on other systems, but should be similar. | |
| * | |
| * This code is intended to be ran on embedded devices where the |