Saturday, February 19, 2011

The Length of a Calendar Day

Happy 2011! Hope you all have a great year.

Just for the record, I don't have any New Years Resolutions. I have minor modifications to my behavior that I intended to implement coincidentally on January 1st. That's totally different. Right? :)

But just how long *is* January 1st? While down visiting my friends and family over the holidays, this question was posed to me.

Now of course, the answer seems completely obvious. 24 hours. Right? Some might argue the day isn't quite 24 hours, given various rotation periods, or only considering hours of "daylight" etc. But in general, the length of day being defined by the Earth's rotational period is 24 hours. But that wasn't the topic of discussion, rather, this one referred specifically to timezones.

That is, given that different parts of the planet can register the calendar being different days at the same time, how long does *somewhere* on the planet register a specific day?

Take January 1st for instance. I celebrated New Years at 12:00 AM January 1st, Local time. My particular time zone is UTC-4 (aka GMT-4), so by the time it was January 1st for me, it was already January 1st for more than half the planet. So how long, in hours, did January 1st last from the first moment somewhere on Earth registered it, until the last place on Earth clicked over to January 2nd?

The Simple Answer

Let's imagine we break the Earth symmetrically by time zone:

In this simplified model, the day would first "dawn" in UTC+12. It would turn 12:00 am January 1st, 2011 first in UTC+12, then 1 hour later progressively across the planet. The interesting thing is what happens when you go the *other* direction, that is directly from UTC+12 to UTC-12. This is called the International Date Line and works like so, if you cross it traveling west, then the time remains the same but you increment a day to the date. If you cross it going east, the time still remains the same, but the date decrements a day. Thus, If it's 12:00 AM on January 1st in UTC+12, then it's 12:00 AM on December 31st in UTC-12. Using this, we can extrapolate a simple chart like so:


With this model, UTC+12 would be the first place it becomes January 1st, and it would last for 24 hours, the entire time it would be December 31st in UTC-12. Once January 1st in UTC+12 clicks over the January 2nd, the International Date Line tells us that UTC+12 is now January 1st, which it has another 24 hours as Jaunary 1st. The various time zones in between would have their day in between the two extremes, but we don't need to consider the overlapping periods to answer this question. Thus, in this sense it would be January 1st somewhere on the planet for a total time range of 48 hours. Kinda neat, huh?

But not quite...

The simplified model postulated above helps us to think about the problem, but isn't quite the solution. It implies that there are 24 equally distributed time zones (not including UTC), which isn't quite the case.

Granted, there are timezones that are not offset on the hour, UTC -3:30 (Newfoundland Time) for example. But these don't matter for this analysis, since they are still within the UTC+12 and UTC-12 extremes.

The problem is that UTC+/- 12 aren't necessarily the extremes. In fact, there are two additional time zones that need to be considered, UTC+13 and UTC+14. So indeed, UTC+14, rather then UTC+12, is the first place the day clicks over.

What does this imply for our analysis? Well, think about it this way, we've started that there's a total 48 hour window between the period the day dawns in UTC+12, then ticks over the next day in UTC-12.

But, by the time the day clicks over in UTC+12, it's already been that day in UTC+14 for two hours now. And so, we must add on these two hours to the 48 window for a grand total of 50 hours being the length of a calendar day.

Wow, 50 hours!

Indeed! Quite a bit more then the usual 24. However, there's still one other aspect we haven't considered yet: Daylight savings time.

The analysis presented above assumes that all timezones (by which I mean UTC offsets) remains the same throughout the year. This is of course not true. I'm currently in my local timezone of UTC-4, however, for a number of months throughout the year while DST is in effect, I'll in fact be UTC-3 instead.

Daylight savings generally follows a simple rule: Fall back, spring ahead. Thus, during the Fall/Winter months, you are in your "normal" timezone, but during DST, you are one more hour ahead then usual. This means that if you are west of the Prime Meridian, you get one hour closer to UTC (-4 becomes -3), and if you are east of the Prime Meridian, you get one hour farther away (+4 becomes +5).

How does this affect our analysis? Let's consider what this would do at the extremes we've established:

Standard | DST Offset
---------|-----------
UTC + 14 | UTC + 15
UTC - 12 | UTC - 11

This might not seem to affect our counts at all, and in this case, you'd be correct. We might be gaining an hour moving to UTC+15, but we're losing an hour off the other end, keeping the count to our previous count of 50 hours.

The interesting thing is that, while DST offsets us by an hour, not all places observe it. This creates a few interesting scenarios.

For example, presume that there exists a place in UTC+15 that does observe Daylight savings time, but a place in UTC - 12 that does not observe daylight savings time. The resulting effect would be that the UTC+15 and UTC-12 timezones were in effect simultaneously, in fact resulting in a 51-hour day.

Likewise, the opposite could be true. Imagine that there is a place in UTC+14 which does not observe daylight savings time, and that there were no places in UTC-12 which did not. This would cause us to run from UTC-11 to UTC+14 simultaneously, resulting in a 49-hour day.

My research so far however indicates that the only place I'm aware of using UTC+14, a country called Kiribati, uses UTC+14 all year round, so in fact never offsets to UTC+15. So unless I'm incorrect on that, or it changes in the future, we can rule out a 51-hour day.

In addition, according to Wikipedia with regards to UTC-12, there are in fact no human habitations in this timezone. Instead, the timezone is nautical only, observed by ocean ships which happen to be crossing through it. And I highly doubt that they bother to observe DST, or even if some did, that all would.

Thus, year round we likely have a UTC-12, which is the last part of the planet to observe a calendar day.

