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
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
# NASTAVIT VLASTNÍ SLOŽKU S PROJEKTEM | |
config.vm.synced_folder "../../Workspace/Ruby", "/vagrant_data" | |
$sudoscript = <<-SHELL | |
sudo apt-get update -y | |
sudo apt-get install openssl git -y | |
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev -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
import copy | |
import math | |
import random | |
from python.common.svg import Svg | |
def coordinate_to_string(i, j): | |
return str(i) + "," + str(j) |
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 copy | |
import numpy as np | |
from python.common.line import Line | |
from python.common.svg import Svg | |
def load_color_maze(name) -> ({}, str, str, [[str]]): | |
file = open("labs/" + name, 'r') |
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 operator import itemgetter | |
import numpy as np | |
def load_labyrinth(name): | |
file = open("labs/" + name, 'r') | |
text = file.read() | |
lines = text.split("\n") |
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 | |
from operator import itemgetter | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib import animation | |
from python.less_11.regression import generate_points, load_file | |
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 matplotlib.pyplot as plt | |
import numpy as np | |
def generate_points(a, b, number_points=500): | |
x_points = np.random.normal(0, np.random.randint(0, number_points / 10), number_points) | |
y_points = (a * x_points + b) + np.random.normal(0, number_points / 2, number_points) | |
return np.array(x_points, dtype=float), np.array(y_points, dtype=float) | |
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 numpy as np | |
import matplotlib.pyplot as plt | |
cube1 = [x / 21 for x in range(1, 7)] | |
cube2 = list(reversed(cube1)) | |
def cube1_throw(number_throws=1000): | |
return cube_throw(number_throws, cube1) |
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 analyze(): | |
files = [] | |
for i in range(1, 8): | |
file = open("random/random" + str(i) + ".txt") | |
read_file = file.read() | |
files.append(read_file) | |
for i in range(len(files)): | |
read_file = files[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
import random | |
def monty_hall(door_selection=None, _choice=None): | |
doors = ["goat" for _ in range(3)] | |
car_index = random.randint(0, 2) | |
doors[car_index] = "CAR" | |
door_number = door_selection | |
if door_number is None: |
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 copy | |
from python.common.point import Point | |
from python.common.svg import Svg | |
from python.less9.transformations import * | |
def common(size, iterations, transformations, probabilities, name="picture"): | |
points = [] | |
current = Point(0, 0) |
NewerOlder