Wireless tools for Mac OS X

September 1, 2008

I’ve been having some trouble with my MacBook on a certain wireless network. OS X has some pretty good GUI tools for configuring the wireless Airport, but sometimes you need a good command line tool for debugging. Linux has a pretty good set of tools for this: Wireless tools for Linux. Despite OS X’s being built on Unix, no such tools are available.

Upon googling for command line wireless tools os x, the first hit was exactly what I was looking for. At the moment that site is down, but Google’s cache saves the day.

It turns out that OS X comes with a nifty little tool called airport, but it’s not on the default path and buried deep inside the file system. I added to my path:

% sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport

To print a list of wireless networks currently in range:

% airport -s

To print the current wireless status:

% airport -I

To connect to a specific network SSID:

% airport -A<SSID>
2

Braid

August 31, 2008

If you have an Xbox 360 and you don’t have Braid, go get it now. Not ready to spend the $15, which is more than worth it? Download the demo, and I guarantee you won’t be disappointed. Braid is a completely novel platforming puzzle game in which you can control the flow of time, forwards and backwards. You only get one hit, but it doesn’t matter – if you get hit, just rewind time until before when you got hit.

Each world has a different way of controlling time, making for a plethora of unique and interesting puzzles. The first world has no special gimmick, time just goes forwards and backwards. The second world introduces objects which are immune to going back in time, so when you go forward, everything goes forward, but when you go backwards, those objects continue going forwards. And so on.

Braid only has about 3-5 hours of gameplay (or less, if you’re naturally really good at these time puzzles). It does have a little replay value in its time attack mode, where your goal is to beat certain levels under certain (real time) time limits. The hardest one is to beat the entire game in under 45 minutes, which is the final achievement for the game, worth the last 15 gamerscore points out of 200.

My review:

Gameplay: 10/10 — I wish I could give it a higher score

Plot: 5/10 — It’s a pretty simplistic “save the princess”, but with a twist; besides, it’s a puzzle game

Graphics: 10/10 — I’ve never seen a more beautiful platformer

Sound: 9/10 — The music is very pleasant, and the way it goes backwards when time goes backwards is awesome (and doesn’t sound like crap)

Overall: 10/10 — Gameplay trumps everything else

Braid is currently the highest rated Xbox Live Arcade game on Metacritic. But with a score of 93, it’s also the #8 Xbox 360 game of all-time. Pretty damn impressive for a game with a budget of a paltry $180,000. Now do yourself a favor and go download Braid.

Comments Off on Braid

Bad website search

August 10, 2008

The user interface for performing a search on a website is pretty much a solved problem. You enter your search terms, you click the search button, and you get taken to the first page of search results. If what you’re looking for isn’t on the first page of results, you can go to the next page of results. The current page of results you’re looking at is stored as an HTTP GET parameter in the URL, so you can easily jump to the nth page by changing that parameter.

That’s the right way of doing a search UI. Boardwalk Properties, and its sister sites Cambridge Pads and Boston Pads (and possibly others), managed to do it completely wrong. Instead of storing what page of results you’re looking at a URL parameter, they store it on the server and associate it with your cookie.

To actually browse the pages of search results, the links at the bottom each page for the next and previous pages just link to resultsdb.php?direction=1 and resultsdb.php?direction=0 respectively. It works fine if all you’re doing is going forwards and backwards one page at a time. But these links are just plain vanilla GET links, and they affect the server state. This violates the basic principle that GETs should be idempotent.

This has a number of bad consequences. Refresh the page? Oops, you just advanced to the next page (or the previous page). Try to view the source? Depending on your browser, it might send another GET request, thus giving the source of the next page of search results, and putting you on the wrong page the next time you try to change pages. You also can’t jump to an arbitrary page, you can only move one page at a time.

And since you only have one cookie, you can’t do multiple searches in different tabs or windows at the same time. If you start a new search in a new window and try to change pages in an older search, you’ll suddenly find yourself amidst the new search instead.

I don’t know how they messed up their search so badly; since they’re already running PHP it ought to be trivial to change. Every website developer should understand the basic principle that GET requests should not modify server state.

