Reload file
C+x C+v
Open file
C+x C+f
.root___1Rh2d { | |
padding: .5rem 1rem .5625rem; | |
border: none; | |
color: #fff; | |
font-size: larger; | |
cursor: pointer; | |
border-radius: 1.25rem; | |
border: 2px solid #900 | |
} |
async function queryGoogle(target) { | |
const page = await browser.newPage(); | |
await page.goto('https://google.com'); | |
await page.keyboard.type(target + " MSA") | |
await page.keyboard.press("Enter") | |
await page.waitForNavigation(); | |
await page.content() | |
const title = await page.evaluate(() => { | |
let elements = document.querySelectorAll('h3'); | |
return elements[0].textContent; |
dfs (remainCoins, target): | |
if target === 0: | |
# calculate what coins you used here | |
usedCoin = ... | |
results.append(usedCoin) | |
return | |
if target < 0: | |
return | |
for coin in remainCoins: |
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
import sys | |
import numpy as np | |
from scipy.cluster.hierarchy import dendrogram, linkage | |
import matplotlib.pyplot as plt | |
def minidistance(S1, S2) : | |
N = len(S1) | |
M = len(S2) | |
matrix = np.zeros((N + 1, M + 1), dtype=int) #Build an alignment matrix | |
matrix[0][0] = 0 |
from scipy import fftpack | |
import imageio | |
import numpy | |
# load in an image, convert to grayscale if needed | |
image = imageio.imread('ft/input.png', as_gray=True) | |
# take the fourier transform of the image | |
fft2 = fftpack.fftshift(fftpack.fft2(image)) |
def get_next_status_set(status): | |
ret = [] | |
status_len = len(status) | |
for i in range(status_len - 1): | |
if status[i] == '1' and status[i + 1] == '0': | |
new = status[:] | |
new[i] = '0' | |
new[i + 1] = '1' | |
ret.append(''.join(new)) | |
# handl the last case |
class TreeNode: | |
def __init__(self, x): | |
self.val = x | |
self.left = None | |
self.right = None | |
class Solution: | |
def isUnivalTree(self, root): | |
""" | |
:type root: TreeNode |
def fact1(n): | |
acc = 1 | |
for i in range(n): | |
# print(acc, i + 1) | |
acc *= (i + 1) | |
return acc | |