This file contains hidden or 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 time | |
def main(): | |
print "Starting test now: begin typing free-form text." | |
print "Press enter to send. Send an empty message to exit." | |
avg = 0 | |
tests = 0 | |
try: | |
avg = wpm_test() |
This file contains hidden or 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
<% | |
Function stripBOM(ByVal content) | |
stripBOM = content | |
If Len(content) > 2 Then | |
If AscW(Mid(content, 1, 1)) = &HEF AND _ | |
AscW(Mid(content, 2, 1)) = &HBB AND _ | |
AscW(Mid(content, 3, 1)) = &HBF _ | |
Then | |
stripBOM = Mid(content, 4) |
This file contains hidden or 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
# Finds the maximum consecutive sum in a list of numbers. | |
# Returns a three-value tuple containing: | |
# 0: Starting index of the max sum | |
# 1: Ending index of the max sum | |
# 2: The maximum sum | |
def max_consecutive_sum_idx(values): | |
if not values: | |
return None | |
maxval = None |
This file contains hidden or 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
# Return the maximum consecutive sum in a list of numbers | |
def max_consecutive_sum(values): | |
m = None | |
prev = None | |
for value in values: | |
cur = value + max(prev, 0) | |
m = max(cur, m) | |
prev = cur | |
return m |