Permalink
Browse files

use popular projects when no other information available

  • Loading branch information...
1 parent 9373123 commit 9a738a224cce05c0844d58893951761ed22f3630 @ghewgill committed Jul 30, 2009
Showing with 821 additions and 820 deletions.
  1. +2 −1 contest.py
  2. +819 −819 results.txt
View
@@ -34,6 +34,7 @@ def score(r, net):
start = time.time()
results = open("results.txt", "w")
+popular = sorted([(len(watchers[r]), r) for r in repos], reverse=True)
i = 0
for u in users:
print i
@@ -46,7 +47,7 @@ def score(r, net):
best = sorted([x for x in [(score(r, net), r) for r in inter] if x[0] > 0], reverse=True)
print " best:", len(best)
if len(best) == 0:
- best = [(0, 17)]
+ best = popular
print >>results, "%d:%s" % (u, ",".join(str(x[1]) for x in best[:10]))
i += 1
print "eta:", time.ctime(start + (time.time() - start) * len(users) / i)
Oops, something went wrong.

0 comments on commit 9a738a2

Please sign in to comment.