So even though DST could affect our analysis of a calendar-day length by an hour, due to the decisions of local (or non-existent) jurisdictions, they do not. At least for now, the length of calendar day observance remains at 50 hours, year round, regardless of local DST offsets.

Why Timezones?

To wrap up this post, a short discussion on why we use timezones at all. If you are Canadian (or even interested in the subject at all) you are likely familiar with the Sir Sandford Fleming Heritage Minute. Fleming was an railway engineer, who was fed up by the ridiculous "minute" offsets of various timezones between cities. This was because each various location liked to have noon the time when the sun was "overhead", making the setting of time as one traveled by rail very inconvenient.

So Fleming came up with a different idea: Standardized time. Dividing the world into roughly 24 equal sizes areas, it was now far, far easier to communicate times across the world and have them be relevant and make sense.

Although it took him some time to get it widely accepted and adopted, Fleming's invention of Standard time was nothing short of genius. It was likely as important as the railway and telegraph themselves in modernizing the industrialized world.

But Fleming only reduced the number of timezones. He shrunk the number back by a pretty significant amount, but didn't eliminate them completely. Why?

To me, the elimination of timezones would seem to be the next logical step. As a computer programmer, I can tell you that writing and dealing with software that needs to operate in different timezones can be challenging. You always need to be conscious of what time you are working with, is it local or UTC, how much does it need to be offset by, is it daylight savings time or not, etc. Doing comparisons can also be tricky, and since various programmers do things in different ways, sometimes cooperating between different programs and programmers just complicates things more.

Imagine that, if instead of having timezones, everyone on the planet simply used the single timezone, say UTC. The benefit of this would be that there would no longer be any ambiguity when communicating timezones across the planet. March 1st at 12:00 pm would be March 1st at 12:00 pm everywhere.

Locally, things might seem a little odd at first. For example, people in Greenwich might go to work at 9 am and get home at 5 pm, while people in Halifax might to work at 1 pm and get home at 9 pm.

But what real difference would that make? Sunrise would just "happen" to be at 10 am instead of 6 am, but so what? I dare say that if such a system were to be adopted, it would probably only take a generation or so, perhaps less, for everyone to become accustomed to it. I'm sure our biological clocks would adjust, same as they did for Standard time. You would still have to do some mental calculation offsets on occasion for specific things, but probably not as many.

Just look at the transition of most countries (US not withstanding) to adopt Metric over Imperial measurements. I, for one, certainly can't think or estimate in miles or quartz. I'm not too bad with inches and feet, but only because when I used to help my Dad with upholstery or construction, he made sure I read the measuring tape in inches. I do know my own height in both centimeters and mass in kilograms, and generally get pretty confused dealing with Fahrenheit.

But those are just my personal preferences. Getting international cooperation on such a scheme would prove very difficult, just look at the opposition Mr. Fleming ran into. And countries are far less willing to adopt such things even today.

Nevertheless, I think it's a neat idea with a number of benefits, even if its never actually adopted. What about you? What might be some other pros to such an approach? What might be the cons and downsides of it?

Leave your thoughts and opinions in the comments and below, and feel free to correct me on any of my calculations if you feel I made a mistake in my calculations on the length of a calendar day.

Best wishes, and take care!

Thursday, February 17, 2011

The future of computational devices?

Imagine, for a moment, the computer you're reading this post on.

What type of computer is it? Is it a traditional desktop? A notebook or a netbook? What about a tablet or a smart phone?

Your options on what you use to access information are continually growing, even now they are several times greater then they were just a few years past.

If you are on a traditional computer, say a desktop, what kind of specifications might it have?

A modern 2010-era computer, sold for a reasonable price, might have a set of specifications like this:

* Dual-core processor
* 500 GB Hard drive Storage
* 4 GB of System Memory
* 512 Dedicated Graphics card with 3D acceleration
* Multi-channel sound system

What sized box is your tower? Is it a larger, standard ATX-sized unit, or maybe one of the small form factors?

Whatever the size, I want you to imagine taking that desktop and shrinking it....continually smaller and imagine a computer with similar specifications, but with a form factor the size of your phone.

Sound crazy? Well, consider my own smart phone, a Nokia N900, with the following specifications:

* 600 MHz ARM Cortex-A8 CPU
* 256 MB System Memory
* 32 GB Storage
* PowerVR SGX 530 GPU supporting OpenGL ES 2.0
* Stereo sound system

Not too bad. In fact, as little as decade ago, those specs would probably have been fairly impressive in that desktop your on right now, wouldn't they?

Is it really that crazy that the technology in smart phones could approach the level of desktops? I don't think so.

Consider laptops. Not that long ago, people who chose laptops for the portability advantages they offered were forced to sacrifice the performance of desktop. This is no longer true, as laptops have reached complete parity with desktops in terms of the specifications and abilities.

Those of us today who continue to choose desktops mostly do it for form factor reasons, for example my high definition 22 inch display, full keyboard with number pad and mouse. Of course, these things can additionally be added to a laptop. Other uses for desktops over laptops might include, like myself, use as a DVR (more easily permanently connected to my TV and cable box) or the ability to have multiple disc drives and the like.

Nevertheless, choosing a desktop today is more about form factor and preference then specifications.

In fact, I dare say that while smart phones, net books and tablets continue to make leaps and bounds each year in the amount of power they offer, the traditional computing paradigm of desktops and laptops seem to have plateaued.

For example, why don't we commonly go our local computer stores and see 8 GHZ processors and computers with 48 gigabytes of memory? Are we finally seeing a plateau of Moore's law? Or is the slowdown more for marketing and business purposes?

In fact, one of the problems with sticking more and more transistors on a chip is that the damn things get too bloody hot. Who needs an Infinity-GHZ processor when you need to burn thousands of watts of power just to keep it cool?

