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 Generator | |
| import llama_cpp | |
| import numpy as np | |
| import regex | |
| from lark import Lark, UnexpectedInput, UnexpectedToken | |
| from llama_cpp import Llama | |
| from pydantic import BaseModel, Field | |
| import rstr | |
| from itertools import islice |
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 numpy as np | |
| np.random.seed(256) | |
| DTYPE=np.int64 | |
| P = 101 | |
| def is_singular(matrix: np.ndarray) -> bool: | |
| return np.isclose(np.linalg.det(matrix), 0) | |
| def add(x, y, m): return (x + y) % m | |
| def sub(x, y, m): return (x - y) % m |
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
| const clickableElements = await page.evaluate(async () => { | |
| const resultElements: Elem[] = [] | |
| const clickables = [ | |
| 'a', | |
| 'button', | |
| 'input', | |
| 'textarea', | |
| 'select', | |
| 'details', | |
| 'summary' |
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
| {pkgs, ...}: let | |
| pname = "cursor"; | |
| version = "0.39.6"; | |
| src = pkgs.fetchurl { | |
| url = "https://downloader.cursor.sh/linux/appImage/x64"; | |
| hash = "sha256-huZTzIZFAYtGRMhXGC+1sd0l2s5913QkWM+QjCtsEl0="; | |
| # use this to update the hash | |
| # nix hash to-sri --type sha256 $(nix-prefetch-url https://downloader.cursor.sh/linux/appImage/x64) | |
| }; |
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 numpy as np | |
| from matplotlib import pyplot as plt | |
| from tqdm import tqdm | |
| data = [] | |
| num_refreshed_data = [] | |
| ITERATIONS = 5_000 | |
| N = 10_000 | |
| T = 100 |
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 httpx | |
| HOST = "https://dsapi.expcloud.com/odata/replication" | |
| IMAGE_SERVICE_KEY = "..." | |
| GET_TOKEN = "https://dsauth.expcloud.com/oauth2/token" | |
| CLIENT_ID = "..." | |
| SECRET = "..." | |
| SCOPE = "..." |
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 Mathlib.Analysis.InnerProductSpace.Basic | |
| import Mathlib.Analysis.NormedSpace.Basic | |
| variable (F : Type) [LinearOrder F] [NormedAddCommGroup F] [InnerProductSpace ℝ F] | |
| open RealInnerProductSpace | |
| -- https://en.wikipedia.org/wiki/Cauchy%E2%80%93Schwarz_inequality | |
| theorem cauchy_schwarz_inequality (u v : F) : | |
| |⟪u, v⟫| ^ 2 ≤ ⟪u, u⟫ * ⟪v, v⟫ := by { |
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 | |
| from functools import reduce | |
| import numpy as np | |
| from matplotlib import pyplot as plt | |
| player_names = ["Alice", "Bob", "Charlie", "David"] | |
| match_matrix = np.zeros((len(player_names), len(player_names))) | |
| # player in the first position is the prob of winning |
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
| """Implementation of RREF (Reduced Row Echelon Form).""" | |
| import functools | |
| import hashlib | |
| import time | |
| from abc import ABC, abstractmethod | |
| from textwrap import dedent | |
| from typing import Any, Iterator, Optional | |
| import numpy as np |
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 bash | |
| # | |
| # Boot a local ubuntu VM auto installed with yeet | |
| # Learn more about yeet: yeet.cx | |
| # | |
| YEET_KEY="..." | |
| echo "boot2yeet starting..." | |
| if [ ! -f ./id_rsa.pub ]; then |