Skip to content

Instantly share code, notes, and snippets.

#-------------------------------------------------------------------------------
# Name: Numerical Project Assignment #2, Subject #3
# Purpose: To determine the eigenvalues of a matrix using QR decomposition
#
# Author: Addison Euhus
#
# Created: 04/30/2014
# Copyright: (c) Addison Euhus 2014
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Name: Numerical Project Assignment #1
# Purpose: Given an integer n and a function f, this program will
# solve the n points finite-difference approximation of the
# Poisson-Laplace problem using LU decomposition.
#
# Author: Addison Euhus
#
# Created: 24/03/2014
# Copyright: (c) Addison Euhus 2014
from autopy import key, bitmap
import time
import random
screenOld = bitmap.capture_screen()
q = 0
while(True):
screenNew = bitmap.capture_screen()
r = random.randint(1,2)
from mpl_toolkits.basemap import Basemap as bm
import matplotlib.pyplot as plt
#Creates a 3d rendering of North America
map3d = bm(projection='ortho',lat_0=45,lon_0=-100,resolution='l')
#Draws the coastlines and boundaries, colors them
map3d.drawcoastlines(linewidth=0.3)
map3d.drawcountries(linewidth=0.5)
map3d.drawmapboundary(fill_color='aqua')
import urllib
import urllib2
import re
#Created by Addison Euhus, July 9 2013.
#In order to run this program:
# call yearHistory(CUSIP#, year)
# returns a dictionary variable with all of the prices for indicated bond in that year
import urllib2
#This program takes a single string parameter
#And will return the corresponding company name
def CUSIPLookup(cusipNum):
data = urllib2.urlopen('http://activequote.fidelity.com/mmnet/SymLookup.phtml?reqforlookup=REQUESTFORLOOKUP&productid=mmnet&isLoggedIn=mmnet&rows=50&for=bond&by=cusip&criteria='+str(cusipNum)+'&submit=Search')
data_string = data.read()
start = data_string.find("<tr><td height=\"20\" nowrap><font class=\"smallfont\">")
end = data_string[start:].find("</font>")
import numpy as np
import matplotlib.pyplot as plt
def fun(x):
#This is where all the info on the function goes
if x < 28:
return 100000*x - 2721000
else:
return 79000