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 flask import Flask, render_template, request, jsonify | |
| app = Flask(__name__) | |
| @app.route("/") | |
| def home(): | |
| return render_template("index.html") |
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 python3 | |
| import enum | |
| import time | |
| import random | |
| import argparse | |
| @enum.unique | |
| class Tile(enum.Enum): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 <array> | |
| #include <regex> | |
| #include <chrono> | |
| #include <thread> | |
| #include <string> | |
| #include <cstdio> | |
| #include <memory> | |
| #include <cstdint> | |
| #include <iostream> | |
| #include <stdexcept> |
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 python3 | |
| import pathlib | |
| import hashlib | |
| import argparse | |
| def compute(path: pathlib.Path, h_name: str = 'sha256') -> str: | |
| hasher = hashlib.new(h_name) | |
| with open(path, 'rb') as f: |
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
| class Hex(int): | |
| def __repr__(self) -> str: | |
| return hex(self) | |
| _ops = ['__add__', '__sub__', '__mul__'] | |
| def _monkey_patch_op(operation): | |
| """ |
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 csv | |
| N = 8 | |
| data = [] | |
| with open("data.csv") as f: | |
| table = csv.reader(f) | |
| next(table) | |
| for row in table: | |
| data.append(list(map(int, row))) |
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
| class Node: | |
| def __init__(self, data): | |
| self.data = data | |
| self.next = None | |
| class List: | |
| def __init__(self): | |
| self.head = None |
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 Dict | |
| from pprint import pprint | |
| def parse_dataset(filename: str) -> Dict[str, str]: | |
| data = {} | |
| with open(filename) as f: | |
| for line in f: | |
| line = line.rstrip() | |
| if line.startswith(">"): |