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
# histograms of various distributions | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib as mpl | |
mpl.rcParams['mathtext.fontset'] = 'cm' | |
normal_50 = np.random.normal(50, scale=13, size=100000) | |
normal_30 = np.random.normal(30, scale=10, size=100000) |
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
''' | |
Implementation of the "Flip" game, in which clicking on a tile flips itself and the four tiles touching it. | |
''' | |
import random | |
import pygame | |
pygame.init() | |
pygame.display.set_caption('flip game') |
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 matplotlib import pyplot as plt | |
import math_pi, sympy | |
import math | |
import numpy as np | |
from matplotlib.collections import LineCollection | |
N = 10000 | |
def first_n_fib(n): | |
a, b = 0, 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 json | |
import markdown | |
from pygments import highlight | |
from pygments.lexers import PythonLexer | |
from pygments.formatters import HtmlFormatter | |
import re | |
import sys | |
help_string = ''' | |
Format: python nbconv.py <in_filename> <out_filename> [-s] |
Loading
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
# boggle game (another use case for words_alpha.txt) | |
'''IDEA''' | |
''' | |
CLI implementation of Boggle | |
Idea: give user a 4x4 (or maybe 5x5) boggle board as follows (letters inaccurate) | |
A B C D | |
E F G H |
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 sys, re | |
# read in word list | |
with open('words_alpha.txt') as f: | |
words = set(f.read().split()) | |
def solve(puzzle, words): | |
# puzzle is a list of the following form: | |
# ['x', 'x0', 'x1', 'x2', 'x3', 'x4', 'x5'] | |
# where x and x0..x5 are all single character strings, and |
Loading
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
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout some time, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see https://i3wm.org/docs/userguide.html for a complete reference! |