public void run() {
    //System.out.println("checking for updates...");

    // generate a random id in case none exists yet
    Random r = new Random();
    long id = r.nextLong();

    String idString = Preferences.get("update.id");
    if (idString != null) {
      id = Long.parseLong(idString);
    } else {
      Preferences.set("update.id", String.valueOf(id));
    }

    try {
      String info;
      info = URLEncoder.encode(id + "\t" +
                        PApplet.nf(Base.REVISION, 4) + "\t" +
                        System.getProperty("java.version") + "\t" +
                        System.getProperty("java.vendor") + "\t" +
                        System.getProperty("os.name") + "\t" +
                        System.getProperty("os.version") + "\t" +
                        System.getProperty("os.arch"), "UTF-8");
      
      int latest = readInt(downloadURL + "?" + info);

      String lastString = Preferences.get("update.last");
      long now = System.currentTimeMillis();
      if (lastString != null) {
        long when = Long.parseLong(lastString);
        if (now - when < ONE_DAY) {
          // don't annoy the shit outta people
          return;
        }
      }
      Preferences.set("update.last", String.valueOf(now));

      String prompt =
        "A new version of Processing is available,\n" +
        "would you like to visit the Processing download page?";

      if (base.activeEditor != null) {
        if (latest > Base.REVISION) {
          Object[] options = { "Yes", "No" };
          int result = JOptionPane.showOptionDialog(base.activeEditor,
                                                    prompt,
                                                    "Update",
                                                    JOptionPane.YES_NO_OPTION,
                                                    JOptionPane.QUESTION_MESSAGE,
                                                    null,
                                                    options,
                                                    options[0]);
          if (result == JOptionPane.YES_OPTION) {
            Base.openURL("http://processing.org/download/");
          }
        }
      }
    } catch (Exception e) {
      //e.printStackTrace();
      //System.err.println("Error while trying to check for an update.");
    }
  }