This file contains hidden or 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
print(__doc__) | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.colors import ListedColormap | |
from sklearn import neighbors, datasets | |
n_neighbors = 15 | |
# import some data to play with |
This file contains hidden or 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
print(__doc__) | |
# Author: Alexandre Gramfort <[email protected]> | |
# Fabian Pedregosa <[email protected]> | |
# | |
# License: BSD 3 clause (C) INRIA | |
############################################################################### | |
# Generate sample data |
This file contains hidden or 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
```scss | |
// Media Queries, iPhone Portrait, iPhone Landscape, iPad Portrait... | |
@media (max-width: 480px) { | |
// Mixins | |
// CSS Elements | |
// ID | |
// Class | |
} |
This file contains hidden or 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
# ----------- | |
# User Instructions: | |
# | |
# Modify the the search function so that it becomes | |
# an A* search algorithm as defined in the previous | |
# lectures. | |
# | |
# Your function should return the expanded grid | |
# which shows, for each element, the count when | |
# it was expanded or -1 if the element was never expanded. |
This file contains hidden or 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
# ---------- | |
# Background | |
# | |
# A robotics company named Trax has created a line of small self-driving robots | |
# designed to autonomously traverse desert environments in search of undiscovered | |
# water deposits. | |
# | |
# A Traxbot looks like a small tank. Each one is about half a meter long and drives | |
# on two continuous metal tracks. In order to maneuver itself, a Traxbot can do one | |
# of two things: it can drive in a straight line or it can turn. So to make a |
This file contains hidden or 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
# In this exercise, you should implement the | |
# resampler shown in the previous video. | |
from math import * | |
import random | |
landmarks = [[20.0, 20.0], [80.0, 80.0], [20.0, 80.0], [80.0, 20.0]] | |
world_size = 100.0 | |
class robot: |
This file contains hidden or 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 * | |
def f(mu, sigma2, x): | |
return 1 / sqrt(2. * pi * sigma2) * exp(-.5 * (x - mu) **2 / sigma2) | |
print f(10., 4., 10.) |
This file contains hidden or 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
class Tipper | |
TAX = 0.05 | |
def initializer(amount:, discount_percentage: 0, tip_percentage:) | |
@amount = amount | |
@discount_percentage = discount_percentage | |
@tip_percentage = tip_percentage | |
end | |
def total |
This file contains hidden or 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
var RetreatAttendeeRegistrationStart = React.createClass({ | |
render: function() { | |
return ( | |
<div> | |
<h1>Retreat Attendee Registration</h1> | |
<div className="form-group"> | |
<label>First Name</label> | |
<input type="text" | |
id="first_name" | |
ref="first_name" |
This file contains hidden or 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 localize(colors,measurements,motions,sensor_right,p_move): | |
# initializes p to a uniform distribution over a grid of the same dimensions as colors | |
def sense(p, colors, measurement): | |
aux = [[ 0.0 for row in range(len(p[0]))] for col in range(len(p))] | |
s = 0.0 | |
for i in range(len(p)): | |
for j in range(len(p[i])): |