Archive for the 'Personal' Category

What, a techie worry about inflation? Never!

Friday, June 27th, 2008

I’ve been thinking about my expenses over time, and not only am I now spending less in real terms (adjusted for inflation), I am now spending less in absolute terms (raw dollar amounts at the time of purchase). Here are some examples. I bought a 20″ flat-screen display for my computer three and a half years ago for $700. I could get the same thing nowadays for $200. I spent around ~$1400 total on a new computer back in January 2007
, versus the ~$500 total I spent on a new computer this month that is better than the previous one in almost every way. And I haven’t bought a flat-panel television, a digital camera, or a mobile phone recently, but I may soon, each of which is now cheaper than ever before. Technology expenditures make up a substantial portion of my budget, so when the price of technology continues dropping year over year, I notice a big difference in how much money I’m saving up.

In the developing world, or amongst those living below the poverty line in developed nations, inflation has not been kind. Cost of living increases have been especially vicious, doubling the price of many basic food staples in the past year alone. Gasoline price increases have also dealt a cruel blow. Yet few increases have hit me very hard: my food expenditures are still a comparatively tiny part of my income, health care increases don’t affect me much because I’m young and I get free insurance through my employer, etc. The one increase that hasn’t been kind to me has been the price of gasoline, as I do commute to work regularly. But the price in gasoline has still been offset by all of the money I’m saving on gadgets.

Take an average 5% cost of living increase year-over-year (if ones income is also increasing at 5% a year, then ones real wage remains constant). Then look at Moore’s Law, which specifically addresses the increase of transistor density on microprocessors over time, but which can also be applied to the cost of technology of equivalent performance over time. Moore’s Law gives us a doubling in performance every two years, or equivalently, a halving in price for the same performance every two years. That’s a 30% annual cost of technology decrease for equivalent performance.

If you’re trying to stay on top of the latest and greatest in computer technology, then yes, costs haven’t decreased over time; a top of the line graphics card or processor will always be expensive. This is because the performance of computer components is increasing with Moore’s Law (thus canceling out the exponential price decreases), so the tiers remain roughly equivalently priced over time. But what was the high-end tier two years ago is now the low-end tier today. Most consumers’ technology needs do not grow exponentially like the technology itself does.

If all you’re doing is word processing, web browsing, and email, you don’t need to keep up with the latest and greatest hardware like gamers do, so a computer with basic functionality is much cheaper now than it was before. Many other consumer electronics items follow this basic curve as well: quality digital cameras are far cheaper than they’ve ever been; the same for big screen flat-panel televisions. You can get a 50″ flat-panel television for $1,500 now; two years ago, it was around $5,000. All hail rapidly decreasing costs of technology!

So if you’re a techie like I am, and you do spend a significant portion of your income on technological gadgets, do not fear the passage of time: relish it! Even though our economy is really tanking at the moment, I can’t be too sad about it. The march of technological progress continues ever onwards, bringing us ever more amazing things at ever-decreasing prices. The effects of time are hitting lots of people really hard as the prices of most basic needs grow much more quickly than real wages, but not everyone is suffering.

The most embarrassing moment of my life

Wednesday, June 25th, 2008

It is with a surprisingly still-visceral sense of utter shame and vermilion embarrassment that I report one particularly memorable occurrence from childhood: the most embarrassing moment of my life.

I was in a “Gifted and Talented” program at Cold Spring Elementary School in Potomac, Maryland. For one of our fourth grade field trips, we Magnet students piled into a school bus and headed over to beautiful Sandy Point State Park along the Chesapeake Bay. I vaguely recall that we were supposed to be learning about ecology. In particular, and I remember this vividly because it would soon become an integral part of my most embarrassing moment ever, we had all worn swimsuits earlier in the day while mucking about on the beach and in the Bay. When the day came to a close, we were all supposed to change out of our still-wet swimsuits, board the bus, and go back to the school.

However, I was not paying attention at all when the teacher was giving the finer instructions on this point. I was, and I still remember this clearly because the whole incident is seared into my memory, fantasizing about rocket ships. Had I not been occupied with daydreams of fantastic voyages to alien worlds, I would have heard the teacher’s instructions that all of the girls were to go change behind the school bus (which was parked alongside the road) and that all of the boys were to go change somewhere else. To this day I do not know exactly where we boys were supposed to change, but that I know exactly where the girls were supposed to change may foreshadow how this story will draw to a close.

