Progamer to Programmer

Thursday, November 25, 2004

Strutting around

We managed to get a Struts project, and I was one of the lucky people to work on it. The last week has been spent eagerly getting acquainted with Servlets, Struts, and Hibernate. The app itself services a mobile client, but all the existing code already uses struts, so I guess it is fine - the same app could later be extended to also service web clients simply by adding presentation code and a few config entries. Great fun!

My initial reaction to Struts is quite good. Most of the cost of Struts is the investment time learning the framework... Once you're familiar with it, you can reap your reward by building more flexible applications - development overhead is quite minimal. Although some people have raised concerns, stating that similar functionality can already be achieved by editing web.xml (basically making Struts useless overhead - both in system complexity and physical resources). I'm not yet very familiar with Java web apps, but this should be something to look into.

----

Defense of the Ancients is a popular Warcraft III-based modded map that has a very good polished feel to it. Each player picks one of two sides, and controls a single Hero. All the "army" management is handled by the computer (in the form of periodically generating troops that blindly rush to the other side, and die once they meet their enemy-peers). The players can affect the outcome of this Continuous Strife by casting spells to weaken the other side's army, or disable enemy heroes, or heal/strengthen their own army.

What makes it such a great game? Here are a few things I can think of:

  • Continuity - Unlike microwars, or all those other "pure micro" maps, you have a sense of actually building up a character, not unlike an MMORPG. A game lasts long enough to have gotten the good feeling of starting from weakness, and growing to be strong.
  • Diversity - There are more Hero types than I have fingers and toes! And each hero isn't just a palette swap, and a rehash of skills - each has his own "theme".
  • Balance - You would expect that amongst the multitude of hero types, for some to be blatantly strong/weak. But that's discounting the synergy that some "weak" heroes can get from simply helping their team out. Think Tekken "balance".
  • Maturity - The current "official" version is at version 5.84b. I know of at least two people who have maintained the "official" version. Several other versions have popped (and continue to pop) up - good ideas are incorporated into the official version. Discussion forums are set up where people can discuss the strengths/weaknesses of the game, and offer new suggestions. I can make a good guess that v1.0 was nowhere near as good as this map, and it only became this good because of the underlying community.


----

A cool puzzle. One of the levels require you to search for a specific phrase hidden in the game. Google would then lead you through a bunch of clues, that would (with some thinking) bring you the answer. Unfortunately, the puzzles popularity has screwed the page rankings - searching for the phrase now leads you to a walkthrough for the puzzle. Heh. =/

Saturday, November 20, 2004

SRM 219 writeup

Easy problem involved finding the maximum number that corresponds to a certain formula. The tricky portion was making sure the floating point operations did not screw up your solution. My thought here was to brute-force the solution (you could easily compute all feasible numbers in the 8-second time limit) instead of being fancy and try to solve the formula - the idea would have worked, but I got careless with the computations and failed system tests to an easily-avoided overflow. Need to be less hasty and more careful.

Medium problem was relatively straight-forward, asking for the "best" candidate, based on multiple criteria (of variable and ordinal importance - less important criterion are only used to resolve ties). The most elegant solution that I saw used a custom Comparator.

Hard problem was a classic example of the Subset sum problem. The two attempts that were submitted within the 75-minute time limit unfortunately had no optimization and died to timeout cases. I was unable to implement a solution with the time remaining to me. My TODO list should include coding a solution to this problem before the next SRM.

One remarkable thing about this SRM is that my room contained three Filipinos. (yay!) It was nice meeting hotblue and mhykol. Congratulations to hotblue for winning the room! :)

They are also both attempting Component Competitions, so the best of luck to them.

Now's as good a time as any to sign up!

Tuesday, November 16, 2004

Looks like I'm not the only one who's been busy...

http://iits.uap.edu.ph/~bryce/scores/index.html

It looks like Ateneo placed second. That is coolness! It goes to show that a rigid training program really helps. Talent goes without saying. ;) And wow, UPLB placed 4th - that is not bad at all (though from talking with some of the peeps here, they placed 10th - so I have to clarify this).

It's very nice to see a scoreboard that isn't dominated by the foreign teams. Seeing something like this is very inspiring, and gives me something new to chase after. Need to evaluate the possibilities...

EDIT:
http://icpc.baylor.edu/icpc/regionals/ViewRegionalStandings.asp?ContestID=707 has results that are consistent with personal accounts of the event. So the statistics from up there must have been generated before the contest was complete.

----

Ack! Left all the TopCoder (placed 3rd - big surprise</sarcasm>)notes I made at home. =( That means that it will have to wait till next week. Sorry... (to whoever is interested).

Sunday, November 14, 2004

Japan Intermission

This is a post from the Narita International Airport. Net access in the US is a bit difficult for someone without a laptop or a credit card. Luckily the airport here has some coin-operated kiosks. (100 Yen/10 min.)

I've got a bunch of stuff written down, but it's not the time to post - will have to wait till a decent net access terminal is available. But I wanted to make a post from elsewhere so... =)

Just had some Cold Soba and Green Tea. The soba itself is tasteless, but comes with some soy sauce or wasabi. Either you dip it in or pour it on the noodles, not sure. But went with dipping. The green tea tastes a lot like... unsweetened green tea (unlike the C2 drink that we have). Total cost was 700 Yen. A rough estimate would be 100 Yen/1 US Dollar. But I figured if Bryan ne-chan is willing to spend binge after a walk to 7-11, I can buy myself a meal after a flight to Tokyo.

They had this cool free game at the Children's play room where you had to wipe windows, using a video camera. But my flight is nearing, so I could only watch. My 10 minutes is almost up so we should wrap up here.

Sunday, November 07, 2004

Thanks Everyone!

Please do not have high expectations. I really messed up the final round. Let's just say that several important factors were missing during the competition week (regular Internet connection/power supply, free time, moral support). It is for this reason that Faye's story attracted my attention in particular. She managed to pull off a win against all odds, and I have to give her a bow of respect for that.
--------
TopCoder's competitions are organized into two categories:

The algorithms category caters to the academic world. Here, fast thinking and analytical skills are needed. The contestants are given a set of problems that test for knowledge in CS algorithm concepts such as dynamic programming, memoization, and graph theory. Code solutions are then graded based on accuracy (you get nothing if you fail a test case), coding speed (the time it takes to submit a correct solution), and running time (you get nothing if your program cannot spit out a solution within 8 seconds).

The design and development category caters to the pragmatic world. Here, elegance and thoroughness are needed. Contestants are given a requirement/component specification, and they have a week to turn it into an elegant design/implementation. Knowledge of how to correctly approach a problem, apply design patterns and good programming habits will definitely help.

I know there are a lot of bright[er] coders out there (as evidenced by last year's ACM), and it would be cool to see more of them on the scoreboards.

--------
Apparently, my small group of friends aren't the only Go players in the Philippines. That's funny, given the fact that we [used to] spend a lot of time on PandaNet. Anyway, if you come across tcceledor (like I'd use ShindouHikaru on a go server ;-), necramirez or dart_mol on PandaNet, you'll know it's one of the LB people. =)

And they actually have Go boards here! Cool!

--------