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!

search – wolfram alpha going live – part 2

See part 1 for the background of this webcast or part 3 for my impressions after cutover.  Cnet also has an article on the last minute delays.

Interesting tidbits from the live webcast.  I’ll be updating this post as I watch.

8:55 CST:

  • They commented about all the traffic they are getting now through the backdoor they left open.  That should give them more!
  • Changing usership from academic to the general public.
  • And I’m out for the night.  Two hours of watching a deployment is about my limit unless I’m actually part of the project.  We had a five hour deployment at JavaRanch and have gone significantly longer than that where I work at a bank.  But those were projects I was on.
  • Good luck to the Wolfram Alpha team.  I hope things go smoothly and you don’t have too long a night.  I look forward to reading about it tomorrow.

8:50 CST:

  • Talking about how Wolfram Alpha relates to Mathematica

8:45 CST:

  • Back to interrupting the guy doing the testing.
  • There was some sort of connectivity problem.  They are deploying a patch now.
  • Among the many dashboards is a weather display in case they have to watch for weather

8:40 CST:

  • I lost my video for a couple minutes, but it looks like they are still showing the control room with background noise
  • A deployment doesn’t have every minute filled with excitement!

8:35 CST:

  • Just showing control room now.
  • People are sharing links in chat which do work even if you can’t do a new query from your area.  For example, what is a noreaster and area of california

8:30 CST:

  • Some people in chat seem to be able to get through to do queries.  I can’t though.  I wonder if it is IP address based to limit load until they are ready?
  • I just saw a comment “Yeah – it’s working in Massachusetts”

8:25 CST:

  • They are getting feedback from viewers via Twitter and through the software itself.
  • Someone is moderating chat in the software.  Quite frequently at the moment.  You have to be on the justin.tv version of the feed to contribute to chat.  Which unfortunately caused a reload of the video and I missed some.    There are a few relevant comments, but it’s mostly “chat spam.”

8:20 CST:

  • Cut to interviews with developers about mathematics behind the system along with how it relates to Mathematica.  Also talked about how they envision people integrating Wolfram Alpha into their own site along with as a search engine.  They also expressed interest in seeing what people come up with on their own.
  • The interview also covered the beginning – that they did unit conversion first.

8:15 CST:

  • More details of rac tour including the decisions of managing the physical cables.
  • Red is visible on the monitoring screen in the background.
  • They think the live webcast affected the bandwidth available for the load test.
  • Pointed out how the things that get you are always the little unexpected things.  (Of course – the expected things were planned for!)
  • Also pointed out how the nasty problems tend to come up towards the end for big projects.

8:10 CST:

  • Showed command line screen of load tester.  You can’t read it from the webcast, but it’s still there.
  • I would think it would be annoying to have a camera questioning you as you are trying to run a load test – but that’s just me.
  • Cut to tour of supercomputer.  At least now they are letting the load tester work!

8:05 CST:

  • Showed stream of data from queries.  They expressed that they did in fact take precautions that no personally identifiable information will be in the feed.
  • Don’t want too many people using system at once at first so not overwhelmed.
  • They are now doing a load test from a simulated “real” location to make sure the system won’t fall apart.

8:00 CST:

  • Showed monitoring graphs including queries per second along with discussion on what is desired state – growing but not beyond capacity.
  • They also showed the computer cluster graph and plan to show more throughout the night.

7:55 CST:

  • Cut to pre-recorded video of control room
  • Cut to pre-recorded video showing server topology along with cooling fans and server rack.  They also discussed failover – if one machine fails, another just takes over.

7:45 CST:

  • “We’re launching a product and not a TV show” – I like this quote.  it shows where priorities are.  Sharing cutover with the world is quite ambitious I must say.
  • Cut to tour of backup generator/uninterruptible power supply.  The UPS is good for 30-70 minutes.  It wouldn’t be needed that long of course as they pointed out the backup generator would go on within a few minutes.  I assume this piece was pre-recorder.

7:40 CST:

  • It’s a very large, distributed project.
  • They have two “webcast guides” to narrate things so “the guy in charge” can do work.
  • They explained the background noise – it includes thunder.  They are listening to feedback (from somewhere) on the webcast in realtime.
  • They walked through why so many people are in the room (including cutting to showing them) and their function – including load testing, cutover team, etc.
  • Given the thunderstorm, they explained that they do in fact have a backup generator for electricity.  Good contingency planning.

7:33 CST:

  • They have a tornado watch in Illinois during this deployment.
  • It sounds like a live webcast – the background noise is audible – you can tell he really is in a big room with a lot of activity.
  • There’s a nice dashboard setup on the wall for monitoring.