Skip to content

Commit

Permalink
Replace True to False in CompileTimeTest
Browse files Browse the repository at this point in the history
  • Loading branch information
erks committed Dec 2, 2012
1 parent 5141cce commit 10c505d
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 15 deletions.
11 changes: 9 additions & 2 deletions CompileTimeTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,17 @@

print "Fastest is %d" % (minIndex)

#rename fastest .py to *_optimized.py
#create *_optimized.py with SD set to False
file = open(testFileName + "_optimized.py", "w")
fastestFileName = str(testFileName + "_T" + str(minIndex) + ".py")
os.rename(fastestFileName, testFileName + "_optimized.py")

for line in fileinput.input(fastestFileName):
line = line.replace("SD(TRUE", "SD(FALSE")
file.write(line)

file.close()

#remove temp testing files
for filename in os.listdir("."):
if filename.startswith(testFileName + "_T"):
os.remove(filename)
Expand Down
9 changes: 7 additions & 2 deletions CompileTimeTest.py~
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ minIndex, minValue = min(enumerate(dataStructureTimes), key=operator.itemgetter(

print "Fastest is %d" % (minIndex)

#rename fastest .py to *_optimized.py
#create *_optimized.py with SD set to False
file = open(testFileName + "_optimized.py", "w")
fastestFileName = str(testFileName + "_T" + str(minIndex) + ".py")
os.rename(fastestFileName, testFileName + "_optimized.py")

for line in fileinput.input(fastestFileName):
line = line.replace("SD(TRUE", "SD(FALSE")
file.write(line)

#remove temp testing files
for filename in os.listdir("."):
if filename.startswith(testFileName + "_T"):
os.remove(filename)
Expand Down
Binary file modified DS.pyc
Binary file not shown.
Binary file modified SmartDataStructure.pyc
Binary file not shown.
Binary file modified arr.pyc
Binary file not shown.
Binary file modified bst.pyc
Binary file not shown.
Binary file modified btree.pyc
Binary file not shown.
27 changes: 16 additions & 11 deletions graph_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import matplotlib.animation as animation
from random import randint

value = "hi"

class LiveGraph(threading.Thread):
def run(self):

Expand All @@ -19,23 +17,26 @@ def data_gen():
data_gen.t = 0

fig = plt.figure()
ax = fig.add_subplot(111)
line, = ax.plot([], [], lw=2, color = "black")
ax.set_ylim(0, 100)
ax.set_xlim(0, window)
ax.grid()
ax1 = fig.add_subplot(2, 1, 1)
ax2 = fig.add_subplot(2, 1, 2)

line, = ax1.plot([], [], lw=2, color = "black")
ax1.set_ylim(0, 100)
ax1.set_xlim(0, window)
ax1.grid()

xdata, ydata = [], []

def run(data):
# update the data
t,y = data
xdata.append(t)
ydata.append(y)
xmin, xmax = ax.get_xlim()
xmin, xmax1 = ax1.get_xlim()

if t >= xmax:
ax.set_xlim(xmax, xmax + window)
ax.figure.canvas.draw()
if t >= xmax1:
ax1.set_xlim(xmax1, xmax1 + window)
ax1.figure.canvas.draw()
line.set_data(xdata, ydata)

return line,
Expand All @@ -53,6 +54,10 @@ def run(data):
while 1:

ops = randint(0, 100)
get = randint(0, 100)
add = randint(0, 100)
remove = randint(0, 100)
contains = randint(0, 100)
time.sleep(0.2)


Binary file modified maxheap.pyc
Binary file not shown.
Binary file modified minheap.pyc
Binary file not shown.
Binary file modified sarr.pyc
Binary file not shown.

0 comments on commit 10c505d

Please sign in to comment.