Comments Off on Bad website search

Blog Reactions

July 28, 2008

When I started this blog, I was curious to see how fast the search engines would find it. Googlebot was the first, and I haven’t really been keeping track of it after that. The only known link here at first was from http://www.whois.sc/, which apparently has links to newly registered domains. As of this point, I actually haven’t told anyone about this blog yet, since I wanted to put in some content.

In my earlier post on Metal Gear Solid 2, I posted a link to a YouTube video. And somehow, through the magic of blogging, Technorati managed to pick up on this and gave this blog its second in-link. I never posted a pingback or a trackback or whatever the latest craze is for interconnecting the blogosphere. Some web crawler managed to find my blog, notice the link (which was to the YouTube video, not to another blog mind you), and decide that this was a blog reaction and post about it.

After grepping through my log files, I was actually a little surprised to find so many different bots crawling my site. In no particular order, they are Googlebot, SurveyBot, BlogPulse, BlogVibeBot, Moreoverbot, and possibly others. I also noticed there were someone was browsing my site using Lynx.

Comments Off on Blog Reactions

Underhanded C Contest

July 25, 2008

I recently discovered the Underhanded C Contest. It’s a contest where the goal is to write a C program which looks like it’s innocently doing something straightforward, and yet it slyly doing something innocuous which is not at all obvious from reading the source code. The shorter program, the better, since it’s a lot harder to hide something in a short snippet. It’s sort of the polar opposite of the Obfuscated C Contest, where the goal is to create the most horrible looking code possible that does something useful.

Past winners of the Underhanded C Contest have done things such as using the XOR swap with two of the same argument (in a non-obvious fashion) and mis-declaring the function prototypes of standard library functions to mess with the stack. This description, however, doesn’t do the 2007 winner justice. Head on over to the 2007 winners page and see just how crafty that one was.

The contest for 2008 is to essentially black out portions of an image while maintaining all or most of the information needed to reconstruct the original image. Can you do it with innocent-looking code?

Comments Off on Underhanded C Contest

Metal Gear Solid 2

July 6, 2008

Spoiler warning: This post contains spoilers for Metal Gear Solid 2. Read at your own risk.

I just finished beating Metal Gear Solid 2: Sons of Liberty last night, and boy is it a fantastic game. I played the first Metal Gear Solid during the summer of 2005 (yeah, I know I’m a little late to the party). Before then, I’d never played it nor seen it played, but I had heard a number of rave reviews. After finding the original PlayStation version in the bargain bin at EBGames (now GameStop), I decided to pick it up, and I was not disappointed. In retrospect, I should have just picked up Metal Gear Solid: The Twin Snakes, the GameCube remake, but I didn’t realize at the time that it was a remake as opposed to a whole new game.

Some time passed, and I found myself interning at Google in the summer of 2006. I was once again picking through the bargain bin at another GameStop, and lo and behold, I found MGS2 there for real cheap. I remembered having really enjoyed MGS, so I picked it up. Why I didn’t go out and get MGS2 immediately after beating MGS, I don’t know, maybe I was too busy with other games and schoolwork or something.

I started playing MGS2 that summer and got about halfway through the Tanker chapter, up to beating Olga Gurlukovich. And then I stopped playing, for no good reason. I hadn’t gotten far enough into the game where it had a hold on me, and at the time I was really obsessed with Guitar Hero. So I put MGS2 on my backburner and forgot about it, intending to one day pick it up again and beat but never quite getting around to it.

And that brings us back to 2008. As you should know (if you follow video games at all), Metal Gear Solid 4: Guns of the Patriots released this past June 12. I was drooling after seeing the trailer. But I couldn’t just skip MGS2 and MGS3, that would leave holes in my understanding of the plot of MGS4 and surely spoil the plots of MGS2 and MGS3 for me. (Side note, after watching that trailer again after beating MGS2: Hey, that must be Raiden (the ninja) fighting Vamp! He’s sure gotten good at using that sword.)

