Happy New Year

Although a bit hesitant at first, Ryan and I ultimately attended Sarah’s New Year’s Party in Citronelle. We arrived early to help her setup, Tiki torches and all. Festivities included a nice bonfire and live music, provided by local bands Riktashaw and Powderfingers. Partygoers trickled in throughout the night. I met a lot of interesting people, and though not everything worked out the way that I would have liked it to, one thing’s for sure: this party was a heck of a lot more fun than any ASMS Alumni Retreat that I’ve ever been to. With conflicting high hopes and low spirits, I now look forward to what next year will bring. Happy New Year, everyone.

Reverse a Linked List

I’m surprised at how often this question pops up on interviews and undergraduate exams in imperative languages. While there are many ways to reverse a linked list, the most efficient technique by far is the use of iteration and some clever pointer manipulation. The trick is to always keep track of the previous, current, and next state of the system:

Node *reverse(Node *x) {
   Node *current = x;
   Node *previous = NULL;

   while (current != NULL) {
      Node *next = current->next;
      current->next = previous;

      /* switch to new node */
      previous = current;
      current = next;
   }

   return previous;
}

In a non-destructive functional language like Scheme, we’re trick free and perform the standard recursive approach:

(define (my-reverse a-list)
  (if (null? a-list) '()
      (append (my-reverse (cdr a-list)) 
                      (list (car a-list)))))

And just for kicks, we conclude with a deep reverse, which reverses both lists and sublists:

(define (deep-reverse a-list)
  (cond ((null? a-list) '())
        ((list? a-list) 
         (append (deep-reverse (cdr a-list)) 
                 (list (deep-reverse (car a-list)))))
         (else a-list)))

The Perfect Home Theatre

The home theater platform is a rapidly evolving field that offers radical advances every few calendar years. So it’s important to not only invest in solid technology, but to also be able predict technology that’s here to stay against those that are dead on arrival. After all, a home theater system is an expensive investment; a little foresight can go a long way.

The perfect and affordable home theater system essentially boils down to the following logical components: display, source, decoder, output, and control. I’ll now examine each in detail, expressing some of my personal views along the way.

Display

The video display is by far the most important part of the home entertainment system. It’s also one of the most expensive components in the set of required equipment. Fortunately, if your video display requirements are limited to DVD, and you really don’t care to watch the latest episodes of Everybody Loves Raymond in stunning high quality, or you don’t care to connect an X-Box or another console system, then there’s a lot you can do to bring down the price. For instance, for pure DVD watching, a DTV is fine. But you’re looking long-term, it might be worth investing in an HDTV, which supports DVI and HDMI video connectors.

DVD Source

There’s enormous confusion about whether DVD video is progressive or interlaced. Here’s the one true answer from the DVD FAQ:

Progressive-source video is usually encoded on DVD as interlaced field pairs that can be reinterleaved by a progressive player to recreate the original progressive video.

For all intents and purposes, it doesn’t really matter. Basically, the DVD native format is either 480i or 480p, but whether the source is truly interlaced or progressive is a completely irrelevant issue, since the DVD player itself should be true progressive. What is important is that you purchase an anamorphic (16:9) DVD player with component video, or even better, both component and DVI outputs. Recently, HDMI has also been popping up here and there; the only major difference between DVI and HDMI is that HDMI uses a single cable for both digital audio and video. Even the best DVD players these days are only a few hundred dollars, so feel free to splurge a bit in this category.

A Quick Note on Aspect Ratios

Doom9 has some excellent information on this very issue, and explains how a 720×480 DVD video source can be displayed in full screen, letterboxed wide screen, and anamorphic resolutions.

Decoder

As Mike Shea is quick to point out, "there is a much bigger difference in the sound of speakers than there is in the sound of audio electronics." More importantly, the audio quality is a function of the audio impulse response of your room and plays a much stronger role than the number of speakers in your setup. Thus, if your media room is square, make sure that your receiver supports, at mimimum, Dolby Digital and DTS for a 5.1 speaker setup. If your media room is long and rectangular, rather than square, it’s probably best to invest in a 6.1 or 7.1 system, though admittedly most DVD videos are still 5.1, and 6.1 or 7.1 systems have rear mono output. Personally, I’d go with a 6.1 system, especially for smaller rooms. In such case, make sure your receiver supports Dolby Digital EX and DTS-ES. For a good mid-fi solution, Consumer Reports recommends the following:

Output

These are your speakers. If you’re building a new house, your best bet is to let the low-voltage A/V electrician handle this, since they’ll be able to put in the connections in the wall and mount them properly. It’s a pain to do after the house is already built, and this way you can avoid the unsightly wiring.

Control

If your media closet is isolated from the actual theater room, you’ll most likely need some form of wireless IR distribution. For usability and simplicity, it’s important to have a universal remote control. You’ll want a what is termed a learning remote, rather than a preprogrammed remote, for maximum flexibility. There are several excellent options in this area and you can find out more information from Remote Central.

Resources

Flashback

Merry Christmas, everyone. Haven’t posted in a while, but not because nothing has happened. An article proposal was recently accepted by Dr. Dobbs: Software Tools for the Professional Programmer, and it should be a lot of fun to write. I hope it goes through. Eyeing the C/C++ Users Journal next, though I’m still deciding on article topics. In the meantime, I’m spending Christmas with friends and family in Florida, in a city of perpetual rain, eating good food and playing computer games.

Computer Modern Font

When generating PDF files in Linux through LaTeX, it’s sometimes necessary to edit or postprocess them on another platform, for example, when using Adobe Illustrator or the official Acrobat Acrobat software on Windows. Since Windows does not provide the necessary fonts out of the box, one must download and install Computer Modern and AMSFonts in Type 1 form. Since I always have difficulty finding these fonts when I need them, I’ve made a short post in my weblog as a reminder. The fonts are freely available for general use.

Web Design Weekend

Well, this weekend has been quite inspirational but now it’s officially over. Today I finished up the remaining touches to the site. There’s a new navigation menu in the top pane that utilitizes horizontal lists and some CSS to do its thing. A lot of effort has also gone into bringing the colophon up to speed, content-wise. I signed up to be an Amazon Associate in order to use the CD and DVD images from their site. Finally, I joined the Spread Firefox campaign, and published the site under the Creative Commons License, as evidenced by the banners on the left navigation pane.

On the business logic side of things, I’ve once again started to experiment with Smarty caching. I had a few glitches using this a few months ago, but I think I’ve gotten all the issues resolved this time around. Rather than blindly using a cache lifetime, Smarty should now intelligently regenerate a page if a journal entry is modified.

Aura Layout

For reasons that I will never understand, Chuck decided to work on a new layout for his web site and dragged the rest of us, including myself, into a weekend of web development. I often like to think of my web site as a constantly evolving work of art that not only reflects my professional advancements in the field, but also communicates, to a certain extent, my personal growth as an individual. Let me know what you think.

Adobe Reader SpeedUp

I’ve always been a big fan of the Adobe PDF format. It’s open, ubiquitous, supports form data, and beats most other document exchange formats hands down. That’s why it’s a little depressing that Adobe’s latest incarnation of the Acrobat Reader is so excruciatingly slow. Thankfully, Joseph Cox’s Adobe Reader SpeedUp comes to the rescue, and once again turns the Acrobat Reader into the speedy application that we all know and love. In a nutshell, it accomplishes this by removing all non-essential plugins when Acrobat is loading. There are also options to restore the original configuration if necessary. While it isn’t new news, I’m posting this because there’s still a quite a few people out there who don’t know about this handy little tweak. Thanks go to Ryan for pointing it out.

Posted in Uncategorized | 1 Reply

Flashback

Web site development has left little time for much else this week, but the project is nearly finished. As far as my personal projects, I’ve been making a bit of progress here and there, though there’s still a lot to cover before I’ll really be able to do anything useful with the Mozilla Framework. The experience, has, however, given me great insight on how XML, CSS, and other technologies can all come together for what I honestly think will become the future of cross-platform application development. I used to believe that XML was just a buzzword, and recently I’ve been finding out just how wrong I was.

And as is typical of a computer programmer like myself, another one of my keyboards have gone out due to heavy abuse. It was just about that time of year anyway. I’ve already ordered another surplus batch, and they should arrive within the next few days. In the meantime, check out Newsmap, an application that visually reflects the constantly changing landscape of the Google News aggregator.