Hung Truong: The Blog!

  • April 18, 2007

    Nintendo Wii – Super Paper Mario Mini Review

    super-paper-mario.jpg

    I just got Super Paper Mario for the Nintendo Wii yesterday. I played through the first chapter, so here’s my quick mini-review.

    Super Paper Mario is different from the other Paper Mario games in a big way. The RPG elements have been pretty much removed. Now, instead of taking turns attacking and defending, Mario just attacks the enemies in real time. So it’s more like the original Super Mario, except with hit points and stats.

    I’m not too happy with this, since I liked the RPGness of Paper Mario. I thought Paper Mario was just an extension of the old Super Mario RPG games. Now that they’ve got rid of the RPG, it’s just not as fun.

    The graphics are pretty neat though. There’s this thing where you flip from 2D mode to 3D mode. It’s like going from a flat world to three dimensions. You can find hidden stuff and avoid the 2D enemies in 3D mode.

    The humor is still intact, too. There’s a lot of references to the original Super Mario Bros. game. There’s even the super mushroom that turns you into a giant version of the pixellated Mario.

    Super Paper Mario is still fun, but I have a feeling it would’ve been better if they had kept the gameplay from Paper Mario: The Thousand Year Door intact.

  • April 12, 2007

    Craigslist and Google Maps Mashup Thingy: Day 6 – MySQL Refactoring

    One of the things I didn’t really care about when I was coming up with my Google Maps Craigslist mashup thing was the correctness of the database schema. I’ve written database schema before, but this time I just got sort of lazy. When porting the application to CakePHP, I realized it was a bad idea to slack off. Today I spent some time refactoring and adding a association table to the db.

    I also learned some more MySQL syntax stuff. Previously, I had worked with Rails, which sort of handles the query making itself. Since I wrote a custom listing parser, I had to do some MySQL magic with JOINs and whatnot.

    I also worked a lot on the Facebook puzzle that I wrote about earlier today. I came up with an approach that was better than the last one I came up with, but only slightly. It’s still in the range of O(n), so I’ll have to figure out the last “clever” thing before I’ve got it finished. It’s actually a lot more interesting now due to the efficiency constraints.

  • April 12, 2007

    Facebook Programming Puzzles – Prime Bits Revisited

    So I got a comment on my original post about the Facebook Programming Puzzle called “Prime Bits” that asked:

    did you get this part ?

    Your implementation should have a running time faster than O(n), where n is b – a.

    id like to see how you solved it.

    I felt really stupid for not catching that part until I checked the Google cache of the page. Apparently Facebook added that requirement some time after April 2nd and, presumably, getting a lot of inefficient entries (mine included).

    It’s also funny to note that if you look at the actual html, there’s a fun message hidden in comments that reads “with ‘efficient’ meaning whatever you think it ought to mean.” Touché, facebook, touché.

    Off the top of my head, I can think of a way using dynamic programming to make the problem a lot more efficient. I’m not sure whether or not it’s just an amortization hack, or an actual better than O(n) implementation, technically.

    Okay, so I went ahead and coded up the dynamic programming version. The running time actually does increase at a less than O(n) rate, so I think it counts. Maybe I’ll plot out the running time growth for good measure. I believe it’s in the neighborhood of log(n). I guess I’ll send this new version along with my resume again, and see if they’ll respond this time 🙂

    mark-zuckerberg.png

    Also, Rest in Peace, Facebook Guy. You’ll be sorely missed.

  • April 10, 2007

    Ask.com on Google?

    askgoogle.gif

    When I searched for ‘prime numbers’ just now on Google, the first hit was a sponsored link for Ask.com. You would think it’s a conflict of interest for Google to be suggesting a competitor to its users. When you think about it, though, Google is also taking money from Ask.com, literally!

    It’s especially strange seeing Ask.com advertising on Google so soon after being criticized for launching a guerrilla negative ad campaign against them…

  • April 10, 2007

    Craigslist and Google Maps Mashup Thingy: Day 5 – CakePHP

    cakephp.png

    Today technically counts as day 5 of my Craigslist and Google Maps Mashup thing since I didn’t work on it at all yesterday due to getting Command and Conquer 3: Kane Edition. I got the limited edition number 73137, which is cool since it’s a palindrome!

    Anyway, today I actually did work a little bit on the mashup. I spent most of my time switching out from a random php output file to a CakePHP setup. I haven’t ever used CakePHP before, but I have used Ruby on Rails quite a bit. CakePHP is sort of like PHP’s answer to rails. It copies a lot of the ideas and conventions that Ruby on Rails expects developers to follow.

    Because of the similarities between CakePHP and Rails, I found it pretty simple to migrate the PHP I already had to CakePHP. I just had to learn the proper syntax to get everything working in Cake. I still think Ruby is a really beautifully simple language to write code in. Cake tries to get things looking Ruby-ish, but there’s still some weirdness involved. It’s good for me to be learning these PHP things anyway, though. I’ve put PHP on the backburner for too long.

    Tomorrow, if I have time to work on the project, I think I’ll implement the actual UI side of things. I have a rough idea of how I want users to be able to interact with the site. Hopefully designing the interface will be as easy as it is in Rails.