Tuesday, January 17, 2006

Client-Side Server Scripting

While many people think it is impossible to shift Server-Side Duties to the Client, it isn't! Apparently the group of people hired to write a web application for my employer (my full-time job that supports my pursuit of Woven Thorns Productions, not WTP itself) decided to do just that.

By using Java applets to write server-side applications, we are able to require that everyone use the Java Runtime Environment. No biggie, that is made for linux, windows, mac OS, and of course solaris. So I install it on my windows machine and on my Linux machine. The application works great in Internet explorer 6+ on Windows XP Pro, but does not work in Firefox 1.5 on Windows, nor does it work in Firefox 1.0.7 on Linux.

If the developers had used something such as PHP, ASP, Perl, or any CGI language, then this would be a non-issue, because the work would be done on the server side of things. Heck, they could even throw in some Javascript to make it look and perform the exact same way. But here's the problem, Javascript can be purified down to a simple, cross browser, cross platform language (minus a few Microsoft changes, which are easily tip-toed around) that will work on all versions of Firefox on all Operating Systems, as well as IE, Safari, Opera, etc. etc. All without having to add Java Runtime Plugins for each browser.

Why didn't we do this?

My only guess is money. Java developers connecting to Oracle Servers get paid better than PHP developers connecting to MySQL/PostgreSQL Servers. (Side Note: PHP can connect to Oracle Servers just fine, and can even be compiled to encrypt the database usernames and passwords)

So for all the Java developers out there, please continue making great, compiled, desktop applications for specific operating systems, but leave the internet alone unless you can garuntee cross-browser, cross-platform portability. I'm tired of being told to "view this page in IE". That's like saying you can't watch a black and white TV show because I have a color TV. If a standard signal was sent, I could watch whatever I want to.

Please, if you work on the web, don't do what is easy, or what is lazy, do what is portable. If your website requires something other than what is packaged by default with Firefox, Internet Explorer, or Opera, then please recreate your site.

Some examples of methods that defeat the purpose of web applications:
  • Java Applets
  • Flash-Only websites
  • AJAX-Only websites
  • Complex Table layouts
  • Any web content, CSS, Graphic, etc. geared for a single web browser.
Please, follow standards, and keep in mind that while most visitors are using IE on Windows, doesn't mean all of your visitors are. If I lived in a predominantly white town, I wouldn't let that influence me to refuse service to someone just because they are a minority. The same attitude should be taken to web applications.

If you want to target an operating system, create stand-alone applications. If you want to target anyone with the internet and a web browser, write standards-compliant, ADA friendly, server-side applications.

Saturday, January 07, 2006

Webserver Setup in Ubuntu

Tonight I will be taking my laptop with me to work on a website, but the place I am going does not have a secure connection to the internet available. (No wired connection, and only unsecured wireless)

Because I'm paranoid when it comes to security, I will be insalling PHP5, MySQL, and Apache2 on my Ubuntu 5.10 based laptop. Here's my steps:

