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
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" => General | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Set 'nocompatible' to ward off unexpected things that your distro might | |
" have made, as well as sanely reset options when re-sourcing .vimrc | |
set nocompatible | |
" Set to auto read when a file is changed from the outside |
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
################################################################################ | |
# Set math environment, to allow some snippets to run only when in inline or | |
# disp math. i.e. sr ==> disregard != di^2egard. | |
################################################################################ | |
global !p | |
texMathZones = ['texMathZone'+x for x in ['A', 'AS', 'B', 'BS', 'C', 'CS', 'D', 'DS', 'E', 'ES', 'F', 'FS', 'G', 'GS', 'H', 'HS', 'I', 'IS', 'J', 'JS', 'K', 'KS', 'L', 'LS', 'DS', 'V', 'W', 'X', 'Y', 'Z']] | |
texIgnoreMathZones = ['texMathText'] |
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
%matplotlib inline | |
import numpy as np | |
from scipy import stats | |
import matplotlib.pyplot as plt | |
import matplotlib.font_manager | |
plt.rcParams["text.usetex"] = True | |
plt.rcParams["mathtext.fontset"] = "cm" | |
plt.rcParams["font.family"] = "serif" |
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 | |
def get_divisors(n): | |
res = [1] | |
i = 2 | |
while i*i < n: | |
if n % i == 0: | |
res.append(i) | |
res.append(n // i) | |
i += 1 |
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 | |
def get_divisors(n): | |
res = [] | |
for i in range(1, n): | |
if i % 3 == 0 or i % 5 == 0: | |
res.append(i) | |
return res |