On Github aaronr / cs_intro_2016
Aaron Racicot - aaronr@z-pulley.com reprojected.com / @reprojected / github.com/aaronr
>>> x = 1 >>> x 1 >>> y = 2 >>> y 2 >>> x + y 3 >>> x = 10 >>> x + y 12
z-air: aaronr$ python
Python 2.7.10 (default, Oct 23 2015, 18:05:06)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> name = raw_input("Enter your name: ")
Enter your name: Aaron
>>> name
'Aaron'
>>> name == 'Aaron' True >>> if name == 'Aaron': ... print "Hi there Aaron" Hi there Aaron
>>> True == 1 True >>> False == 0 True >>> True and False False >>> True and True True >>> True or False True >>> False or False False >>> not True False
>>> for x in xrange(10): ... print "x = %d" % x x = 0 x = 1 x = 2 x = 3 x = 4 x = 5 x = 6 x = 7 x = 8 x = 9
>>> x = 10 >>> while x > 0: ... print "x = %d" % x ... x = x - 1 ... x = 10 x = 9 x = 8 x = 7 x = 6 x = 5 x = 4 x = 3 x = 2 x = 1
import numpy as np
import matplotlib.pyplot as plt
mu, sigma = 100, 15
x = mu + sigma * np.random.randn(10000)
# the histogram of the data
n, bins, patches = plt.hist(x, 50, normed=1, facecolor='g', alpha=0.75)
plt.xlabel('Smarts')
plt.ylabel('Probability')
plt.title('Histogram of IQ')
plt.text(60, .025, r'$\mu=100,\ \sigma=15$')
plt.axis([40, 160, 0, 0.03])
plt.grid(True)
plt.show()
<div class="col-md-4 scoreboard">
<h1 id="score">Score = 0</h1>
</div>
<head>
<title>Aaron's Pong Game</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<style>
.scoreboard {
background-color: #2ba6cb;
}
</style>
</head>
<body>
<div class="container">
<div class="col-md-4 scoreboard">
<h1 id="score">Score = 0</h1>
</div>
<div class="col-md-8 gameboard">
<center>
<h1 class="cover-heading">My Pong Game</h1>
<canvas id="pong" data-processing-sources="pong.pde"/></canvas>
</center>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.16/processing.js"></script>
</body>
<style>
.scoreboard {
background-color: #2ba6cb;
}
</style>
<style>
#scoreboard {
background-color: #2ba6cb;
}
</style>
$(document).ready(function() {
var map = L.map('map', {maxZoom: 22}).setView([48.03, -122.4085], 14);
var featureLayer = L.mapbox.featureLayer()
.loadURL('/gisdata/geojson/citylimitsline_4326.geojson')
.addTo(map);
});