Skip to content

Instantly share code, notes, and snippets.

repos:
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
args: ["--target-version", "py39"]
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
#!/usr/bin/env bash
# ====== Variables =============================
gaps_top="4"
gaps_bottom="4"
gaps_left="4"
gaps_right="4"
gaps_inner="4"
"""
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
"""
data <- data.frame(1:110, 1:110)
for (i in seq(1, nrow(data), 10)) {
x <- colMeans(data[i:i+9,])
print(x)
}
\documentclass[12px]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\begin{document}
\section{Question 2.1.2}
#include <iostream>
using namespace std;
int main() {
int sum = 0;
for (int i = 0; i <= 1000; ++i) {
if (!(i % 3) || !(i % 5)) {
sum += i;
}
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
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
#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) {