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
repos: | |
- repo: https://github.com/psf/black | |
rev: 20.8b1 | |
hooks: | |
- id: black | |
args: ["--target-version", "py39"] |
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
syntax on | |
set noerrorbells | |
set tabstop=4 softtabstop=4 " length of tabs and spaces | |
set shiftwidth=4 " shift it over by 4 chars | |
set expandtab " tabs -> spaces | |
set smartindent | |
set nu " set line number | |
set nowrap | |
set smartcase " case sensitive searching |
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
#!/usr/bin/env bash | |
# ====== Variables ============================= | |
gaps_top="4" | |
gaps_bottom="4" | |
gaps_left="4" | |
gaps_right="4" | |
gaps_inner="4" |
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
""" | |
problem from https://www.youtube.com/watch?v=nY9tgnWLsTk | |
isTransformable(start: string, end: string, dictionary:string[]): boolean | |
start = 'dog' | |
end = 'hat' | |
dictionary = ['dot', 'cat', 'hot', 'hog', 'eat', 'dug', 'dig'] | |
dog -> dot -> hot -> hat | |
""" |
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
data <- data.frame(1:110, 1:110) | |
for (i in seq(1, nrow(data), 10)) { | |
x <- colMeans(data[i:i+9,]) | |
print(x) | |
} |
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
\documentclass[12px]{article} | |
\usepackage{amsmath} | |
\usepackage{amssymb} | |
\usepackage{amsthm} | |
\begin{document} | |
\section{Question 2.1.2} |
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
#include <iostream> | |
using namespace std; | |
int main() { | |
int sum = 0; | |
for (int i = 0; i <= 1000; ++i) { | |
if (!(i % 3) || !(i % 5)) { | |
sum += i; | |
} |
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 math import sqrt | |
epsilon = 0.000000000001 | |
def estimate(a): | |
x = 0.5 * a | |
while True: | |
y = (x + a / x) / 2 | |
if abs(y - x) < epsilon: | |
return y |
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 verticals(arg): # making the verticals | |
print('| ' * arg, '|') | |
def do_four_times(f, arg): # 4 times repeater | |
f(arg) | |
f(arg) | |
f(arg) | |
f(arg) | |
def onestroke(dim, vert_func): # make one row |
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
#include <iostream> | |
#include <string> | |
using namespace std; | |
// just to prove I'm not a noob, version 2 | |
// the right way | |
void fizzbuzz(int num){ | |
for(int x = 1; x <= num; x++) { | |
string y = ""; | |
if(x % 3 == 0) { |