Practice WOD: Web IO CountURL

Prior to starting this WOD, you might want to review how to create launch configurations in Eclipse and how to create JAR files in Eclipse.

Instructions

  1. Start your timer.
  2. Create an Eclipse project called WebIO-CountURL.
  3. Enable Checkstyle for this project.
  4. Write a program that reads in a URL from the command line, determines how many whitespace-delimited tokens (i.e. “words”) are in the page corresponding to that URL, and writes that integer to System.out. If the page cannot be retrieved (i.e. the URL is malformed), then the program should signal an error.

When finished, stop your timer, and record how many minutes it took you to complete the WOD. Your program must satisfy our coding standards. You can copy/paste code from the prior program.

Rx: <8 min Av: 8-13 min Sd: 13-18 min DNF: 18+ min

Demonstration

Once you’ve finished doing the WOD a single time, watch me do it:

Standard WOD Caveats

You’ll learn significantly less from watching me solve the WOD if you haven’t attempted the WOD yourself first.

While it’s an achievement to finish the WOD no matter how long it takes, you might experience “diminishing returns” if you work longer than the DNF time. Thus, it might be strategic to stop working at the DNF time and watch my solution.

After watching my solution, I recommend that you repeat the WOD if you have not achieved at least Av performance. If so, be sure to:

Feel free to keep trying until you make Rx if that’s of interest to you.