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
#include <bits/stdc++.h> | |
using namespace std; | |
#define INF (ll)1e18 | |
#define ll long long | |
#define nl "\n" | |
int main() { | |
#if !ONLINE_JUDGE && !EVAL |
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 asyncio | |
import logging | |
import os | |
from itertools import cycle | |
LOADING_MESSAGES_WAITING = 0.4 | |
OLD_LEN = 0 | |
def edit(message): |
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 | |
# -*- coding: utf-8 -*- | |
from distutils.dir_util import copy_tree | |
from shutil import rmtree | |
from git import Repo | |
CACHE_DIRECTORY = "../.website" | |
COMMIT_MESSAGE = "feat: update source to %s" |
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/python | |
# -*- coding: utf-8 -*- | |
from matplotlib.animation import FuncAnimation | |
import matplotlib.pyplot as plt | |
import numpy as np | |
A, T = np.pi/20, 1.90345 | |
frames = 150 |
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 botogram | |
import random | |
bot = botogram.create("API-KEY") | |
@bot.command("random") | |
def random_command(chat, minimum: int = 0, maximum: int = 100): | |
"""Get a random number between <code>minimum</code> and <code>maximum</code>.""" | |
try: |
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 itertools | |
from dataclasses import dataclass | |
from typing import Callable, List, Optional, Tuple | |
sign_table = { | |
0: '/', | |
1: 'X', | |
2: 'O' | |
} |
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 operator | |
from dataclasses import dataclass | |
def _set_method(obj: object, name: str, operation: callable): | |
setattr(obj, name, lambda self, other: Angle.from_float(operation(float(self), float(other)))) | |
_operation_operators = { | |
'__add__': operator.add, | |
'__floordiv__': operator.floordiv, | |
'__mul__': operator.mul, |