Why, even the modest Athlon chips in my two previous laptops could get into the very uncomfortable (and dangerous) 80-90 degrees centigrade range. Had they kept with the numbering convention, I'm sure the slogan for the the Pentium 5 would have been, "Now, you can cook toast on it too!". On the other hand, the Athlon X2 250 processor in my desktop rarely gets above 30C, nor does the Intel Core Duo in my laptop.

But the fact of the matter is that we don't need never increasing clock rates and increases in memory to be happy. In fact, I remember reading an article several years back (that I unfortunately can't source) suggesting that the major chip manufactures such as Intel and AMD would soon stop trying to increase their clock speeds and instead focus on the chips they got: basically, trying to shrink them down and make them more power efficient. This a good thing, not just for your power bill, but for the environment too.

It seems that we are living this reality: Processors aren't getting faster, but they are getting cheaper, smaller, more efficient and multi-cored. We need this more then we need more gigahertz, because there is clearly a limit of diminishing returns. We don't need faster computers because we don't have applications (unless you are in the server or HPC market) that can use them. At least, not yet. Even my desktop with a modest 2GB of Ram runs circles around many computers of better specifications, DVR'ing, web browsing and play games at the same time. Of course, I use a far superior operating system then most :).

So what does that mean for the future of such devices? If laptops and desktops continue their plateau, and the smaller form factor devices such as smart phones continue their rise, will we eventually reach a point where they are all at parity?

It wouldn't surprise me. Likewise, it also wouldn't surprise me if the day comes when your entire computer system fits in your hands, and that's the only computer you need.

For example, imagine a smart phone 10 years from now. We'll consider this our speculative "super-device". It can be connected to a GSM or CDMA network, likely has wi-fi and cellular data capabilities, camera and GPS, plus also a large touch screen and optionally a physical keyboard. It can make calls, play the newest high-end games, browse the web, has storage in the hundreds of gigabytes, extremely fast data transfer and processing rates, and more.

What are the disadvantages of this device? Well, no body wants to stare at web pages on a small screen forever, nor do they want to type up their reports on a keyboard only a few centimeters big.

But wait! Picture another device, in the form factor of a laptop, with a large screen, full keyboard, optical drive and card reader, larger battery perhaps, etc. Except that this device is just a "shell", it has beauty but no brains. No processor, motherboard or memory of it's own. Instead, slide your smart phone into a receptacle and suddenly you can have an entire computer system ready to rock. Able to type reports, see movies and web pages on a larger screen, even play the latest visually stunning computer games.

But why stop there? Don't need a keyboard? Just provide a large touch screen dock, sans keyboard, for your smart phone with receptacle and suddenly you've got a fully functional tablet (or e-reader). Add a keyboard with no optical drive and you've got a net book.

Need a larger screen for those high definition movies/games, or want to use a printer? Just provide a small dock which is nothing but ports, for monitors, printers, keyboards, even DVR connections if you want, and there is your desktop.


The receptacle could also be integrated into cars, essentially taking over as the entire entertainment and communication system of the vehicle.

I fully feel as though this is the natural evolution of where technology is heading. But is it a good idea? What are some of the pros and cons of such a design?

Right now, I have three "computers" that I use on a daily basis. My desktop, my laptop and my smart phone. Each has it's own place in my technological arsenal. My desktop of course serves as my main "home" PC: it does my DVR'ing, plays games, lives as my music and media server, browses websites, check my personal email, Skype conference with my family and more. My laptop is mostly work oriented, it has all my work schedules on it, current projects, contact information, work email, etc. But I also occasionally use it when I travel for web browsing, watching movies, etc. My smart phone, while of course admirably fulfilling it's capacity as my only phone, also handles all my personal schedule, memos and todo's, plays games and browses the web, at 5MP doubles as my primary picture and video camera, and is a full Sat-Nav GPS device with voice guided directions.

I'd be lying if I said the thought of all those devices being combined into one, but each with it's own profile what I wanted to do at the time, wasn't appealing to me. It's easy to get into a state of 'digital fatigue' when you are surrounded by too much technology and want to simplify things, only to feel your current technology is unable to fulfill your needs in some form or another. Even I find myself wanting a tablet, net book, or second laptop, even though I can pretty easily convince myself that I don't really need them. And on top of that, I still have game consoles, several televisions, DVD devices, and so on.

But there is danger as well. Phones are of course designed to be robust, they have to be, being jostled around all day after all. There are significant dangers in putting all your eggs in one digital basket: what happens when your phone gets destroyed, damaged or even just lost?

This could have some pretty bad consequences. But there are other problems as well, for example, Vendor lock-in. Just because you buy your device from Vendor A, you shouldn't have to buy your shells from Vendor A. For such a system to work, the dock and protocols should be entirely open and implementable by all.

The idea of an "all in one" device capable of doubling as any computing device we have today excites me a great deal, though there are pitfalls that I seriously hope we can avoid in order to realize such a device.

There is one pitfall we might not be able to overcome: upgrade-ability. A properly built desktop can be upgraded endlessly, to the point where it is an entirely new computer. Laptops are also upgradeable, but to a significant less degree: the hard drive, memory, battery and optical drives are often changeable but good luck trying to upgrade the screen, motherboard or video card. Unfortunately, as the form factor gets smaller, the ability to upgrade decreases proportionally. Good luck trying to change the memory in that smart phone, or adding an optical drive to that net book.

To make our speculative super device, we want to keep two principles in the back of our mind at all times: longevity and recyclability. We've already made the assumption that the specifications of all devices types would largely plateau out, become equal. But I'm not saying that at this point technology growth would stop, merely that the growth of the three major form factors (desktop, laptop and smart phone) would all grow at the same rate. There will still be advances as people develop new technologies and find uses for them. So technology *will* advance, albeit and hopefully at a more sustainable pace.