2:37PM
Click on System>Administration>Synaptic Package Manager
Enter the Administrator Password. (normal users shouldn't be able to install/remove applications without a password)

Click "Search" and type in "php5" and click the "Search" button.

Check the box next to "libapache2-mod-php5" and click "Mark" on the popup window that confirms that I am okay with installing the additional packages required to get this library working. (Such packages include apache2, php5, openssl, and related items)

Check the box next to php5-mysql

Check the box next to php-pear

Check the box next to php5-gd

Click "Apply"
Review the changes and click "Apply" again.

2:42PM
watch as files are downloaded and installed

2:43PM
Review the window that confirms it downloaded and installed properly

2:44PM
Remember I need to install MySQL and run a search for "MySQL"

Check the box next to "mysql-server" and accept the additional packages.

2:45PM
Click "Apply" and confirm the changes by clicking "Apply" again.

Wait and watch as the files are downloaded and installed.

2:46PM
Follow the Postfix Configuration wizard:
Choose Local Only (since this is for developmental purposes only)
Accept the default mail name (we won't really be using postfix anyway)
Watch as it installs the rest of the packages we chose.

2:48PM
Click "Close" at the Changes Applied screen.

2:49PM
Because I'm a geek, I'm going to install PEAR DB, so I open up a terminal and type in:
sudo pear install db
(because I want the administrator to make pear install the pear DB package)

2:50PM
Open up firefox and type in "localhost" to make sure it all worked.

It Did!!

2:51PM
Download all the neccessary scripts from my FTP server that I will be modifying, so I can work on them locally, then set up a MySQL user for the script to use.

2:55PM
DONE!


In an 18 minute time span I was able to install and set up a webserver that has PHP5, MySQL 4, Apache 2, and PEAR::DB. I was also able to download my files from my FTP server using gFTP, a simple and elegant FTP client.

I'll post tomorrow how well it worked, and what issues I've run into with my rushed webserver installation.

Where the death of DVD should lead us

According to Australian news source, The Age, DVD is dead. And they leave open a question for what comes next. They, and many other sources, point to the standard HD-DVD vs. Blu-Ray battle, but I for one am holding out for option 3, which is actually coming on much quicker than I anticipated.

Digital video for download.

Before I jump into why, and if companies should trust users, I'd like to drudge up some recent bad press for the companies that would disagree with me.

As everyone by now knows, Sony Music has released a beefed up version of Digital Rights Management (DRM) that was essentially a rootkit. Without going too far into detail, I'll just say that it created a space on your computer that you did not have access to, but ran Sony branded scripts, such as those that would send information back to their servers every time you played their CDs. On top of that, virus writers found a way to exploit this rootkit and install viruses in a manner that you, nor your virus scanner, could remove them, all thanks to Sony's DRM.

This was all to keep you from being able to make a backup copy of your CD, as well as to keep you from listening to the music on your mp3 player, ipod, etc.

After Sony denied the existence of the rootkit, and denied the severity, it was made public on numerous websites, news articles, and television shows. Sony then agreed it was a bad idea and offered to replace all of the affected CDs by shipping out new CDs to the customers. While customers were waiting on the new CD, they were offered free downloads of the mp3 version of the songs. So in the end, Sony's outrageous method of DRM intended to prevent mp3's being made of their music caused them to release the mp3 version of their songs.

Had Sony offered free mp3 downloads for songs people purchased to begin with, customer satisfaction would have gone through the roof, and iTunes users everywhere would probably start buying Sony branded CDs. Instead, many people (including myself) are going to be very skeptical before purchasing a Sony branded CD, much less any audio CD that advertises DRM.

The solution:

The solution to this problem is simple. Allow owners of media content the ability to use that media content in any way they see fit, as long as they do not break copyright laws for their country. This means, do not copy the music or video and give it to someone else, there should be a license agreement to prevent this anyway. However, if you would like to copy the music or movie to your computer so you can stream it over your home network to all of the rooms in your own home, then by all means, enjoy.

Adding company-wide DRM policies that impact the playability and usability of a product will only cause bad press, more lawsuits, and possibly indigestion.

Unfortunately I have decided as a Christian and as a Business Owner to use only legal software on my computers, and I refuse to knowingly break any laws (and try my hardest to keep myself educated on the laws that are easy to break unknowingly). I say "unfortunately" because this means I must go return my DVDs as they do not play in my computer's DVD player. I was told I needed to purchase a DVD decoder in order to play the encrypted DVDs, but I was told this after I purchased a fairly large collection. It is also important to note that Windows based PCs and Macintosh based PCs are the only computer systems that have decoders available. This means Unix, BSD, and Linux users are left out in the cold.

I won't make this a Linux vs. the world debate, but considering the number of linux users has been nearly doubling each year, it does not make sense to prevent users from playing encrypted DVD video on this platform.

If you live in a country that allows you to break the encryption on DVDs for the purpose of viewing them, you can download various open-source DVD decryption libraries that are a sinch to install. Unfortunately, United States law prevents me from doing this on my laptop, because that wouldn't be fair to the company I paid so I could watch the movie they produced.

The only solution I see is for DVD decoders to be freely available for every operating system that supports DVD video playback, or to remove encryption altogether. And if we are removing encryption altogether, we might as well offer downloads for at least the 3 most popular Operating Systems.

By moving to a more standardized approach of media content distribution, we will be able to realize the technology corporations are struggling to support today, but without the headaches caused by DRM, proprietary encoding, and lack of respect for Fair Use rights in many countries.

Some interesting facts to think of while watching the media drool over new, yet proprietary, technology:

The encoding methods used to create DVD video has been surpassed by not only proprietary video encoding methods, but also by open-source and freely available encoding methods. XviD has better compression rates than DVD video while maintaining better video quality, and is free to use on any system, including future set-top players.

Plasma TV's have fewer horizontal scan lines than standard television sets. While they have larger surface areas, look nice and thin, and have better viewing angles than other large-screen TVs, they still technically have worse resolution and therefore worse quality than a standard $150 television.

Flat pannel computer monitors that reach resolutions of up to 1280x1024 are now available for less than $250 while most "HD-ready" sets are not even able to completely support the 1280x720 HD standard. A new standard, 1920x1080 is being pushed, and with high-end HD plamas reaching closer to 768 lines, the end result is a 1920x1080 image shrunken down to fit into a 1366x768 screen. That means some pixels are completely lost, but not an even number, so while it may not be overly obvious, you will be missing some of the picture on the $4,000 50" plasma when a $400 22" CRT monitor could accurately display up to 2048x1536.

If more money were spent on usable computer formats, we could start downloading movies at higher than current "High Definition" resolutions and play them on truly high resolution computer monitors (that could easily be expanded to a more enjoyable 42" if the demand presented itself). In the future, I see very few electronics being without standard computer parts, especially entertainment centers which are already seeing PCs as a valid source of media. Why pay a monthly fee for television shows on demand when you can purchase the show for $2 on iTunes the day after it comes out?

Why purchase a 1280x720 HD DVD that requires a decryptor, when current computers support much higher resolutions that don't requre extra software?