blog dds

2008.03.28

A Minute Minute Minder

Today I delivered the opening keynote address at the 4th Panhellenic Conference on Computer Science Education. For a number of reasons (more on that later) I wanted to keep track of my progress during the presentation. For this I put together a minute minder that displayed the time from the presentation's start and the slide I should be in. I could thus adjust my pace to finish as planned.

Most of the time I don't have a problem keeping time during a presentation. This occasion was different.

  • The 60 minutes allocated for the presentation were considerably longer than the 20-30, which are typical for talks I give at conferences.
  • Unlike a lecture, I could not postpone some material for the next time.
  • Inspired by the style of Lawrence Lessig's presentations, and following advice by Einar Host, who delivered one of the best presentations in this year's OOPSLA conference, I adopted a new presentation style. This was based on bare slides, often delivered in rapid succession, many pictures, few words, and no bullets. ("Bullets kill presentations", Einar wrote to me. Einar also helped me by pointing out that one can see Lawrence Lessig's presentations on YouTube.)
  • This being the conference's opening keynote address I felt obliged to deliver the presentation as polished as possible.

Initially, I tried using Powerpoint's functionality (Slide Show - Rehearse Timings), but I did not fel comfortable with it, because it did not appear to addresss my exact need. The following Processing program, at 36 lines did exactly what I wanted, and firmly established my belief that Processing is a very good choice for developing graphical applications.

// Modify the following two lines:
int presSlides = 192;		// Number of slides in the presentation
int presMinutes = 50;		// Duration of the presentation in presMinutes

// Duration of presentation in milliseconds
int presMillis = presMinutes * 60 *  1000;
// Duration of each slide in milliseconds
int slideTime = presMillis / presSlides;

void setup() {
    size(200, 50);
    PFont fontA = loadFont("Arial-Black-32.vlw");
    textFont(fontA);
    loop();
}

void draw()
{
    // Clear display area
    fill(255);
    rect(0, 0, width, height);

    int ml = millis();

    // Display current time
    int minute = ml / 1000 / 60;
    int second = (ml - minute * 1000 * 60) / 1000;
    textAlign(LEFT);
    fill(0);
    text((minute < 10 ? "0" : "") + minute + ":" + (second < 10 ? "0" : "") + s, 0, height * 2 / 3);

    // Display the slide you should be in
    textAlign(RIGHT);
    text(ml / slideTime, width, height * 2 / 3);
    delay(500);
}

On my way back I improved the program a bit, allowing one to adjust the hardcoded number of slides and minutes using the arrow keys, and to start the timer using the space key. You can run this program through this page, or you can download the jar file to run it on your computer. Here is the final version of the source code.

/*
 *
 * A simple minute minder for presentations. Adjust the time and the number
 * of slides using the arrow keys; start the timing using the space key.
 *
 * Copyright (c) 2008, Diomidis Spinellis
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $Id: minder.pde,v 1.2 2008/03/28 16:53:00 dds Exp $
 *
 */

/** Number of slides in the presentation. */
int presSlides = 15;
/** Duration of the presentation in presMinutes. */
int presMinutes = 30;
/** Time of the presentation's start in milliseconds. */
int start;
/** True if the presentation has started. */
boolean started;

void setup() {
    size(250, 100);
    PFont fontA = loadFont("Arial-Black-32.vlw");
    textFont(fontA);
}

void keyPressed() {
    if (key == ' ') {
	started = true;
	start = millis();
	loop();
    } else if (key == CODED) {
	switch (keyCode) {
	case UP:
	    presSlides++;
	    break;
	case DOWN:
	    if (presSlides > 1)
		presSlides--;
	    break;
	case RIGHT:
	    presMinutes++;
	    break;
	case LEFT:
	    if (presMinutes > 1)
	    presMinutes--;
	    break;
	}
	loop();
    }
}

void draw()
{
    // Clear display area
    fill(255);
    rect(0, 0, width, height);

    // Current time in miliseconds
    int ml = (started ? millis() - start : 0);
    // Duration of presentation in milliseconds
    int presMillis = presMinutes * 60 *  1000;
    // Duration of each slide in milliseconds
    int slideTime = presMillis / presSlides;

    textAlign(LEFT);
    fill(0);

    // Display current time
    int minute = ml / 1000 / 60;
    int second = (ml - minute * 1000 * 60) / 1000;
    text("T " + (minute < 10 ? "0" : "") + minute + ":"
	+ (second < 10 ? "0" : "") + second + "/" + presMinutes + ":00", 5, 40);

    // Display the slide we're should be in
    text("S " + (ml / slideTime + 1) + "/" + presSlides, 5, 80);

    if (started)
	delay(500);
    else
	noLoop();
}

Read and post comments    AddThis Social Bookmark Button


Creative Commons License Last modified: Saturday, March 29, 2008 7:22 am
Unless otherwise expressly stated, all original material on this page created by Diomidis Spinellis is licensed under a Creative Commons Attribution-Share Alike 3.0 Greece License.