After my teacher Ms. Sesler (who later married and became Mrs. Unger, though this is not strictly relevant) finished with the changing instructions and everyone started to disperse, I, having not heard any of it, ended up where I thought was the most logical place to change: in the restroom. It still haunts me to this day that I didn’t just follow the rest of the boys. By the time I finished changing and exited the restroom, I didn’t see anyone else. Thinking that everyone had probably already finished changing (as I had also, uh, “used the facilities”, and thus taken awhile), I headed in the only logical direction: to the bus. As I drew closer I saw several pairs of feet underneath the corner of the bus. Thus, relieved that I had located the rest of my peers, I cheerily asked “Hey guys, what’s up?” as I rounded the corner.

What followed next was the sound of roughly thirty nine-year-old girls in various stages of undress shrieking at the tops of their lungs — including the girl nearest me as I turned the corner who was one of my two best friends and who I had had a vicious crush on. I was instantly horrified at the thought that they would all think I was some kind of perverted Peeping Tom. This was followed shortly by one of the parent chaperones chasing me down across the road, screaming at me as I fled in horror. She was the hot mom of the class too, and was always involved in PTA events. I will admit to having a schoolboy crush on her as well, so this made it all the more traumatic.

Then, after things calmed down somewhat, Ms. Sesler came out and started yelling at me. Much to her credit, she quickly realized how shocked and disoriented I was, and that I hadn’t done it on purpose. She said she would “figure out my punishment later”.

But the worst was far from over, because, as you see, we had arrived by bus, and we had to leave by bus. What I really wanted to do was to go crawl into a hole somewhere and die, but instead, I had to get back on the bus with every student in our class — including all of the girls who I had just seen naked (in their minds anyway; in reality it all happened so quickly and there was so much going on that I didn’t even see a damned thing for all my troubles). The bus ride was an hour long.

Read the rest of this entry »

Why programmers make good editors

Thursday, June 19th, 2008

A couple days ago, whilst reading a post on a well-known blog (though I no longer remember which one), I noticed an unmatched parenthesis. A long parenthetical aside, fully two paragraphs in length, was not terminated with a matching right parenthesis. This is quite an easy mistake for most to make, and I do not fault the author overmuch. The length of a parenthetical aside is inversely proportional to how likely the reader is to remember he is still in a parenthetical aside by the time he reaches its end. In this case, the person doing the reading was also the post’s author going back through to edit it, and he simply missed the missing closing parenthesis.

But I’m the kind of person who notices these errors, and I’m also the kind of person who often thoroughly analyzes situations (note that I did not say “over-analyzes”), so I got to thinking, why do I notice these kinds of errors especially well when many people tend not to? I don’t think it’s just because I personally enjoy using parentheses so much that I keep a careful watch for abused parentheses everywhere I go, like some superheroic defender of downtrodden punctuation. No, that’s not it. Then it hit me. Keeping track of matching syntax is a very important activity in my day job — computer programming. Programmers run into time-consuming compiler errors early and often if they can’t keep their parentheses, angle brackets, curly braces, and square brackets tightly wrangled.

