Personal Blog of rabbitoid
This blog belongs to rabbitoid.
If you like this blog, you can subscribe to the blog, if you want to be notified about new entries in it. You can also view all your subscribed blogs.
Blog Votes
This blog has received 5 upvotes and no downvotes. You need to log in first to vote on blogs.
 
Managing The Olympics by software

Introduction

This is a note concerning the software I wrote to monitor tournaments at GT, specifically the GT Olympics.

The program was started during the 2007 Olympics, by 2010 it reached, more or less, its current form. Since then I had to modify it several times, but only minor changes, mainly to accommodate new games and modified html formats used by GT.

What does the program do?

The program requests from GT html pages. This is exactly what a browser (Internet explorer, firefox, chrome...) does when one clicks on a GT link. A browser then presents the page in the form we see on the screen. The program, on the other hand, receives the page in form of an html raw data. Most browsers permit to see the raw data from somewhere in the menu. for Firefox and Chrome the shortcut is Control-U.

What pages are requested? tournament pages, games and player pages.

The program then uses the data to generate divers outputs, mainly in form of wikis:
  • It calculates the result wiki in [ Main: Goldtoken Olympics ] or the pages pointed from there.
  • It monitors the current running games, published in [ Olympiads: Olympics running tournaments ]
  • For the benefit of the club presidents, it surveys the memberships in the clubs: who dropped out and needs to be re-invited to the club
  • statistical data, not for publication. This helps us determine which games are too long in terms of time and moves and should not be included in future Olympics.
  • recent addition, in view of the bug that prohibits the use of a global time for a tournament: survey the games and print out those where a player has his clock over 60 days.

Techical

The program started as a script (I used tcl) but I switched early to a compiled c++ program. It uses one external package to parse the html pages (htmlcxx, found on sourceforge.com) and the standard STL objects (map, list, etc). It is compiled under gcc. I run it on my linux computer, but have executed it also on Windows environment using Cygwin.

Getting data: The program requests html pages in one of 2 modes: either as logged in (I use my own login / password to open a session) or as anonymous (not logged in). In order to read games it is preferable not to be logged in, because the games where I participate are presented differently ("It is not your turn", "you lost", and so on). For other pages login is necessary because anonymous requests will not access the data.

I deliberately avoided parallel requests and left a delay between two consecutive requests in order to go easy on the server. The server sees the program as just another user requesting pages. (OK, a LOT of pages, but not so fast it can't handle them).

The calculation of the score per player and club are described fully in [ Main: Goldtoken Olympics ].

The delicate and unstable part of the program is of course the interpretation of the html data, which is modified by Mecir as needed. Every now and then I discover that changes to the formats have been made, and the program needs then to be adapted. So far I have been lucky, the modifications were manageable. I expect that one day they won't be.

Using the program

The program first reads one data file which describes the Olympic settings:
  • The club numbers, plus for each club the initial membership. This is needed, because from the club pages the program can't see those members who dropped out.
  • The Group tournament numbers (from them the program reads the individual tournaments)
Launching the program is done simply by giving it the data file to read.

Since communication with Goldtoken can (sigh) be broken, I programmed a special start mode to start not from the beginning but from the point the communication broke down.

Run time varies, depending on the number of unfinished tournaments and games. The "worst" moment is usually at the start of the last groups of tournaments. At that point the program needs the maximum number of pages. for the Winter 2012 the number was about 20000, which takes about 5 hours. The strain on the computer is minimal, the time is simply the rate of read which I fixed (not more than 1 page per second).

What I have to do then is:
  • Start the program
  • Go watch a movie
  • Check if there are new finished tournaments. If so, inform eliphont551 who counter-checks my results
  • Upload the wikis (done by script, of course. I'm lazy)
  • Delicate part: terminate games which have gone over 60 days for one player. This is still done by hand, but will be scripted too, as the hassle has become too great (for the Summer 2013 it went sometimes to 30 games per day).
Written on 28 Dec 2013 at 8:04AM
Comments
Re: Managing The Olympics by software
One might get an education by studying your comments. Thank you for explaining what you do.
Posted at 17 Jun 2018 at 5:16PM by M3
Re: Managing The Olympics by software
You sure do an awful lot of work, I never knew how much. You are muchly appreciated!!
Posted at 17 Jun 2018 at 11:06AM by aprildawn
Re: Managing The Olympics by software
Thank you for all that work.
Posted at 9 May 2014 at 6:11PM by M3
You must be logged in to post comments.
Only the owner can comment this blog.
 
You are viewing entries number 1 - 1