I think these devices would need to have a long life span, technology sufficient to last as long as possible. And, when you are finally ready to get a new device, we need programs in place to reuse, resell or recycle the old ones, possibly even taking off from the price of a new device.

Could a device/system like this ever become mainstream? Companies such as Motorola are already taking the first step with their Atrix phone (though I've heard rumors the laptop dock is only available with certain plans...which doesn't bode well). Just imagine if a company, say Apple, announced tomorrow that they had a new iPhone that, with the right dock, could also be your iPad, MacBook and iMac? Would not flocks of people swarm out to buy it? I think so. And the other major vendors, Dell, HP, etc would all follow while Microsoft would probably try to slap Windows on everything. Unfortunately, it might not be in the best interest of these companies to work together, which would create a hell for consumers.

Ideally, I would like to see everything left as open as possible. I could go on for a good length of time on how I believe in the decoupling of hardware and software, but we shall save that for another post.

The only way I would like to see this happen is if people are in control of their own devices. For example, as a strong proponent of free and open source software, I'd want to be able to run my own operating system on my device, and still have my hardware work and interact with other devices. We can place extra security and encryption on the devices (biometrics, perhaps), to help prevent the devices from being compromised if lost.

The phone component needs to optional. We can add a SIM card slot onto the device, and hopefully, carriers and manufactures will allow you to hook up to their networks seamlessly. The phone itself would be little more then an optionally installable application on the device. Hopefully carriers would remove those ridiculous data caps on their networks...but I know that is likely little more then a dream.

What about dedicated uses of the technology? Like I said, my desktop doubles as my DVR, and my ultimate device that I envision will hardly be able to record television shows for me if it's in my pocket on the other side of town.

This could be where device "reuse" comes in. In any case, there are likely to varying types of devices with different hardware capabilities. So it's not that crazy that I could use an older one, or cheaper one properly configured for DVR use while my main device stays with me.

We may still end up with multiple devices, but the fact is that the flexibility and configurability of the devices would all them to act as any other device, which would ultimately reduce the number of simultaneous devices we need at once. And with things such as longevity built into the device, they would need to be replaced less often, while the form factor can no longer improve.

I think such a technology has great potential. It's reasonable to implement, and could revolutionize the way we interact with our devices. But is has pitfalls as well, aspects we need to carefully avoid and implement properly if want to be successful. Nevertheless, I believe it is likely where we are to be headed, hopefully it'll be more of a blessing then a curse.

Do you agree? Feel free to share your thoughts and feelings in the comments, and have a great day!

Sunday, January 30, 2011

Gandalf Vs Dumbledore: The Great Debate (Warning: Strong Language!)

Hello folks!

Read this the other day on the wonderfully funny Failbook and just thought it was too funny not to share. I paraphrased it slightly, but you can find the original post here. Special thanks to the fellow with the Batman(?) avatar.

Warning: Strong language!


































You have been warned.


Gandalf Vs Dumbledore

Lemme break it down for you. Dumbledore is pretty sweet. he runs a school where all sorts of crazy shit goes down. He has a bird that spontaneously com-busts and a pretty sweet office. Oh and he dies helping to save the world. No doubting: Dumbledore is pretty bad ass.

But then there's Gandalf

First, he finds the root of all evil, and lays out a plan to save the world. When he gets shit on by his buddy Saruman, he escapes by TALKING TO A MOTH, so that the moth can go get his buddy A GIANT FUCKING EAGLE to fly him off the roof of Saruman's tower. Then he hooks back up with Frodo and the gang. But wait, HE DIES. It is important to note however that he dies FIGHTING A GIANT FLAME DAEMON with a MOTHERFUCKING WHIP. Now, normally, dying would be a problem for most people.

FUCK THAT.

Gandalf just shrugs it off LIKE A BOSS and comes back to finish what he started. He also decided to update his wardrobe with some pimpin' white robes. Now fully pimped out, he tells everybody the plan then dips for a minute to handle some shit elsewhere, cause that's how Gandalf motherfucking rolls.

Then right when shit starts hitting the fan at Helm's Deep, he shows up WITH A GIANT FUCKING ARMY. Oh, and did I mention he shows up on the KING OF HORSES....RIDING BAREBACK?!?! So, not only does Gandalf have figurative balls of steel, he undoubtedly has ACTUAL BALLS OF STEEL.

Finally, after cleaning shit up at Minas Tirith, he peaces out and lets all the hobbits and humans enjoy a world PURGED OF ALL EVIL.

So, to recap,

Dumbledore: mentors the younger generation, sacrifices his live for the greater good.

Gandalf: Talks to animals, gives death the middle finger, constantly saves everybody else's ass, and then when it's all said and done, just leaves everyone else with all the spoils of war.

Gandalf WINS.

Saturday, January 29, 2011

LIRC module disable by update

Good evening everyone,

The other day I ran my system updates and one of the packages that got updated was a package called "lirc-modules-source".

Unfortunately, as a result of this update, my remote control and IR blaster was disabled.

Apparently, the kernel module I used for my infrared equipment, lirc_zilog, was removed in the update. The source file for the module was still available, but all traces of the *.ko weren't to be found.

In addition, I could no longer build the kernel module due to some changes in the newest Ubuntu version. I still intend to do some more research on *why* the update removed the module, but fortunately due to a very helpful blogger I found a very simple set of instructions to repair it:

* sudo bash
* apt-get remove lirc-modules-source
* rm -rf /usr/src/lirc-0.8.6/
* apt-get install lirc-modules-source
* cd /usr/src/lirc-0.8.6
* wget http://bobkmertz.com/blog-files/zilog-for-lucid.diff
* patch -p0 < zilog-for-lucid.diff
* dpkg-reconfigure lirc-modules-source

