Skip to content

Instantly share code, notes, and snippets.

View koverholt's full-sized avatar

Kristopher Overholt koverholt

View GitHub Profile
openFirePro:~ koverholt$ brew install -v pyqt
==> Build Environment
CC: /usr/bin/cc => /usr/bin/gcc-4.2
CXX: /usr/bin/c++ => /usr/bin/c++-4.2
LD: /usr/bin/cc => /usr/bin/gcc-4.2
CFLAGS: -O3 -march=core2 -w -pipe
CXXFLAGS: -O3 -march=core2 -w -pipe
MAKEFLAGS: -j2
==> Downloading http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.7.4.tar.gz
File already downloaded and cached to /Users/koverholt/Library/Caches/Homebrew
openFirePro:~ koverholt$ brew install pyqt
==> Downloading http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.7.4.tar.gz
File already downloaded and cached to /Users/koverholt/Library/Caches/Homebrew
==> python ./configure.py --confirm-license --bindir=/usr/local/Cellar/pyqt/4.7.4/bin --destdir=/usr/local/Cellar/pyqt/4.7.4/lib/p
==> make
g++ -c -pipe -fno-strict-aliasing -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -fPIC -Wall -W -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Cellar/qt/4.6.3/mkspecs/macx-g++ -I. -I/usr/local/Cellar/qt/4.6.3/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.6.3/include/QtCore -I/usr/local/Cellar/qt/4.6.3/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.6.3/include/QtGui -I/usr/local/Cellar/qt/4.6.3/include -I/usr/local/Cellar/sip/4.10.5/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I../../QtCore -I. -I. -F/usr/local/Cellar/qt/4.6.3/lib -o qpycore_chimera.
#!/usr/bin/env python
from __future__ import division
import math
def myexp(x):
''' myexp(x) will compute e^x for any x by measuring the difference in the last 2 terms of the series. '''
tot = (1 + x)
n = 1
while (tot != tot + x):
import numpy as np
def stats(path, string):
# Write to stats text file
filename = path
f = open(filename, 'a')
f.write(string)
f.close()
headers = np.array(['Name', 'Temperature (C)', 'Heat Flux (kw/m2)'])
@koverholt
koverholt / newton.py
Created November 11, 2011 05:01
newtonRaphson method
## module error
''' err(string).
Prints 'string' and terminates program.
'''
import sys
def err(string):
print string
raw_input('Press return to exit')
sys.exit()
@koverholt
koverholt / cluster_fds_run.py
Last active August 29, 2015 14:16
Anaconda Cluster - FDS
from conda_cluster.config import get_cluster_list
import subprocess
SSH_KEY_LOCATION = '/Users/koverholt/.ssh/koverholt.pem'
CLUSTER_NAME = 'cluster_fds'
USER = 'ubuntu'
# List of cluster nodes from conda-cluster
clusters = get_cluster_list()
compute_nodes = clusters[CLUSTER_NAME]['machines']['compute']
@koverholt
koverholt / geo_location.py
Created March 19, 2015 17:01
Comparison of geolocation services
import geopy
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Circle
from bokeh.models import (
GMapPlot, Range1d, ColumnDataSource, LinearAxis,
PanTool, WheelZoomTool, BoxSelectTool, HoverTool,
BoxSelectionOverlay, GMapOptions,
NumeralTickFormatter, PrintfTickFormatter)
import sys
from PyQt4 import QtCore, QtGui, uic
qtCreatorFile = "" # Enter file here.
Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile)
class MyApp(QtGui.QMainWindow, Ui_MainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
from __future__ import division
import bloscpack
import cPickle
import numpy as np
import timeit
x = np.empty(10000000)
# cPickle without protocol keyword argument
@koverholt
koverholt / spark_wordcount.py
Last active August 29, 2015 14:17
Example Wordcount in Spark
from pyspark import SparkContext
from pyspark import SparkConf
if __name__ == "__main__":
conf = SparkConf()
conf.setMaster("spark://{hostname}:7077")
conf.setAppName("WordCount")
sc = SparkContext(conf=conf)
file = sc.textFile("/mnt/gluster/pg2591.txt")