Recent Posts
Java | 4 sec ago
None | 24 sec ago
None | 1 min ago
PHP | 2 min ago
None | 2 min ago
PHP | 2 min ago
None | 3 min ago
None | 3 min ago
None | 3 min ago
None | 3 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By joel on the 20th of Feb 2008 12:29:17 PM
Download |
Raw |
Embed |
Report
#!/usr/bin/env python
import cPickle
import sys
def print_questions(qlist):
for q,stats in qlist:
times=len(stats[0])
print "%s\t:%d/%d errors, avg time %.2f" % (q[0],(times-sum(stats[0])),times,sum(stats[1])/times)
if len(sys.argv) < 2 : raise "Usage: show_stats.py login"
a=cPickle.load(open('compute_stats_%s.pck'%sys.argv[1]))
b=a.items()
print "showing by score"
b.sort(key=lambda i:sum(i[1][0])/len(i[1][0]),reverse=True) #sort by accuracy score
print_questions(b)
#for i in b: print i
print "showing by average time"
b.sort(key=lambda e:sum(e[1][1])/len(e[1][1]))
print_questions(b[-10:])
print "Overall average answer time: %.2fs" % (sum([sum(stats[1]) for q,stats in b])/sum([len(stats[1]) for q,stats in b]))
Submit a correction or amendment below.
[ previous version ] | [ difference ] | Make A New Post