The last step will build the source and install the *.ko files. The original blog post can be found here with some more information, or if you are still having trouble: http://notepad.bobkmertz.com/2010/06/pvr-150-ir-blaster-on-mythbuntu-1004.html

I did this successfully on my HVR-1600 running regular Ubuntu 10.04. Full LIRC support returned after I modprobe'd the driver.

Otherwise, my MythTV-based DVR continues to work wonderfully. I'm making great progress on my complementary auto startup and shutdown problems I'm developing and will hopefully post them on line when they are complete. In the meantime, just wanted to pass along this info in case someone runs into similar issues! And also, it's a good idea to do a quick review of the system updates before you install them.

Protip: If you do see wonky behavior from any of your software after an update, you can review what packagers were recently updated with Synaptic. Just launch Synaptic and go to File->History and check the logs. This is how I ultimately deduced the culprit to the missing LIRC behavior.

All the best!

Saturday, December 25, 2010

Let people choose their aspect ratio

I can't count the number of times I've sat down to watch a movie with a friend or family member, and as soon as the movie starts, I hear "please tell me those black bars aren't going to be there the whole movie!"

Surely you are familiar with letter boxing. It's been evident on many movies watched at home since the early 90's (perhaps earlier, but I haven't been watching movies that long).

What causes letter boxing?

Letter boxing is related to something called the "aspect ratio". This refers, simply, to the ratio of the width of an image compared to it's height:

So if an image is 16 centimetres wide, and 9 centimetres high, then it is said to have an aspect ratio of 16x9. Often, for easy comparison, these are a reduced to a fraction of X:1, for example, 16x9 is approximately 1.78:1

When a movie or TV film is being produced, it is decided which aspect ratio it'll be filmed in. Three common aspect ratios (though by no means all), are 1.33:1 (4x3), 1.78:1 (16x9) and 2.35:1. Your TV screen also has an aspect ratio. Thus, letter boxing (which can be both horizontal and vertical) occurs when the aspect ratio of the picture your watching does not match the aspect ratio of your screen. For example:


TV content is generally filmed in 4x3 and 16x9 aspect ratios, while movies tend to be 16x9 or 2.35x1. TV and computer monitors are generally 4x3 or 16x9. Another popular screen size (especially on laptops) is 16x10.

I remember renting movies and watching them on VHS tapes. Just before the movie would start, you would see a friendly message on the screen stating "This film has been modified from it's original version. It has been formatted to fit this screen."

I never used to understand what it meant (though I also used to think the quick FBI warnings said "If you watch this tape backwards you will lose your memory") until my brother explained to me one time that "it means you won't get those stupid black bars on the top and bottom".

Later on, we began to rent more and move movies which had the so called "stupid black bars", and every shot, someone would complain about it at the beginning of the movie.

Usually however, once the movie began you didn't notice it as much, but that still didn't mean we liked it. In the early 2000's, the switch was made to DVD's which often, nicely, provided both "wide screen" and "full screen" versions, the wide screen usually referring to a 16x9 aspect ratio, and the full screen referring to 4x3. My Dad used to say that "wide screen" should be called "narrow screen" since half of it was missing. Some DVD's would even have both versions on the same screen, allowing you to choose on the disc. Eventually (around 2006 and much to my dismay) I believe DVD's stopped coming in both formats and came in wide screen only. And, 16x9 was rare, most DVD's were now only available in their native, filmed format of 2.35x1.

This meant that if you had a 4x3 TV, 2.35:1 wasn't just wide screen, it was really wide screen. You needed to upgrade your TV to a 16x9 model, just to lessen (but not remove) the letter boxing. When we had 4:3 TV's, you had to deal with 16x9 letter boxing, and when we got 16x9 TV's, you had to deal with 2.35:1 letter boxing! It's a no win situation, and getting worse with the advent of HDTV's (1080p/i is 16x9 in case you are wondering).

Now, not everyone (unlike my family members) hates letter boxing. Some argue that they prefer to see the movie as it was shown in theaters, as the director intended it, for artistic reasons. They argue that it's actually the cropping that cuts out "half the movie", and not watching it in "wide screen".

That's fine and dandy, if they want to watch the movie that way, let them. But personally, I believe in giving people the choice of aspect ratio they'd like to watch the movie in. And I think the solution to this is much simpler then you might think.

Solving letter boxing

It might seem like the only way to avoid letter boxing would be with some sort of projector, or having a TV of every possible ratio! But there are other solutions.

Many TV's now have the ability to "scale" the image. That is, they take the 2.35x1 image and stretch it to take up all of the 16x9 screen (or same with the 2.35x1 on a 4x3 screen). Personally, I don't like this option, as much as I dislike letter boxing, I dislike even more seeing the movie distorted:


Another option is cropping. Often, your player will have the ability to "zoom" in on the image. This can work to some success, but the problem here is that sometimes you cut out important things on the screen.


Some DVD's player support a "pan and scan" option which allows you to actually sweep across the entire image as it's playing, but I don't really want to have to manually control this while watching a movie either.

Couldn't we simply get them to agree?

Fat chance. There are multiple motivations for choosing an aspect ratio for a program or film, both artistic and financial. It's highly unlikely that we'll ever see an agreed upon aspect ratio for all video content. In addition, it's impractical to produce a different physical version for every aspect ratio. And even then, if you had the 4x3 version but decided later to get a 16x9 TV, suddenly your 4x3 version is obsolete.

And why should we? We're asking for the freedom to watch in the aspect ratio we wish. The creators, really, should be allowed to produce in any aspect ratio we wish. So how do we find common ground?

The solution is actually surprisingly simple, and, it's entirely software based. All we need to do is provide one copy of the video content, in whatever aspect ratio the creator wishes. Then, we use an automatic (on the fly) combination of zooming and scaling to nicely format the image into the desired aspect ratio to watch.

For example, let's say I'm watching a 2.35:1 movie on my 4:3 TV. Along with the single video file would be a text file that mapped what part of the image should be displayed at what time to my aspect ratio. For example, from 5:34 to 6:02 in the movie, the top left of the 4:3 "view window" should be 100 pixels down and 43 pixels over, then from 6:02 to 6:40, it should be 300 pixels over and 90 pixels down.

It's like the zoom method mentioned above, but instead of the entire film being zoomed onto the same spot within the larger image, the player would read from the text file and move zoomed section around the movie, seamlessly (e.g. during pans or transitions) to keep the most relevant sections in frame. Further more, this text file could be easily set up like a table, to have different mappings on my 16x9 TV for the exact same 2.35:1 source film (or have a different file for a different aspect ratio). In some extreme cases, we could also use scaling on parts of the image, but then add it with the zooming to prevent distortion.

Would be this be a lot of work to add to video content? I don't believe so, certainly no more work then doing a "full conversion" for a different aspect ratio like what used to be done. This is essentially the same thing as that conversion, the difference being in the old method the various "crops" were cut together to make a new version of the movie, since the electronics from the older analog display methods (VHS for example) weren't sophisticated enough for this. But with the age of digital media, this is entirely possible. The player merely needs to be updated to read from these cropping files and display the correct part of the source image.

And, as long as the protocol was open and usable by anyone, this could be a community driven effort. It only takes one person a little bit of time to cut their movie from the source into the aspect ratio of their choice, then publish it for others to use. Then, the next person searches a database for the "crop" file for their movie in their aspect ratio, feeds it to their player and watches away. Don't like the cropping decisions they made? Make your own, if you wish, then publish it for others to use. People could rate them and leave comments, which could ultimately result in a final "best" copy. Or, you can easily hit a button and, like magic, the original, non cropped version will play.

In fact, the cropping process itself might even be able to be automated with software (though I still like the idea of being able to do it yourself in case you don't like the decisions the software makes)

So there you go, a nice, laid out solution to matching aspect ratios between source images and display devices! No more letter boxing necessary. Will studios/equipment manufactures pick up on this idea? Perhaps not...but we can dream. It's certainly not an unsolvable problem, alas, for the time being we'll just have to muddle along.

Tuesday, December 7, 2010

Building a Ubuntu HTPC - Day ????

I've made tons of progress getting my HTPC in a fully functional state, I'd stay it's at least 85% done of the functionality I want. I just haven't been updating the blog...well these things happen :)

Highlights:

1. Sound "crackle" problems are now fixed. Turns out, when you modprobe the cx18 driver, you can select the tuner type. My HVR-1600 was a Phillips tuner of type 43. It had been just using some "default" tuner type which wasn't reading the audio input correctly. This also fixed ivtv-tune not being able to get high signal strength or pick up channels.

In short:

1. Create a file in "/etc/modprobe.d" called "cx18.conf" (as root)
2. Add the following line: options cx18 tuner=43 radio=0 (your tuner # may be different)
3. Save the file and restart. The module should now be loaded with the correct options and the cracking should be gone for good.

Reference:
http://www.linuxquestions.org/questions/showthread.php?p=4164862

2. Lirc: Lirc support is now fully functional, both blaster and receiver. You have to put your own lirc from source, and modprobe the kernel driver, but it should work fine.

The main recipe I got to work is here: http://ubuntuforums.org/showpost.php?p=9548142&postcount=9

Don't forget to modprobe the driver! You can add it to /etc/modules in Ubuntu 10.04 to have it load on boot.

Additional References you may find helpful:
http://www.blushingpenguin.com/mark/blog/?p=24
http://www.gossamer-threads.com/lists/mythtv/users/442250
http://wilsonet.com/?p=40
http://www.mythtv.org/wiki/Hauppauge_HVR-1600

I had some trouble at first getting the remote to work with MythTV. Make sure your lirc socket (e.g. /dev/lirc0) has a+rw permissions (e.g. chmod a+rw /dev/lirc0)

In addition, if you follow the instructions above, the lirc socket you connect will *not* be /dev/lirc0, but rather /var/run/lirc/lircd. This is what you must configure MythTV to connect to in order to get it to work. You can find a sample .lircrc file for MythTV here, and modify it to your needs. One thing I did is make an entry to start MythTV with the Go button:

begin
button = Go
prog = irexec
repeat = 0
config = "/home/jason/Scripts/startmyth"
end

The contents of my startmyth script:

#!/bin/sh
# Run MythTV front end on display 1
export DISPLAY=:0.1
mythfrontend

You can use the DISPLAY variable to decide what X-session you want MythTV to start if you use a Dual-Head setup, like me.

Also, you'll want to start the lircd daemon on start. Here's my start lirc script:

mkdir /var/run/lirc
/home/jason/Development/lirc-0.8.6/build/sbin/lircd --device=/dev/lirc0 --logfile=/home/jason/Development/lirc-0.8.6/build/lircd.log
chmod a+rw /dev/lirc0

To run as root on boot, add it to your /etc/init.d/rc.local

3. I've cleaned up the video output a bit. Using a longer, single cable has helped but there's still a bit of interference.

4. I'm working on getting a custom Start up and Shut down program working. I've done some tests with ACPI_Wake and hit seems to work, just nailing down the details with the mythtv database, similarly, I also working on a shutdown application to turn off the computer at points after recording. I should be posing back after I get them running!

Tuesday, November 2, 2010

Smallest of the Small

Disclaimer: This article is merely intended to be a speculative thought experiment, and shouldn't be mistaken for an actual research paper (in case using Wikipedia as my primary reference didn't already make that clear).


Throughout history, speculation on the fundamental building blocks of matter have been rampant within scientific curiosity. As early as 350-450 BCE, it was believed that all matter was made up of building blocks of four basic elements, Earth, Air, Fire, and Water. It was speculated that all matter could be broken down into these constituent 'elements'. Even today, though they may be a lot more elements listed on the periodic table, the idea is essentially unchanged. Matter consists of massive groups of molecules, which is subsequently made up of varying types of atoms (elements), which in turn consist of neutrons, elections, and protons, which are further subdivided into even more sub-subatomic particles, for example quarks and other types of leptons.


As of current understanding, quarks and leptons are the most elementary form of fermion (traditional matter) particles known. For a particle to truly have no substructure, it must be considered to be the most fundamental particle, the one from which all other matter is built.


It is only natural to ask the question, are these the most fundamental particles or do they have substructure? Quarks are not identical after all, they have different masses, charges, so is it not unreasonable to concluded they might be composed of yet smaller blocks? There have been many ideas on the existence of 'preons', particles considered to be building blocks of quarks. For our purposes here, we are going to indeed make the assumption that quarks do indeed have a yet-undefined substructure. Furthermore, what ever this substructure is, let's assume that it can furthermore broken into an n-particle limit, that is, subdivided and subdivided to a finite level of substructure. The question then becomes, what is the last level? What is the smallest of the small?


We are going to step into a thought experiment, and assume this fundamental particle exists, which we will simply refer to as Particle X. What can we infer about this particle? Assuming that it exists, a few properties seem to be logical extensions of it: 1) All of the particles are identical but unique; 2) They are infinitesimally small, most likely on the order of Planck Length; 3) They exist for only infinitesimal periods in time;


