Hung Truong: The Blog!

  • March 06, 2008

    Fire Eagle Invite Get!

    fireeagle_logo_final.png

    Thanks to LordElph, I got an invite to Yahoo’s newest thing, Fire Eagle. I feel as though there’s enough fire stuff in the world with Firefox and its eternal enemy, Firedog. But oh well.

    Fire Eagle is a centralized location information service, basically. You can use its built-in APIs to set user location information and grab user information from it (assuming you have the correct permissions).

    This is cool because in the past, applications have had to do this location stuff on their own. For example, if I wanted to set up a Twitter clone that knew a user’s location, I’d have to be able to take the information and process it, and retrieve it later. Fire Eagle handles a lot of stuff like figuring out exactly where a user when things might be ambiguous (I typed in “University of Michigan” and it gave me a choice between the main campus and the Dearborn one).

    I’m planning on coding up some location aware applications at some point soon, so I think it’ll be fun to try and see what I can do with the help of this Fire Eagle thing. Yahoo has definitely done something unique and I give them some props for working on this service!

  • February 27, 2008

    Fun With Rails and High-Performance Caching Mechanisms (Memcached)

    Since it’s Spring break for University of Michiganers, I’ve had some free time to mess around with learning stuff I don’t have time for when school is in session. Something I’ve been meaning to try out is memcached, which is an uber-efficient way to cache stuff in memory so you don’t end up hitting the database a lot for redundant queries.

    I installed memcached on my mediatemple machine using some directions I found online specifically for centos. I don’t have yum or rpm or whatever people use for putting new stuff onto their linux boxes. I just wget, untar, and make/make install. I had to make a symbolic link for the libevent thing that I installed as well since the path wasn’t set up correctly. I’m still trying to get memcached to run automatically as a daemon when I boot up. I tried sticking a line in the /etc/init.d/ or something rc.local but it hasn’t really worked. Oh well.

    I’m using memcached right now along with a rails gem called “Cached Model” that does a pretty good job of automating the caching process. What’s important to know is that the gem only caches Active Records that are found via a simple find on id. It won’t cache more complex queries. Right now I have it running on my Animenano site caching a bunch of objects. I’ve seen a small though noticeable difference.

    Memcached isn’t without its caveats, however. For one thing, your initial db hit is going to take longer than normal since you’re going to be checking memcached, then grabbing the data from the db, then saving the data into memory. From reading the logs, this doesn’t really take that much extra time. The time saved is likely more worthwhile.

    I’m always trying to squeeze more performance out of my sites. Periodically I’ll go check out my log files and see if there’s anything taking an insane amount of time to render (like, .1 seconds or so). I’ve caught a few bad algorithm decisions that I had made in the past, and I think for the most part my sites run pretty efficiently. Memcached is a pretty fun way to slice some time off of the page rendering times for Anime Nano.

    If you have a few spare hours to kill and a rails app that seems to be a little slow, it might be worthwhile to install memcached and see if caching your Active Record objects will speed things up. I’m seeing a speedup of maybe 1/2 (it takes half as long to load a page) vs running without memcached. That’s totally non-empirical observation, though.

  • February 24, 2008

    Apple Internship Phone Interview + Verdict!

    I had my Apple phone interview on Friday. It went well, except for all of the questions I couldn’t answer! orz.

    About five seconds into the interview, I realized that the description given to me and the actual content of the internship would be quite different. The position was described as “iPhone QA Engineer,” which listed duties like “functional testing of iPhone applications” and “design and implementation of test plans and test cases, risk analysis, & integration testing across the system.”

    The description that my interviewer gave was that I’d be working on an internal iPhone web application for tracking test results and other stuff. Definitely not as interesting as I thought it would be. It’s probably still kind of cool, but not as cool as doing actual QA on the iPhone.

    By the time the interview had finished, I knew it would be a bad fit and that I would get an email with the same sentiments. Sure enough, about two hours after the interview had ended I got an email from the recruiter saying there wasn’t a fit. He said he’d send it to a few other departments in Apple as well. Cool guy.

    I’m not too upset about this particular rejection, other than the fact that I feel it was incorrectly described, which cost me a bit of time in my preparation. It was still a good experience, and I got to ask a few questions about the company culture at Apple.

    In other non-news, I actually got a successful internship offer, so to speak. But it’s not quite official yet so I can’t write about it until it is.

  • February 13, 2008

    Overheard in Stats Class

    Student: So, log(x)… that’s like, x2, right?

    Me: *headdesk*

  • February 10, 2008

    Facebook Social Ads Really Work!!!

    facebookad.gif

    I mean, they work if you’re a captain who knows how to catch big fish with their boats. Oh wait, I’m not! But thanks for the ad anyway… Also, I love the typo: “This app if for?” IF FOR? Seriously? You must’ve gotten your MBA at Harvard!