So a couple of weeks ago, I started playing MGS2 again. I decided to restart from the beginning, since it had been almost two years since I’d last played it and I was only a couple of hours in. The tanker chapter was exciting and got me hooked. Seeing Ocelot steal Metal Gear RAY, blow up the tanker, and run off into the sea was chilling.

After that, I was no longer Solid Snake, I was Raiden. It shocked me to learn that Raiden’s name was pronounced RYE-den, not RAY-den as I had originally thought, even though it’s pretty obvious if you realize it comes from Japanese.

Anyways, I played through the game over the past few weeks, taking careful steps not to spoil anything for myself. I played it on Normal difficulty with Radar Type 2 (radar normally available but not available in infiltration mode, or whatever it’s called when guards are searching for you). My score wasn’t that good; I don’t remember how many kills, deaths, continues, and saves I had, but they were all two digits. I attempted to go to konamijpn.com to enter the code it gave me at the end, but that site seems to have been taken down and replaced by some Chinese parking site as of at least September, 2007. I didn’t collect any dog tags because, well, I just didn’t know about them. I avoided FAQ sites like the plague, and they don’t really mention dog tags in game. I know about them now since I checked out the FAQs to see what I missed on my first playthrough. On my next playthrough (which probably won’t be for a while), I’ll probably play on Expert and try to get all of the dog tags.

I’m not going to bore you with all of the details of my play through, but here are some points of note:

  • As soon as Iriquois Pliskin opened his mouth, even before it displayed David Hayter as his voice actor, I knew it was Solid Snake. He just had to be. I’m sure everyone figures this one out pretty quickly, though, it’s pretty darn obvious.
  • Running around naked in Arsenal Gear was rather entertaining
  • The Colonel going crazy at the end was also rather awesome. He was spouting out all sorts of ridiculous things like “I hear it’s amazing when the Purple-stuffed worm in Flap-jaw space, with the tuning fork, does a raw-blink on Hari-kiri Rock! I need scissors! 61!”
  • Hideo Kojima is brilliant. He managed to put in an Internet meme. During the fight against a ton of enemies in the bright blue room near the end, I appeared to have gotten a Game Over screen for no obvious reason. Except instead of saying the usual MISSION FAILED, it said FISSION MAILED, and the game continued in the top-left quadrant of the screen. The Exit and Continue buttons were replaced with Emit and Continent. After some time, the game returned to normal. This reminds of the fight against Psycho Mantis in MGS, where the screen goes black with only the green text HIDEO in the corner at the beginning of the fight, making you think your game console stopped functioning or something.
  • The second-to-last boss fight made me drop my jaw. I thought that a fight against a single Metal Gear REX at the end of MGS was pretty crazy. When seeing that I had to fight a whole army of Metal Gear RAYs here, I couldn’t believe my eyes. And yet, it was a surprisingly easy fight. They only seemed to engage me one at a time, with an occasional RAY shooting a missile from the sidelines. It was just equip the Stinger missile launcher, shoot a RAY in the leg, quickly shoot it again in the head, and always move when not shooting to dodge its attacks.

Final review:

Gameplay: 10/10
Plot: 7/10
Graphics: 8/10
Sound: 5/10
Overall: 9/10

Yeah, I know that 9 is not the average of those other numbers, but it was a really damn fun game. I highly recommend it to anyone that hasn’t played it, although if you’re still reading and haven’t played it, I’ve unfortunately spoiled some of it for you (though hopefully not too much).

Comments Off on Metal Gear Solid 2

Hello, world!

July 4, 2008

I have a blog. Yay. I’ve been meaning to start a blog for a long time, but I’ve never really gotten around to it. This blog is going to be about programming, software engineering, video games, and whatever the heck I feel like talking about.

Right now I’m calling this “The Spoony Blog”, named after a famously mistranslated quote from Final Fantasy IV. In the Japanese version, Tellah says something along the lines of “You son of a bitch!” to Edward, but that somehow ended up getting translated as “You spoony bard!”. The line became so famous that in the various remakes of the game, which contained much better translations, the was retained unedited.

If you have a better name for this blog, lemme’ know.

exit(0);

Comments Off on Hello, world!