That is, the smallest particle would also be related to the smallest units of time, size, mass, as well as being zero-dimensional. Zero-dimensional you say? I know that can be hard to imagine, given that we normally experience a three dimensional physical universe. If it helps, here's how I visualize N-dimensions (borrowed heavily from arrays in my main vocation, with is computer science). First, imagine a single point, alone, in a vast void. Since there exists no other points, there's no reference with which to differentiate it from another, therefore if we were to try and give coordinates for it, there wouldn't be any. This is the 0th dimension. Now, imagine that we take an infinite number of those points and arrange them in a line. Now, we can refer to a specific point by giving a single coordinate, X if you like, it's position in the line. Using a single coordinate to reference it's position, this is the 1st dimension. Now, imagine that we take an infinite number of those lines and lay them parallel to each other, forming a plane. To refer to a specific point, we need two coordinates, the line it's on (Y), and the particle in that line (X). This is the 2nd dimension. Then, we take take an infinite number of these planes and stack them on top of one another, creating a cube of sorts, using a third coordinate (Z) to reference a single point, basically three dimensions. Then, we could take an infinite number of of these “cubes” and lay them “besides” each other, now using a 4th coordinate to differentiate between the various cubes, creating a forth spatial dimension, and continuing so on in that fashion for any number of dimensions we want.


