Thursday, December 27, 2007

Simulation Remake - UPDATE

Just a quick update on my progress so far:

  • Schema for database backend has been created using MySQL
    • Currently using three tables
  • Installed MySQL ODBC driver so connection to database can be established in executable (connection yet to be established)
  • All conference and team information has been entered into the database
    • 32 conferences
    • 341 teams
  • Started a PHP script to scrape player statistics from popular sports website
    • Statistics scraping currently done by team, one team at a time
    • Team selected using drop-down list -- all 341 teams are available
    • Statistics scraping code completed successfully, but still need to add code to insert stats into database
That's pretty much it. All-in-all, it's been a pretty productive few days of work. I plan on adding the database insertion code to the PHP script tomorrow. Should be fairly straightforward -- just need to take care not to duplicate player stats when inserting. After that, I'll begin to tackle the database connection inside the executable.

EDIT - Here's a quick little video of the PHP stats script. My script is in the left pane, and the website the stats are being extracted from is in the right pane. If the video quality weren't so poor, you'd see it successfully retrieve the stats. Since the making of this video, I've enhanced the on-screen output of the retrieved stats by putting them in tabular format -- looks much cleaner. ;)

Note: If you're using FireFox, the video may not play completely. Not sure why. Seems to work OK with IE though. Make that semi-OK. Or maybe it's just my computer...hmmm...

Tuesday, December 18, 2007

Simulation Remake...yay!

About 13 +/- years ago, a group of four enthusiastic geeks set out to create a computer simulation of an NCAA basketball game as a project for their business math analysis class (lovingly abbreviated as "anal bus math"). The goal was to simulate that year's Iowa vs. Iowa State basketball game prior to the event, and compare the simulation results to the actual outcome. This would serve as a measurement of their ultimate success (i.e., their grade).

The Geeks
Jerry, Norm, Corey, Me

The Project
Programming Language: Applesoft BASIC
Computer Hardware: Apple IIe and Apple IIGS
Workhorse Programmers: Jerry and Norm. Corey and I were familiar with programming basics, but Jerry and Norm were the real experts. We helped where we could, but ultimately the workhorses pulled the majority of the weight. Not that it probably would have made much of a difference in the ultimate workload sharing because Jerry and Norm were obviously more equipped to do the work, but the development environment with BASIC was not very conducive to multiple programmers. It wasn't like the object-oriented languages of today, where you can easily break off chunks of the code to be put in separate modules and coded by separate people. I suppose we could have done that, but it would certainly have been a lot more cumbersome.

The Results
Unfortunately, the program was not finished prior to the Iowa/Iowa State game, but it did end up getting finished. I don't recall exactly how close we actually got to the final score, but I seem to remember it wasn't too far off. Of course, we already knew the final score, so I'm sure we tweaked our code a smidge here and there to get reasonable results. Doing so was not necessarily a bad thing, even though we were being graded on the results, as calibration with the real world is definitely needed for something like this. Plus, it's not like we stole the answers - everyone (including the teacher) recognized that working backwards to the solution was an available option.

In the end, we presented the program to our class, and a math class in a neighboring town (Cascade - "The Mecca of all learning and knowledge" according to Mr. Strang). I think we ended up with an "A". If we didn't, we should have. ;)

The Remake
It's not known what eventually became of the masterpiece we created. It's probably sitting in a box somewhere collecting dust in one of our parent's homes; the disk surely succumb to failure. So sad.

In late 2001, I set out to recreate the masterpiece; this time using Visual BASIC 6. I plugged away at it here and there in my spare time, and finished the basic logic of the program sometime in late 2002 or early 2003. It has sat dormant ever since. I've decided now is the time to finally finish it -- hopefully, before March Madness 2008.

In it's current state, it is hard-coded with the stats from the 2002 National Championship Game between Maryland and Indiana, which I used as a start for the underlying calibration of the code. Certainly more calibration is in order. This makes it quite tedious to simulate other games, as it requires delving into the code itself to input new statistics; a fatal flaw suffered in the original code as well. The last major task at hand is to implement a database backend for storing all the statistics, making it possible to easily input and edit statistics and simulate a game between any two teams, with the ultimate goal being a simulation of the entire NCAA tournament in one fell swoop. Now that would be sweet...

I hope to post updates of my progress now and then, but we'll see how that goes. In the meantime, here's a quick video of the current program:



As of right now, it can simulate 100 games in about 5 seconds (10 seconds if the line-by-line results are chosen to be displayed). Definitely a LOT faster than the original, which I think took about 20-30 minutes for just one game, if I remember correctly. The increased simulation speed is certainly more a result of faster computers moreso than better or more optimized code.

Thursday, November 1, 2007

Folding@Home Sets Guinness World Record

Stanford University's Folding@Home project has officially become the world's largest distributed computing network in existence according to the Guinness Book of World Records (Press Release). The Folding@Home project has successfully broken the petaFLOP (one quadrillion FLoating-point Operations Per Second) barrier, largely due to the addition of the F@H client to the PlayStation3 platform in March of this year.

For more information on the Folding@Home initiative, you can read my previous blog post, or visit the Folding@Home website.

Wednesday, October 24, 2007

tobyMac

So I finally got to see Tim perform live this past weekend with tobyMac. They came through Des Moines a year or two ago, but I couldn't make the show for some reason or another. Luckily, I was able to make it this time around.

Even though I play in the praise band every Sunday at church, I'm still more of a hard rock/heavy metal guy. I must say though, they rocked the house pretty good. It was kind of weird seeing a friend from high school on stage, and then signing autographs and taking pictures. Tim did a great job, and the band as a whole put on an entertaining show.

