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
<html> | |
<head> | |
<title>Simple Example of D3 Axes</title> | |
<script src="https://d3js.org/d3.v7.min.js"></script> | |
<style> | |
/* Style information for axis labels */ | |
.axis-label { | |
font-family: sans-serif; | |
font-size: 12px; | |
} |
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
print("Hello, World!") |
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
__author__ = 'David Gotz, gotz@unc.edu, Onyen = gotz' | |
from flask import Flask | |
from flask import request | |
# Create the web application object. | |
app = Flask(__name__) | |
# Define the web pages. | |
@app.route("/index.html") |
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
__author__ = 'David Gotz, gotz@unc.edu, Onyen = gotz' | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/hello") | |
@app.route("/") | |
def hello(): |
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
__author__ = 'David Gotz, gotz@unc.edu, Onyen = gotz' | |
from flask import Flask | |
from flask import request | |
def create_web_app(): | |
app = Flask(__name__) | |
# Open tweet data from http://www.trumptwitterarchive.com/archive |
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
__author__ = 'David Gotz, gotz@unc.edu, Onyen = gotz' | |
import random | |
def partition_list(num_list, start, end): | |
# The pivot is the last item in the section of the list we are sorting. | |
pivot_value = num_list[end-1] | |
# The "wall" position divides our "smaller section" from the rest of the list. Everything to the |
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
class Tower: | |
def __init__(self): | |
self.discs = [] | |
def add_disc(self, disc_to_add): | |
self.discs.append(disc_to_add) | |
def remove_disc(self): | |
return self.discs.pop() |
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
class Tower: | |
def __init__(self): | |
self.discs = [] | |
def add_disc(self, disc_to_add): | |
self.discs.append(disc_to_add) | |
def remove_disc(self): | |
return self.discs.pop() |
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
__author__ = 'David Gotz, gotz@unc.edu, Onyen = gotz' | |
# A City has a name and a set of departing routes | |
class City: | |
def __init__(self, city_name): | |
self.city_name = city_name | |
self.routes = [] | |
def add_departure(self, route): |
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 | |
class Shape: | |
def __init__(self, shape_name, shape_width, shape_symbol): | |
self.name = shape_name | |
self.width = shape_width | |
self.symbol = shape_symbol | |
def __str__(self): | |
return self.name + " of size " + str(self.width) + " and area " + str(self.area()) |