Of course, an obvious contraction seems to rouse it's head. We assume that all of the particles would have to be identical, since, if two fundamental particles were different, it would imply that they have a substructure which differentiates them, and we've already said that our particle X is the last level. But if they are all identical, how could they possibly come together to form different higher level particles? That is, they would have to be both identical and unique, which doesn't seem correct.


There are two other aspects of Particle X that haven't been considered yet, namely it's location, and it's motion, or amount of energy. Gauge bosons are currently considered elementary bosons, or units of energy. There may in fact also be a fundamental unit of energy, in essence, possibly even grand unification energy, in analogy with the fundamental particle. Here is the basic model as I'm envisioning it: all fundamental particles are physically identical, for each particle is an associated unit of a unique amount of energy. It is the differing amount of energy which separates different particles. This is where we tie in another necessary smallest, size. What I propose is that the energy level of each particle is dependent on it's location in space-time, and vice versa. My speculation is that there could be a one-to-one relationship between a particle's location in time and space, and the amount of energy it has. This relationship isn't all that much of a stretch. An object will move in a vacuum so long as it has kinetic energy and nothing to interfere with that motion. If something collides with it, or slows it motion, its kinetic energy will lessen and become potential energy.


Consider the Big Bang. We might now think of it as an element of Particle X, with the highest possible energy level (the first location). As time went on, the energy level decreased. This corresponded to the initial expansion of the universe. For a useful analogy, think of cell division. The first Particle X's energy level decreased, creating more particle's out of one, whose level decayed into new particles, and so on. Each new 'generation' is associated with a unique instant in time. The individual energy level of each Particle X is different. That is, each moment of time is 'frozen' where each particle has a unique energy level. But if we were to examine a particle from our point of view, it would appear as though the energy of it was changing over time. The change in time however is relative, if we were to examine two particles, we would notice a consistent change in their energy over time (it should be decreasing), however the two particles would also have a different energy due to their location in space. The difference in the spacial component of their energy would remain the same (assuming they were stationary with respect to one another), relative to their change in temporal energy. So as the universe moves forward in time, the energy decreases, but stays the same relative to other particles in that instant.


