See you in San Francisco!

I’ll be away this week from June 1-5 attending the Sun JavaOne Conference in beautiful San Francisco. I plan to expand my knowledge of advanced J2EE/SOA topics as well as pick up some introductory courses on new technologies. If you want to meet up to discuss any of my recent articles, the conference, or how cold San Francisco seems to be this time of year, drop me an e-mail!

San Francisco

javaranch – the web based pick winners program

JavaRanch uses a Java program to pick the weekly winners for book promotions.  It previously used a serious of classes that went the URLs, parsed the data, went to more URLs, picked some random winners and then output them to a file.  These contortions were done because the old software was hard to change.  With the new Java based software, we have much more active development.  Time for a new approach.

Designing the new pick winners program.  (It’s the 3rd iteration of the program and the 2nd I’ve done so I’m familiar with the domain.)

  1. Decide to make a web based version (servlet)
  2. Think about what I need from the database.
  3. Write three DAO methods to get post, topic and user info.  While I wrote the integration tests first, I did write the unit tests after the code.
  4. Start the pick winner class  Realize there is a lot of date validation logic (and determining the default week) and rename class to WinnerPickingWeek to encapsulate the date range.
  5. Start the pick winner class again.  Call the three DAO methods tying them together.
  6. Now add the randomness.  My test with 1 post will give me enough determinism to keep the tests passing and useful.
  7. Added a test for excluding ineligible winners (like Henry and I – the winner pickers)
  8. Now on to the front end.  My servlet needs to make sure you are logged in as admin and then delegate to the processing logic.

This got a useable program that runs much faster.  After that I added some jQuery logic to make the page dynamic and even more useful.  But that’s another topic – possibly a more interesting one.  I’ll post it later in the week.

search – wolfram alpha going live – part 3

I stopped watching the webcast (see part 2) about two hours in.  While WolframAlpha may go down over the weekend, it is up now for experimenting.  In part 1, I worried about my first impression:

What is interesting to me is that it gives you the answer, but not the source. For calculations, there isn’t really a source anyway. I don’t cite that 2+2=4. However, I do cite the population of Germany. So how are we supposed to know it is right? On the other hand, I think showing similar information you might not have asked for is cool.

Turns out this isn’t a big thing to worry about.  WolframAlpha gives you the source of it’s answer.  For example, I searched for swine flu.  It told me the scientific name along with the number of cases and deaths over the last couple of days.  In addition to a nice pop-up and PDF to export the data, it has a “source information” link at the bottom.  This shows the data set used to derive the answer along with other resources one might be interested in.

As a source for learning, I think this is pretty cool!