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
#!/bin/python3 | |
import math | |
import os | |
import random | |
import re | |
import sys | |
# Complete the staircase function below. | |
def staircase(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
#!/bin/python3 | |
import math | |
import os | |
import random | |
import re | |
import sys | |
# Complete the diagonalDifference function below. | |
def diagonalDifference(arr): |
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
#define F_CPU 1000000 // by default we have the 1MHz internal oscillator | |
#include <avr/io.h> // this contains all the IO port definitions | |
#include <util/delay.h> | |
int main(void) { | |
DDRB = (1 << PB5); // set PORTB5 to an output | |
DDRC = (1 << PC1); // set PORTC1 to an output | |
while (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
def draw_lines(img, lines, color=[255, 0, 0], thickness=10): | |
""" | |
NOTE: this is the function you might want to use as a starting point once you want to | |
average/extrapolate the line segments you detect to map out the full | |
extent of the lane (going from the result shown in raw-lines-example.mp4 | |
to that shown in P1_example.mp4). | |
Think about things like separating line segments by their | |
slope ((y2-y1)/(x2-x1)) to decide which segments are part of the left | |
line vs. the right line. Then, you can average the position of each of |
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
sudo apt-get install build-essential libssl-dev curl | |
# The install script | |
# Adapted from https://gist.github.com/579814 | |
echo '# Added by install script for node.js and npm in 30s' >> ~/.bashrc | |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
echo 'export NODE_PATH=$HOME/local/lib/node_modules' >> ~/.bashrc | |
. ~/.bashrc |
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 gen_test_video(sess, logits, keep_prob, input_image, clip, image_shape): #test_image | |
# image = scipy.misc.imresize(scipy.misc.imread(test_image), image_shape) | |
image = clip | |
im_softmax = sess.run( | |
[tf.nn.softmax(logits)], | |
{keep_prob: 1.0, input_image: [image]}) | |
im_softmax = im_softmax[0][:, 1].reshape(image_shape[0], image_shape[1]) | |
segmentation = (im_softmax > 0.5).reshape(image_shape[0], image_shape[1], 1) | |
mask = np.dot(segmentation, np.array([[0, 255, 0, 127]])) |
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 os.path | |
import tensorflow as tf | |
import helper | |
import freeze | |
import warnings | |
from distutils.version import LooseVersion | |
import project_tests as tests |
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 os.path | |
import tensorflow as tf | |
import helper | |
import cv2 | |
from distutils.version import LooseVersion | |
# Check TensorFlow Version | |
assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.format(tf.__version__) | |
print('TensorFlow Version: {}'.format(tf.__version__)) |
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 | |
def graph(formula, x_range): | |
x = np.array(x_range) | |
y = formula(x) | |
plt.plot(x, y) | |
plt.show() | |
def my_formula(x): |
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
#!/bin/bash | |
## | |
## This is bash script for saving and loading gnome-terminal session. Special for Ubuntu. | |
## | |
## Usage: ./terminal-session -s <name_profile> - for save session | |
## ./terminal-session -l <name_profile> - for load existing session | |
## ./terminal-session --profiles - for show existing session files | |
## | |
## Instructions: | |
## - Run gnome-terminal; |