So the property that differentiates one particle from another is it's location, and subsequently it's energy. If that were the case, what would allow groups of this particle to differentiate substructures or high structure particles that they form? Since the only property unique to the particle is its location or energy, let's infer that is the property we seek. In essence, it's possible that the differentiating factor is the difference in the collective energy of one group of Particle X's compared to another group. Since the difference in the energy level of two particles stays the same relative to one another over time, this would allow higher level particles to exist, over time. As an analogy, imagine we could take the average of the energy level of a group of Particle X. A certain group of particles may have a mean energy level, different from the mean energy level of another group of particles. For example, one mean may correspond to an 'up' quark, whereas another mean may correspond to a 'down' quark. Given this model, it is possible that all sub atomic particles develop in this way, which is how the most basic substructures are formed.


Another analogy for the location-energy relationship is that of electrons in an atom. It thought that the distance an electron is from the nucleus of an atom is directly dependent on it's energy level (see Electron Shells). That is, the more energy it has, the further from the nucleus it exists. It has also been conjectured, if not proven, that electrons may jump orbits without even moving through the space in between, which alone has spectacular implications.


So let's continue to extend this idea to our Particle X. The 'nucleus' in this case would be the center/beginning of the universe in space time, the big bang. The particles are like the electrons moving around it. Though in this case, it seems it may be more logical to have the situation reversed. The big bang was a massive amount of energy, so in order for particles further from it to have higher energy, it seems like we would be violating the law of conservation of energy. So instead let's reverse it: units of the particle have higher energy as we wind the 'universe's film' (like a movie film) backwards to the big bang, which was a single unit of the particle with the total amount of energy in the universe. Then as the universe expanded, the energy was divided among newly formed particles, which would still be continuing today. But to what end?


The ultimate fate of the universe would then seem to depend on these particles, whether or not the universe eventually contracts or expands indefinitely. Three outcomes are theorized, either 1) the universe doesn't stop expanding, and eventually the thermodynamic energy is equally divided in the universe (heat death); 2) The universe eventually contracts back to a single point; 3) The universe stops expanding but doesn't contract. It may be simply that the “evening out” of fundamental energy as I've describe here works out be the heat death described in the model.


So what happens when I move my hand though the air? Or more precisely, when any sort of body moves through space? In the model as I've described it, every Particle X should have a unique, fixed energy level. Over time, it appears to us that the particle's energy is changing, but staying the same relative to its spacial position. So how does something move, in standard kinematics, given this model? Imagine a ball being thrown, and let's pretend that we have an ultimate high resolution camera with which can take a photo down to the level of Particle X once every Planck second. If we were to analyze each photo, what would see happening to the energy level of each Particle X in the ball, as well as the air it is displacing? First, lets just consider the front end of the ball, without the air. Would our fundamental particle still be present in a vacuum? I would have to venture a “yes” guess, at the very least in the form of virtual particles. Indeed, the fundamental Particle X should permeate all of existence, there shouldn't be anywhere which can exist without it at a corresponding energy level. So either way, with the air or not, the particles in the ball should be displacing other particles just the same.


The balls moves through the air, but the particles can't move though one another. Obviously the particles in the air molecules are be displaced by the particles in the ball's molecules. Since location is depended on energy level, by changing the ball's location, the energy level of its particles must also be changing as a result of the movement. The Particle X's of the ball would either give up or accept energy depending on the direction of the motion (spatially, away from the universe origin point), but of course the precise energy level would always be decreasing, unless the ball was moving backwards in time. Energy level in the ball's particles are thus being swapped particle by particle with the energy of the air molecules it's moving through. Thus, any movement can be generalized as a particle by particle swapping this of fundamental energy among various Particle X's. This could also explain why there is a universal 'curtain' speed limit, for example if a Particle X took such an amount of time to swap an amount of energy with it's neighboring particle (in order to move), perhaps at the speed of light is the fastest this swapping could occur.


Keeping in mind that the preceding argument was all just a speculative thought experiment, if any of it were real, might it be at all useful to us? Assuming this idea is correct, at least in principle it could be useful, but the actual engineering would be extraordinarily complex, if at all possible. The idea is to create a device capable of artificially changing the energy of a group of these particles. With enough energy, we would be able to move an object to any point in space-time, instantly. We wouldn't actually be moving faster then light, in terms of classical mechanics, the mass was motionless the whole time, but rather it is more like a leap, much like the electron jumping orbits, without going through the space in between. Sound like a useful form of transportation? Additionally, we would be able to change the molecular structure of matter at a fundamental level, the ultimate recycling, since the substructure of a complex particle is just the differencing energy level. Whether or not the technology could practically exist to change the energy level of the particle is unknown, but there would be no shortage of applications. We change the energy of a particle all the time by simply moving an object, so what we want to be able to do is the opposite.


Though it also raises the question, if we could artificially change the location of a mass by changing its energy, what would happen to the mass (particles) that are already in the position where we placed the mass? We know that the total amount of energy is constant, so the most logical conclusion seems to be that, for instance, the energy needed to be added to a mass to move it would be directly subtracted from the energy of the place we are relocating it. Since location is dependent on that energy, whatever was previously occupying that point in space time would then take the place of the original object we wanted to move, in effect they would be swapped, without disturbing anything in between. For an example, imagine two cubes, A and B. We know the relative difference in the energy between them, so we know how much energy needs to be added to (or subtracted from) A to give it the location of B. When we apply it, the cubes would swap places, with the A cube taking the place of the B cube, and vice versa.


In conclusion, the 'fundamental particle' we have conjectured may actually be something already conceived, superstrings. Likewise, the energy level we have attributed to our particle may be the vibration of these strings, which is driven by what we have come to call grand unification energy. Let me reiterate, this is all just speculation. There is no experimental evidence for my ideas at the present time, though I feel this is a truly fascinating topic to explore. I've done my best to properly infer my conclusions logically, and hope you enjoyed my take on it. By all means, feel free to leave a comment and share your own thoughts as well.