Paste this code into a new bookmark:
javascript:window.location.href=window.location.href.replace(/shorts\/(.*)/,'watch?v=$1')Click the bookmark whenever you are watching a YouTube short to convert it to a regular video!
URL Encoded
| import math | |
| import random | |
| N = 200 # REPLACE ME | |
| class Simulation: | |
| def __init__(self, partition_size: int): | |
| self.partition_size = partition_size | |
| self.bits = [-1] * N # 0, 1, or -1 (unset) |
| import random | |
| def flip_coin(): | |
| """ | |
| True = Heads, False = Tails | |
| """ | |
| return bool(random.getrandbits(1)) | |
| def flip_until_sequence(seq): |
| package chopsticks; | |
| /** | |
| * Chopsticks hand game | |
| */ | |
| public class Game { | |
| // There are two players in the game | |
| private Player p1; | |
| private Player p2; |
| class LogicTester { | |
| public static void main(String[] args) { | |
| testBool(false, false); | |
| testBool(true, false); | |
| testBool(false, true); | |
| testBool(true, true); | |
| } | |
| public static void testBool(boolean a, boolean b) { | |
| boolean original = !a || (a && b); |
| from argparse import ArgumentParser | |
| from itertools import product, islice | |
| from random import sample | |
| def main(): | |
| parser = ArgumentParser() | |
| parser.add_argument("-p", "--prompt", action="store_true", help="prompt the user instead of using default values") | |
| args = parser.parse_args() |
| import os | |
| for entry in os.scandir('files'): | |
| with open(entry) as file: | |
| lines = file.readlines() | |
| for i, line in enumerate(lines): | |
| substr = line.split()[0] | |
| new_substr = ''.join(str(int(c) - 1) for c in substr) | |
| lines[i] = f'{new_substr} {line.split()[1]}\n' |
| """ | |
| Calculate binomial distribution using the formula | |
| P(k successes) = nCk * p^k * q^(n - k) | |
| where | |
| n = ? (number of trials) | |
| p = ? (probability of success on a single trial) | |
| q = 1 - p (probability of failure on a single trial) | |
| """ | |
| from math import comb |
| function wrap(element, wrapper) { | |
| element.parentNode.insertBefore(wrapper, element); | |
| wrapper.appendChild(element); | |
| } |