Anyway, here are some video clips. I recorded these with my Canon still camera, so the video quality is not the best and the audio quality is horrible. It's a long video, so it may take a bit to load.



Here is a better quality live recording of their song Boomin'. There are also several other videos on YouTube.





Good show.

ps - For an even better, in depth review of the Portable Sounds Tour, check out Carl's blog, One Pilgram's Progress. It's great to see others enjoyed the show as well.

Friday, October 5, 2007

Your "Ideal" Presidential Candidate -- Update

So it turns out that the website I used in my previous post to determine my "ideal" presidential candidate wasn't the same one that Glenn Beck used on his radio show. Not that it really matters. Anyway, after reading Glenn's email newsletter and seeing the address of the website he actually used on air, I figured I give that site a try as well for comparison purposes. It doesn't ask exactly the same questions as the first site, so I figured there would be some discrepancies with my previous results. And there were.

So...survey says:

1. Mike Huckabee (R) - 98.98%
2. Mitt Romney (R) - 93.88%
3. Fred Thompson (R) - 90.82%
4. Duncan Hunter (R) - 83.67%
5. John Cox (R) - 81.63%
6. Tom Tancredo (R) - 81.63%
7. Rudy Giuliani (R) - 76.53%
8. Sam Brownback (R) - 74.49%
9. John McCain (R) - 71.43%
10. Bill Richardson (D) - 53.06%
11. John Edwards (D) - 51.02%
12. Ron Paul (R) - 50.00%
13. Joseph Biden (D) - 46.94%
14. Hillary Clinton (D) - 46.94%
15. Barack Obama (D) - 42.86%
16. Christopher Dodd (D) - 38.78%
17. Mike Gravel (D) - 25.51%
18. Dennis Kucinich (D) - 18.37%


Another surprise top place finisher, with even more surprising percentages. Wow...Mike Huckabee and I are like long lost brothers, I guess.

Now, let's put all this into perspective, shall we?

How well do these things really work, anyway? Well, Glenn Beck put this particular site to a pretty good test the other day by having one of the Republican candidates take the survey, and it just so happens that the candidate in question was the one on top of my list -- Former Arkansas Governor Mike Huckabee.

So who is Huckabee's ideal presidential candidate according to the "Candidate Calculator"? Take a guess.

No, actually...it's not himself. It's Mitt Romney.

What?

Another interesting piece of information is that, according to the results of his survey, he only agrees with himself 71% of the time.

Huh?

So...that either means Mr. Huckabee can't make up his mind about the issues, or this website has some of its facts wrong. Hmmm...

Oh well. No one is saying that you should go straight to the polls and vote based on the results of these online surveys. I view them more as a quick and dirty gauge of the candidates that makes you think about more than just the front runners. I know it's done that for me.

Thursday, October 4, 2007

What the...?

Apparently, this bear was scared by on-coming traffic into jumping over the bridge railing, and managed to hang on for dear life and climb up to safety on the concrete arch. It is being reported that the bear slept there overnight until rescuers were able to get the equipment necessary to safely get it down off the bridge the next day. Wow.

Wednesday, October 3, 2007

Your "Ideal" Presidential Candidate?

So I was listening to Glenn Beck on the radio today, and he mentioned an interesting website where you answer a series of questions about major political issues, and it spits out a list of the presidential candidates and how well they align with your political views. Supposidly, the candidate's stance on topics (and subsequently the results of the questionaire) are based on a plethora of voting history, public remarks, press releases, candidate questionaires, etc. in an effort to best represent their views. I thought it would be interesting to see who I most aligned with according to this site, so I went ahead and took the questionaire. My results are below.

1. Alan Keyes (89%)
2. Tom Tancredo (85%)
3. Mitt Romney (81%)
4. Duncan Hunter (78%)
5. Sam Brownback (73%)
6. Chuck Hagel (not running) (71%)
7. Jim Gilmore (withdrawn) (70%)
8. John McCain (66%)
9. Newt Gingrich (says he will not run) (66%)
10. Fred Thompson (60%)
11. Mike Huckabee (58%)
12. Kent McManigal (campaign suspended) (57%)
13. Tommy Thompson (withdrawn) (54%)
14. Ron Paul (52%)
15. Rudolph Giuliani (52%)
16. Bill Richardson (32%)
17. Joseph Biden (29%)
18. Hillary Clinton (29%)
19. Michael Bloomberg (says he will not run) (28%)
20. John Edwards (27%)
21. Al Gore (not announced) (26%)
22. Mike Gravel (24%)
23. Christopher Dodd (24%)
24. Wesley Clark (not running, endorsed Clinton) (19%)
25. Dennis Kucinich (18%)
26. Barack Obama (17%)
27. Alan Augustson (campaign suspended) (10%)
28. Elaine Brown (3%)


Obviously, I'm a conservative republican (hey, I'm an engineer, we're conservative by trade). That wasn't anything I didn't know about myself already. But I was a little surprised by the rankings. Probably because I don't really know a lot about most of the "second tier" candidates. The chances of most of these candidates getting their party's nomination are slim-to-none, but it makes me want to learn more about their views regardless. Would I ever really vote for Alan Keyes? Hmmmm...

Anyway, give it a try for yourself. I think it could have some benefit for you whether you've already got a candidate in mind or have absolutely no clue. Perhaps it will encourage you to look beyond the top tier candidates (D or R), see who else is out there, and educate yourself about their viewpoints.