Instantly share code, notes, and snippets.

# Petr Simeceksimecek

• Sort options
Last active Sep 13, 2018
View draw_board.R
 if (!require(tidyverse)) { install.packages("tidyverse") library(tidyverse) } # Game of Life visualisation draw_board <- function(board) { # number of rows and columns M = nrow(board)
Created Sep 23, 2018
Debug magic.ipynb
View debug-magic.ipynb Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Oct 30, 2018
Created Nov 4, 2018
ReprlibDemo.ipynb
View reprlibdemo.ipynb Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Dec 18, 2018
Numpy append is slow.ipynb
View numpy-append-is-slow.ipynb Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Feb 14, 2019
R/Python Valentine Script
View valentine.py.R
 s = 'Python is awesome!' red = "#FA5882" a = eval("exec('import sys; import matplotlib.pyplot as plt; import numpy as np; print(s); t = np.arange(0,2*np.pi, 0.1); x = 16*np.sin(t)**3; y = 13*np.cos(t)-5*np.cos(2*t)-2*np.cos(3*t)-np.cos(4*t); plt.fill(x,y,color=red); plt.show(); sys.exit()')") print('R is great too!') X11() # Use windows() or qartz() if on Windows or Mac t = seq(0, 2*pi, by=0.1) x = 16*sin(t)^3 y = 13*cos(t) - 5*cos(2*t) - 2*cos(3*t) - cos(4*t) plot(x=x, y=y, type="n", xlab="", ylab="") polygon(x=x, y=y, col=red, border=red)
Created May 26, 2019
Number Of instances.ipynb
View number-of-instances.ipynb Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Jun 9, 2019
Time_measuring_decorator.ipynb
View time_measuring_decorator.ipynb Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Last active Oct 6, 2019
Save all objects from your session into a single compressed file
View save_env.py
 import __main__ import pickle from bz2 import BZ2File from gzip import GzipFile from typing import Optional, List def save_env(path: str, objects: Optional[List[str]] = None, compress: str = 'gzip', protocol: int = -1): """ Save the environment (list of objects) of Jupyter Notebook into a compressed file
Created Oct 26, 2019
Reflected Operands
View reflected-operands.ipynb 