Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 TypingTutor: | |
def __init__(self): | |
st.set_page_config(page_title="Typing Tutor", layout="wide") | |
st.markdown( | |
"<h1 style='text-align: center; color: black;'>Typing Tutor</h1>", | |
unsafe_allow_html=True, | |
) |
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 Solution: | |
def __init__(self): | |
self.sum_val = 0 | |
def _checker(self, root: TreeNode, direction: str): | |
if root: | |
self._checker(root.left, "left") | |
if not root.left and not root.right and direction == "left": | |
# print("Adding", root.val, "to", self.sum_val) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# importing required libraries | |
%matplotlib inline | |
import numpy as np | |
import matplotlib.pyplot as plt |
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 json | |
file_name = r"3. Pytorch from Scratch (Part I).ipynb" # enter your own filename | |
with open(file_name, 'r') as f: | |
lines = f.readlines() | |
ipynb = json.loads("".join(lines)) | |
code_cells = [cell['source'] for cell in ipynb['cells'] if cell['cell_type'] == 'code'] |
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
string = e3y.__str__() | |
print("Start simplification\n") | |
print(string, " # Original string") | |
string = re.sub(r"0\*\w", r"0", string) | |
print(string, " # simplify 0*A -> 0") | |
string = re.sub(r"\w\*0", r"0", string) | |
print(string, " # simplify A*0 -> 0") | |
string = re.sub(r"1\*(\w)", r"\1", string) | |
print(string, " # simplify 1*A -> A ") |
NewerOlder