Therefore, it’s worthwhile to keep track of syntax nesting levels in your head as you write or read code, adding a mental “+1″ for each opening character you come across and taking off a mental “-1″ for each associated closing character. By the end of the chunk of code, you should be back to the number you started off with (for my fellow computer scientists out there, the best representation of this would be a stack (i.e., push a left symbol onto it and pop a right symbol off, and the stack should be empty at the end (this is how compilers work)). I’m not saying I’m perfect at it; when I’m twenty levels of parentheses deep in a particularly ugly Lisp subroutine, I have no choice but to rely on the compiler’s auto-indentation to make matching manageable. But I definitely think I’m better than most, simply because I regularly work in an environment where it matters a lot.

So as I’m reading prose and I encounter a left parenthesis, some kind of state subconsciously switches in my mind, and I go into parenthetical aside mode. I stay in that mode until a right parenthesis is encountered. If one isn’t forthcoming, I quickly scan ahead in the text to see if there even is one, or maybe there was one all ready that I simply missed. More often than not, the author has simply forgotten the closing parenthesis. It is my experience that long parenthetical asides are more rare than unclosed short ones. This same mental trick even works for parenthetical asides inside of parenthetical asides and even parenthetical asides inside of parenthetical asides inside of parenthetical asides, but that’s about as far as I go. Luckily for me, you don’t tend to see levels of parenthetical nesting four or more deep, and if you do, it’s probably some Lisp programmer forgetting in what medium they’re writing. If the latter is the case, watch out for cars and cdrs as well.

But I don’t just notice mismatching syntax errors in the written word; I tend to notice all errors (so long as I’m reading with the intent of editing, anyway; when I’m speed reading, I often miss errors on account of not seeing them). I’m a good editor — and not to sound vain, I’ll balance that out by saying I’m a terrible bowler. But I can’t help but think that being good at editing comes naturally to computer scientists. Many of the skills — noticing slight deviations from the rules, especially in the form of syntax — are exactly the same. Both the English language and all programming languages have well-defined rules about how words/clauses may or may not be used together. It’s simply a matter of identifying violations of the rules.

I will add one rather large caveat to my thesis: I’ve known many programmers who cannot spell worth a damn (maybe they flee to computer science because it involves very little essay writing?). Some of them have been dyslexic. I don’t know if anyone’s established a correlation between dyslexia and going into computer science, but I definitely think there is one. So I think programmers make good editors, with the exception of the many programmers who cannot spell well. But if the spelling is good, by virtue of their profession, I bet they’ll be darn good at noticing all of the other errors one encounters in prose.

And for those of you following along closely at home, did you notice the mismatched parenthesis in this post? In the comments below, let me know if you noticed it, and whether you are a programmer. Be honest! Let’s try to get some data that, while not conclusive, will at least be one step above anecdotal.

Don’t ever be ashamed of your code

Friday, June 13th, 2008

Are you ever ashamed of your code? Don’t be! Being ashamed of your code is harmful, as artfully explained by Ben Collins-Sussman. It’s better to make your mistakes in the open where they can be quickly corrected than in private where they can fester for months, even years. Note that we aren’t necessarily talking about open source code here. Being ashamed of your code could also mean not sharing code with other people at your company.

Ben uses some anecdotes to illustrate just how badly situations can get when programmers (or small groups of programmers) sit on their code for months on end without any outside sanity checking whatsoever. But these anecdotes are more humorous than necessary, as it’s pretty much a truism in computer science that coding off on your own in secret is a bad idea. The people who are doing it know it’s bad, and the only reason they persist is because they are ashamed. Oftentimes they’ll rationalize it by saying “I’ll just clean it up before I let others see it” — which, when combined with procrastination, can mean no one else sees it for months or even years. And if poor architecture decisions have been made, as they often are, the problem is too large for a simple clean up; a partial or full rewrite is necessary. This is not the situation you want to find yourself in.

Luckily, I can’t say I’ve ever felt ashamed of my code. And that’s not for lack of writing some truly terrible programs, either. I just value the feedback I get from others more than any personal attachment I might have to my code. In other words, I don’t take it personally. And to demonstrate that, I’m going to post a truly terrible program I wrote back in high school. My only excuse is that I was young and ignorant.

The program in question is “makeSite”, a program I wrote to create my blog-like website before the word “blog” even existed and before any real blogging software had been developed. I was writing what was effectively a blog at the time (you can see an archive of it here), but I got tired of having to hand-edit the HTML to copy over a previous entry and modify it each time I wrote a new entry. So, naturally enough, I wrote a C++ program to statically compile a bunch of text “data” files containing my own custom pseudo-HTML-like syntax into a website. I won’t defend the decision to do it this way, other than to say that I didn’t know any better. What this effectively meant was that every time I updated any part of my site, even to fix a one-character typo, my entire site had to be re-compiled by re-running the program, a task that, because my program wasn’t very efficient, was taking minutes after my site grew to be rather big. I toyed with the idea of some sort of incremental site compilation, only updating the pages corresponding to the changed data files, but I never got that working.

I think it’ll help to illustrate how bad this program truly is by individually discussing some of the more egregious parts of it.

#include "apstring.h"

For those of you who aren’t familiar with the “apstring” string library, here’s a hint: ap stands for Advanced Placement. That’s right, instead of using a standard, widely used string library (like “string.h”), I used the apstring library (by the College Board), because that’s what we were taught in class. It was just like a real string library, only it didn’t have as many features. Frankly, there’s no excuse for its existence, as tests should conform to reality and not the other way around. If you ever see it in production code, you should run like hell.

	headFile.open("pages.dat");
	output.open("pages2.dat");
	while (headFile.get(ch))
		output << ch;
	output.close();
	headFile.close();

Yes, you really are looking at a character-by-character copy of a file. Never mind that there’s an OS function to do this in one line (and much more efficiently, I might add). But the reason I did it this way is even worse than the way I did it, if that’s possible: I wanted a second copy of the file so I could parse through the original string-by-string, and then when I hit upon a page that was a subpage of another page, I would consult this copy to find out what its parent page was. This was to get around the problem of not being able to have two file handles open to the same file. I suppose the concept of just loading the whole file into memory and parsing through that didn’t occur to me. And notice the hard-coded file names; that’s a nice touch.

Read the rest of this entry »

Specs for a high power, cheap ($380) GNU/Linux desktop

Wednesday, May 28th, 2008

The other day, I was realizing that I don’t use GNU/Linux as often as I should. Sure, I run it exclusively on my servers, but I still use Windows on the desktop for the most part. That’s more out of habit than out of any need. Everything I currently do in Windows I can do in GNU/Linux, except for the games, which I’m playing more and more occasionally these days. I was dual-booting my current desktop with Windows XP and GNU/Linux for awhile, but it proved to be inconvenient. My computers’ uptimes, both servers and desktops, are typically measured in months (only going down for crashes and power losses). It takes awhile to reboot and restart all of the applications I typically have running, so I don’t do it by choice. Thus you can see the problem with dual-booting: it entails constant rebooting, which I had to do as often as I felt like playing a Windows game. And then once I was in Windows I wouldn’t want to go through the hassle of booting into GNU/Linux only to boot back into Windows the next time I wanted to play a game. It simply wasn’t working.

So I now see the problem with my initial attempts at using GNU/Linux on the desktop. I simply don’t have the patience to put up with all of those constant reboots and interruptions in my computing environment. I’m too lazy. I’m simply going to get another desktop to use exclusively for GNU/Linux, while making every effort to only use my current Windows desktop for playing games. And luckily, making a desktop computer is cheaper than it’s ever been. Here is a current parts list I put together just yesterday for a killer GNU/Linux desktop.

The specs

This complete GNU/Linux system costs only $355. Throw in shipping and we’ll call it $380. That’s a really cheap price considering how powerful this system is. Avoiding the Microsoft tax by choosing a Free operating system pays huge dividends when the overall system is cheap. Allow me to explain the choices I made in putting this system together with individual analyses of each other components:

The barebone system

First of all, I save a lot of money with this computer by building it into a barebone system. A price of $90 for a case, power supply, and motherboard is really hard to beat. You can easily spend over $90 for each of those individual components (and in fact, when I built my current desktop, I did). Getting a good barebone system is an excellent way to save a lot of money on a low-end desktop. If you’re not building a low-end desktop, I wouldn’t bother. The limitations can be significant. For instance, the motherboard that ships in the barebone I picked out supports a maximum of 2 GB of RAM; fine for a low-end system, but you really want 4 GB of RAM on a medium or high end system. And the power supply is only 250W; again, fine for a low end system, but don’t expect it to be able to power, say, a high-end discrete video card. And naturally the motherboard doesn’t support dual video cards, which would be an upgrade path you might want to keep open on a system you’re outlaying more money on. It also doesn’t support quad-core processors. So there are limitations, but for a low-level system, you won’t run into them.

Read the rest of this entry »

Hard to believe it’s been a year

Tuesday, May 27th, 2008

It’s hard to believe it’s been a year since I graduated University of Maryland. Compared to how quickly this one went by, all of the previous years in my life felt like eons. And the sad thing is I can’t really even point to anything that justifies the passage of a whole year (except possibly writing that novel, my work on Veropedia, and that telescope I haven’t finished yet). Nothing particularly amazing happened; I just worked, earned money, and wasted time. It’s kind of unfulfilling. At least I have this blog, which gives me some kind of accomplishment to point at. Otherwise, I would be really melancholic right about now, having blown a whole year on work, surfing the web, and playing games.

Whereas other people have New Year’s resolutions, I think it makes sense for me to have a Graduation Day resolution. I don’t want to be in the same place next year as I am today. I’m resolving to do more worthwhile things, in whatever form they may be. For now, I think that will involve a lot more writing. I’ll have to seriously cut down on idly browsing the web and channel that time towards my writing. I’ve already really cut down on my time spent playing games, so that’s good.

Eventually, though, I think I would like to go back to school. There’s something about being a professor that really appeals to me. I think I was one of the few students in my classes who really envied our professors. And I know I have the intelligence to accomplish that goal; it’s just a hell of a commitment. So for now I’ll continue working, saving up my money, and writing, but I do have my eye on more nobler goals.

Old Man’s War: Decent, but not revolutionary

Saturday, May 24th, 2008

I discovered John Scalzi’s blog Whatever a couple months back and I’ve been reading nearly everything he’s posted to it since. The name of the blog is blah, but don’t let that fool you. He’s been doing this blogging thing for longer than the word “blog” has existed, so the name of his site was more passable then than now. But ignoring that issue, he’s a very witty writer, and his blog posts are consistently entertaining. And since he’s become a published science fiction author in recent years, he’s also done a fair bit of promotion of his books (Old Man’s War, The Ghost Brigades, The Android’s Dream, The Last Colony, and the upcoming Zoe’s Tale). So for my flight back from Phoenix, I bought Old Man’s War and settled in for a marathon reading session.

First off, let me begin by saying that I started the book about an hour into the flight, didn’t put it down until I deplaned, read most of the rest of it after driving home from the airport, fell asleep, woke up, and read the remaining few pages before breakfast. So on that count alone, I won’t deny liking it. I’ve read many novels that simply weren’t able to grab me; Old Man’s War did. Heck, some novels I find so lacking in entertainment that I don’t ever get around to finishing.

But I did have some problems with the novel. John Scalzi seems to possess only one writing style. On his blog, it works excellently, but his absurdist humor kind of felt out of place in a novel that takes itself so seriously. For instance, his main character, John Perry, gets blown out of an exploded shuttle, with shrapnel slicing away the lower part of his head, and then as his body ragdolls through mid-air, he becomes “possibly the first person in history to kick himself in the uvula.” Come on. It had me chuckling, or rather, marveling at the absurdity of what I had just read. It was also jarring, and temporarily broke my immersion in the story. The rest of the novel contains similar snippets like this. And John Perry is so consistently making dark and dry jokes you can just tell John Scalzi based John Perry off himself. If that and the shared first name aren’t enough of a clue, John Perry was a writer before he became a soldier.

I also had some problems with some of the cliché characters. There’s an idiotic loud-mouthed soldier, the standard caricature of a gung-ho, cock-sure warrior with more machismo than sense, who is so impatient for battle to begin that he promptly gets himself killed by peeking out from cover in excitement after killing an alien as he mouths off about the awesomeness of war. And then the description of his death is especially visceral, with bullet-shockwave-pressurized brain matter spewing forth from his head as he’s shot, as if to especially emphasize to the reader that this guy deserved to die for his foolishness.

There’s also a smarmy, condescending politician-cum-soldier who thinks so highly of himself that he believes he can single-handedly negotiate peace in the middle of war; he drops his weapon, approaches a group of aliens, and is instantly turned into a fine bloody mist when all of the aliens simultaneously fire their club-shaped traditional weapons (which just so happen to be shotguns). It was another especially gruesome death, carefully written by Scalzi as if to say “This jerkwad deserved it”. And I’m not sure I like the message of it either; it’s a non sequitur attack against giving diplomacy a chance.

You could see the deaths of both of these cliché characters telegraphed from pages away. While I suppose these scenes were intended to be satisfying, indulging a schadenfreudist delight in watching idiots get their just desserts, they just left me feeling hollow, and especially in the case of the first character, contradictory. The soldiers in these scenes are all 75-year-olds given new bodies right before being shipped off to war; how many of the elderly still retain such levels of foolishness and impudence that can only be found in youth?

And now here’s where I really get really nit picky. I had some fundamental problems with the universe of Old Man’s War. It’s full of alien races all vying for a limited number of star systems, all of them at a sufficiently equal enough level of technology so as to make all battles fair. This simply doesn’t make any sense. Considering how far warfare progresses in a single generation here on Earth, and considering that the universe is 13.5 billion years old, the odds of having many different civilizations all at essentially equal levels of technology are zilch. The first species to achieve intelligence, even if they only won the race by a thousand years, would dominate the galaxy. There wouldn’t be battles, there would be massacres. Here on Earth we’ve progressed from cavalry to nuclear aircraft carriers in the span of a single century. Picture how imbalanced that war would be, and then expand the difference in war-fighting technology out to millions of years.

Don’t go thinking, from all of my criticism, that I didn’t enjoy the book; I did. I purchased the sequel, The Ghost Brigades, and I will be reading it. But I just wouldn’t call this novel revolutionary. It sits squarely within Robert A. Heinlein’s and Joe Haldeman’s genre of action-packed military science fiction, with some of Scalzi’s own quirks, but it does not push its boundaries or attempt to transcend them. This is most unfortunate, because what I appreciate more than anything else in my science fiction is making me think. I would attempt to compare this novel against another scifi novel that I recently read, Childhood’s End by Arthur C. Clarke, but there really is no comparison there. I would love to see Scalzi make one possible with a future novel, though.

Business travel and some most welcome guests

Tuesday, May 20th, 2008

Ack, yeah, I know that my site was down for over a day over the weekend. It totally sucks. Thankfully, everything finally came back online, and without any data loss. Not that that’s stopped me from increasing the rigor of my backup plan by about two notches, natch. Yay for weekly rsyncs. But I digress.

I’m back in Phoenix again on business travel (see my previous musings on the topic), and hopefully I won’t get sick again this time. Naturally I was seated next to a guy who had a pretty bad cough on the flight in. I think I’m just fated for these kinds of encounters. And technically, I’m not in Phoenix, but in Scottsdale. It’s hard to tell the difference out here, because all the little cities just run into each other in a huge mass of ridiculous desert suburbia. You can only see so many road-side saguaros before you start thinking, “Really? That’s all you’ve got?”

There was a stroke of luck today though. Coming back to the hotel after work, we couldn’t help but notice that an entire bus load of hot Mexican chicks was checking into our hotel. Their luxuy bus had wrap-around advertisements painted all the way around, with the prominent text “Las Chicas Cazarones” next to an alcohol bottle (tequila?) on one side. So I think they’re in town for an alcohol promotion gig or something.

These chicks (and I can call them chicks without being offensive because that’s what the bus proclaims they were) were swarming the hotel. I didn’t take a single elevator ride with fewer than two hot chicks along with me, and they’re also occupying rooms on either side of me. They’re checked into this hotel for the entire week that we’re out here on travel. And judging by the skimpy clothing they were wearing during their off time as they checked into the hotel, well, let’s just say I’d love to catch them coming back from a gig wearing their official uniforms. I imagine the cleavage will be in play.

The big travesty here is that not a single one of them that I tried talking to speaks English, and alas, I don’t speak Spanish. Damn language barrier. Maybe it’s just as well. If they did speak English, they probably would’ve found it awkward when one of my coworkers was literally thanking God for this fortunate occurrence, out loud, in a cramped elevator … with two of them in it. At least one of them smiled at me.

So business travel does have its ups and its downs.

Pining for the coding fjords

Wednesday, May 14th, 2008

I’m deep into the third week of a technical writing project at work, and boy do I miss coding! It turns out there was a good reason I went into computer science in college and got a job as a programmer afterwards; I really am passionate about it. That feeling just gets lost when I’m doing programming that I don’t really find enjoyable (and let’s be honest: unless you work for a game company, and often not even then, the kind of programming you’re doing isn’t fun).

So I’ve started by writing some simple algorithmic programs in C++: linked list classes, binary search trees; you know, nothing spectacular, but not nearly as trivial as a “Hello world!” either. I just wanted a refresher on C++ because I haven’t used it in awhile. And boy did I forget some things! The programs were algorithmically correct on the first try (which is absolutely not something I would be able to do when I was first learning these data structures back in high school, so at least those skills stuck with me), but the syntax was horrid. Imagine a tsunami of syntax errors impacting a rain forest of pointer errors. Uh, yeah, something like that.

Pride being one of the worst sins in a programmer, I immediately looked up some C++ tutorials on Google to find out what I was doing wrong. I had missing semicolons at the end of class declarations (I forgot all about that quirk; Java doesn’t need them), I was missing function declarations (again, not needed in Java), and I was even accidentally passing a pointer to a function that really wanted a value by reference (don’t ask). But it wasn’t too bad; after a few minutes of cleaning out the errors, the program compiled successfully and ran perfectly on the first try. It was fun using pointers again after these past couple of years of not touching them. They’re fun in a masochistic kind of way. I think it has something to do with working closely enough to the hardware to be able to allocate individual blocks of memory and daisy-chain them all together. It’s cool when you think about what you’re doing.

These programs were still pretty simple though. I don’t have a real desire to make a much more complex project in C++, because it does start getting ugly after you’ve grown accustomed to the niceties of C#, Java, and Python, so now I’m off to code up a game in Java. I have a general idea of what I want to write, which I’ve already made allusions to, but I don’t want to talk more about it in case the nifty idea in my head utterly stumbles upon execution. It’s happened before, so I’ve learned the fine art of hedging.

After some preliminary research, I’ve decided that I’ll use the Lightweight Java Game Library (LWJGL) to code up what I have in mind. I don’t want to make the same mistake that I did back in college when we wrote the game A Day in the Bay for our four-year undergraduate research project. We wrote it from scratch in pure Java AWT (not even using Swing!), so we spent a lot of time reinventing the wheel, and to boot, our wheel wasn’t particularly good because it didn’t have any hardware acceleration*. I don’t want to have to spend so time much time doing performance optimizations this time around, so I’ll just use LWJGL and hopefully get to pure coding a lot more quickly.

Now unfortunately, it can be awfully intimidating first starting off with something as complex as LWJGL. Just look at their API; it doesn’t make much immediate sense even if you are a Java developer. This is the critical juncture where many people get turned off and decide to write something on their own (as we did back in college). This is a big mistake. It’s a lot less effort to learn how to use a new library than to essentially write it from scratch. So how do I learn a new library? Examples! And luckily, LWJGL has some awesome examples of fully-fledged games to peruse. Check out Space Invaders and 3D Asteroids. Using these as a reference, and then the API for other functionality not used by these sample games, I’ll have my game up and running in no time.

So keep your eyes peeled. I’ll eventually have some progress to report back on, and then at some point the fruits of my labor will be downloadable for your enjoyment. I’ve already set up my SVN server and committed a skeleton class file, so there’s no turning back! Programming that’s fun again, here I come!

*While we’re mixing metaphors this badly, I’ll just come out and declare that a wheel with hardware acceleration is an automobile. Or, you know, a motorized unicycle.

Going to the DC101 Chili Cook-Off today

Saturday, May 10th, 2008

Woohoo, I’m going to the DC101 Chili Cook-Off today. It’s been awhile since I’ve gone (maybe five or six years?). I wonder which will be better this year, the bands or the chili?

Post-concert update: All right, that was fun. Unfortunately, I cannot speak as to the status of the chili, because I just saw the live performances. I think my favorite was Finger Eleven, because they closed out their set with a Led Zeppelin and then a Pink Floyd cover. How awesome is that?! My friend that I brought along (Grokmoo from SupComTalk, if any of you are still following along) was kind of “meh” up until that point because he likes classic rock a lot more than modern rock. So finally there was something there for him. Hopefully his opinion of the modern rock acts will improve, because most of them like the rock classics just like he does.

Some of the other acts were kind of “meh”. Too much emo whining, not enough great rock. I actually didn’t pay a lot of attention to some of the songs because I was up close to the stage and I was constantly defending across crowd surfers crashing down on top of my head. The craziest thing I saw was a guy in a wheelchair crowd surfing. I didn’t even know that was possible, but it happened, and the guy was having an absolute blast.

After the concert on the Metro going home I happened to sit in the same car as a bunch of young people (maybe recently graduated from high school?) from Martinsburg, West Virginia. They immediately asked me if I was a local (I am), then proceeded to bombard me with all sorts of weird questions, like “Does the Metro always shake like this?” (he’d never ridden a train before; the answer is yes), and another guy asking if the train’s doors open at all stops (they do).

One of the girls who was with them was so freaked out by the whole Metro experience that she was having some kind of panic attack; she couldn’t stop shaking, and was grabbing onto a handrail really tightly. I guess it was the combination of the speed and being underground. Later, when we emerged from underground and were on a raised track above some local roads, one of the guys commented that he felt like he was flying. I’m guessing he’s never flown in a plane before, because the sensation of height wasn’t even close.

It’s interesting to get that perspective on the world. I’ve known there are many people who’ve never flown in an airplane, but I didn’t really pause to consider there would be better who’ve never taken trains before.