This file contains 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 time | |
import numpy as np | |
import win32api | |
import win32gui | |
import win32ui | |
import win32con | |
from PIL import Image | |
def get_window_screenshot(): |
This file contains 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 List, Set, Optional | |
from fractions import Fraction | |
from collections import Counter | |
import termtables as tt | |
def count_n_grams(l: List[str], n: int, alpha: float, vocab: Optional[Set[str]] = None): | |
n_grams = [] | |
i = 0 |
This file contains 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
def get_n_grams(s, n): | |
n_grams = [] | |
i = 0 | |
while i + n <= len(s): | |
n_grams.append(s[i:i + n]) | |
i += 1 | |
return set(n_grams) | |
def n_gram_distance(s1, s2, n, case_sensitive=False): |
This file contains 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
// Interval time to check if runtime is disconnected | |
interval = 1000 * 60; | |
// Busy/Reconnect button top-right | |
reloadButton = document.querySelector('#connect > paper-button > span') | |
setInterval(() => { | |
if (reloadButton.innerText == 'Reconnect') { | |
reloadButton.click(); | |
console.log('Restarting'); |
This file contains 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
\definecolor{mygreen}{rgb}{0,0.6,0} | |
\definecolor{myorange}{rgb}{1.0,0.5,0.3} | |
\definecolor{mymauve}{rgb}{0.58,0,0.82} | |
\definecolor{myblue}{rgb}{0.05,0.19,0.57} | |
\definecolor{mygrey}{rgb}{0.4,0.4,0.4} | |
\definecolor{myred}{rgb}{0.9,0.2,0.15} | |
\lstdefinelanguage{pddl} | |
{ | |
sensitive=false, % not case-sensitive |
This file contains 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 RPN | |
def initialize(operation) | |
@operation = operation.split(' ') | |
end | |
def calculate | |
stack = [] | |
@operation.each do |value| | |
if is_operator?(value) |