S Anand

Making a Media PC

Two weeks ago, I pulled together a Media PC.

This has been a long-term ambition. I’ve always wanted to have a PC as the centre of all my media. To use it as a radio, TV, stereo system, CD player, DVD player, etc.

I finally did it, for just under 1000 pounds.

Media PC Setup

At the centre of the setup is my 42″ Plasma TV (LG 42PC1D). I was debating between a plasma and LCD TV. The differences, as I understand them, are:

  1. Plasma TVs have a higher contrast ratio. My LG 42PC1D has a 10000:1 contrast ratio. An LG 42LC2D has a 1100:1 contrast ratio. The Plasma TV is also brighter (1500cd/m2) than the LCD TV (500cd/m2).
  2. Plasma TVs are cheaper for a given size. A 42″ LCD TV costs about 5-20% more.
  3. LCD TVs are lighter. The only reason this matters for me is if I carry the TV back home to India. But the shipping costs are exhorbitant anyway. So I’d be better off leaving the TV behind. And the weight becomes irrelevant.
  4. LCD TVs consume less power. And my power bill is quite high. But I replaced most of the bulbs in our house with energy-efficient ones. Hopefully it will balance out.
  5. LCD TVs work better with computers. If you leave an image on a plasma TV for a long time, it burns on the screen. Screensavers become a must.

I finally picked the Plasma TV, but it was a borderline decision.

The TV is hooked to a Cyberhome DVD player with DivX and a Freeview receiver. The DVD player lets me watch DivX movies I download as torrents. The Freeview player gives me over 40 free channels for casual viewing. (I don’t watch enough TV to need Sky TV.)

I bought an Intel Pentium III Tower that I bought on eBay. This is my “media PC”. I hooked this up to my TV (which has a PC input), a pair of Bose Mediamate speakers (a gift from my brother-in-law) with excellent sound response, and a Labtec webcam.

Two other components I bought were wireless: a Microsoft wireless keyboard and mouse to control the system from my sofa, and a Linksys cordless Skype phone (with a speakerphone), so that I could hold videoconferences on Skype while on the sofa.

Having set this up, I’m truly beginning to appreciate the convenience of wireless appliances. Right now, I can do any of the above things without gettin up from my sofa. My laptop, phone and wireless keyboard are always just a hand’s reach away! Here are some of the things I’ve been doing (wirelessly):

  1. Videoconferencing. I leave the computer on permanently. My parents or in-laws call me on Skype. The cordless phone rings. I can answer Skype calls directly from the phone. When I pick up the call, the webcam turns on automatically. We can sit on the sofa and speak, while they see us. I can turn on the TV and see them through their webcam. It’s a full-fledged wireless video-conference setup.
  2. Listening to radio. I use my laptop to connect wirelessly to my media PC using Remote Desktop, start up WinAmp, and pick a Shoutcast channel (which has a decent tamil channel list). The sound comes through the Bose speakers connected to the media PC, and I can control the volume from any room, using my laptop.
  3. Listening to MP3s. Ditto, except I turn on a playlist on WinAmp.
  4. Watching online videos. I turn on the TV, use my wireless keyboard, and connect to Google Video. Most of the time, I watch recent tamil movies or Google Techtalks.
  5. Watching TV. (Live from BD and ShareVDO being some choices.)
  6. Watching movies. I actually use “low tech” to do this. I record DivX files I download on to a DVD, and play them through my DVD player (which recognises DivX). On those occasions that I download WMV files, I play them through the computer.

With this setup, it’s easy to do more cool things, like a Truman-show like broadcast (which Justin.TV already does).

SD Burman songs quiz

Here is the background music from SD Burman’s songs. Can you guess which movie they are from?

Don’t worry about the spelling. Just spell it like it sounds, and the box will turn green.

Scribd

Scribd is a document sharing site. Sort of like a YouTube for documents. In other words, a book-lover’s paradise.

User defined array functions in Excel

Many languages have functions to process lists (array). These functions usually return a list, so you can pass that to another list function. This chaining of functions is really powerful.

UNIX provides this sort of chaining capability. If I had a cities (with some repetitions) and I wanted to find out how many started with the letter ‘A’, I’d just type:

cat cities | sort | uniq | grep "^A" | wc
cat: types the cities.
sort: sorts the cities alphabetically.
uniq: finds unique cities (works only if sorted - that's why we had to sort the list).
grep: filters the cities. Only allows cities beginning with A.
wc: word count

To do this on Excel, the only way is to

  1. get the unique values. Data – Filter – Advanced Filter, and select “Unique records only”, “Copy the list to another location”, and select a location
  2. get the first letter. =LEFT(cell,1) returns the first letter of the cell.
  3. count the number of “A”s. =COUNT(range, “A”) counts the number of “A”s.

But ideally, I’d like a 1-line formula like

=LENGTH(UNIQUE(GREP("^A", range)))

Excel doesn’t provide these functions by default, but you can add them as user defined functions. Doing this lets you condense several cells into one. Instead of having to copy all your data into a set of unique values, and then adding a column for the first cell, the entire operation can be condensed into one formula.

I consider the following functions the a basic set for list processing.

  • LENGTH(list) counts the number of elements in a list
  • INDEX(list, n) returns the nth element of the list
  • GREP(string, list) returns elements of the list that have the string
  • UNIQUE(list) filters unique values
  • UNION(list, list) returns elements in at least one of the lists
  • INTERSECTION(list, list) returns elements in both lists
  • DIFFERENCE(list, list) returns the elements in the first list but not the second
  • REVERSE(list) reverses the order of the list
  • STRJOIN(separator, list) joins the elements of the list into a string, separated by a separator
  • STRSPLIT(separator, string) splits the string into a list, using a separator
  • MVLOOKUP(value, lookup, result) looks up value in “lookup”, and returns the corresponding MULTIPLE values from “result”

I created these UDFs. You can download the functions and play with them. Below are some tasks that you can do with them, that are difficult otherwise.

  • Get the file name from a path.
    =INDEX(REVERSE(STRSPLIT("\", filename)), 1)
  • Count the number of unique elements in a range.
    =LENGTH(UNIQUE(range))
  • How many common elements are there in range 1 and range 2?
    =LENGTH(INTERSECTION(range1, range2))
  • How many words are there in a string?
    =LENGTH(STRSPLIT(" ", string))
  • Get the smallest unique numbers in a range
    =SMALL(UNIQUE(range), 5)
  • Count the number of mismatches between two lists.
    =COUNT(Range1)+COUNT(Range2) - COUNT(INTERSECTION(Range1,Range2))
  • Get a list of mismatches between two lists.
    =STRJOIN(",",UNION(DIFFERENCE(Range1,Range2), DIFFERENCE(Range2,Range1)))
  • Count duplicate entries in a range.
    =LENGTH(Range)-LENGTH(UNIQUE(Range))
  • VLOOKUP multiple values
    =MVLOOKUP(A1,Lookup_Range,Return_Range)
  • Count the unique matches in a VLOOKUP
    =COUNT(UNIQUE(MVLOOKUP(A1,Lookup_Range,Return_Range)

This is a small sample. The power of list processing is phenomenal, especially when combined with array formulas. Download these macros and play with them!