H.264: A in dent Firefox’s progress

Firefox is showing his teeth by Ben Fredericson

Firefox is showing his teeth by Ben Fredericson

Firefox’s progress has been quite steady since its’ first releases. I remember downloading one of the first alpha version to try it out. It was rough but it was on a good track.

Today, Firefox has a lot of competition for the top spot. Opera, Google Chrome, Safari and even the upcoming Internet Explorer 9 are coming to bite back. However, I believe the biggest challenge Firefox will have to overcome is H.264.

H.264 is a highly popular video codec. It was created in collaboration with the MPEG group. It fits into the long saga of video on the web and HTML5 which itself fits into another long story about the evolution of the HTML standards and the evolution of the web.

To put it in context, a group of people interested in the evolution of the web decided to propose a new version of HTML, the base language on which web pages are built on. They called it HTML5. One of the goals of this group was to introduce standard facilities for video on the web. An open way to put video on the web without having to rely on external proprietary plugins like Flash. After specifying an HTML tag to fulfil this goal, they discussed which video codec would be needed to play those videos. After a long and much passionate discussion, the group came to the conclusion that it would be better not to make any video codec mandatory for any browser. Just like there is no mandatory image format that a browser must support in the web standards, there would be no one for video too.

Left in the hands of those who build browsers, two groups quickly emerged in the political video codec movement: those in support for an open, free and without licensing fees video codec and those in support for an already well established but proprietary with licensing fees video codec. Firefox and Opera sided with the open group while Safari and recently Internet Explorer sided with the proprietary group. Ogg Theora is currently the open group video codec and H.264 is the proprietary video codec. Google Chrome did not choose a group and implemented both video codecs.

There are many difficulties that Firefox will go through if it does not implement H.264. The proprietary video codec is rapidly gaining traction, momentum and popularity. Many high profile video web sites are currently using it with their Flash video player. It is simply natural for them to keep using it with HTML5. Many video experts say that it is superior to the Ogg Theora alternative. There is already a widespread of hardware decoding components for H.264 making your iPhone battery last way longer when viewing H.264 videos.

Even with these difficulties, I believe it would be a bad move for Firefox to introduce H.264. It would be a dent in the open web standards by establishing a proprietary component as a norm on the web. It would be a first step towards a less open web space with all the consequences that could follow.

If Firefox does not implement H.264, that might not stop others to put H.264 in Firefox. Recently, Canonical, the Ubuntu parent’s company, has been offering OEM the option to license H.264 with their new computers that come with Ubuntu pre-installed. This could theoretically means that an OEM could sell you Ubuntu with a modified version of Firefox with H.264 in it while being 100% legal. A few days ago, a new project called Wild Fox was created with the intention of offering a modified version of Firefox that includes H.264 for all those countries where the H.264 patents are not enforceable which exclude USA and South Korea.

A wild card in this video codec battle is VP8. It is a video codec that Google obtains by acquiring the On2 Technologies company. Google is suppose to announce the open-sourcing of the VP8 codec at their Google I/O conference either tomorrow or thursday. VP8 should be superior to Ogg Theora. It would counter the weakness argument given by those who choose H.264 over Ogg Theora for its’ image quality and performance.

Let’s hope Firefox can go through these H.264 related problems and prosper like it did in the recent years.

Updates: Google confirmed today the open sourcing of VP8 along with another project called WebM to create a video container for the web. This is some great news. Mozilla and Opera joined the WebM project and are already working on it.

Stop caring too much about how your site looks

The perfect woman by Jeremy Levine

The perfect woman by Jeremy Levine

I know many people who want their website to looks exactly the same across all browsers. They want absolute consistency like mad people think they can walk on water. These people should stop caring too much about it because, mainly, it is impossible.

Since I started this blog, I have been looking how it looks like on different browsers and platforms. I have noticed the font is a bit smaller on a default Ubuntu installation. It does not display that well on the BlackBerry browser. Do I care? Not much.

I could work a little to make it display nicely on the BlackBerry but it would not be worth it. I do not have any visitor on my website using the BlackBerry browser. I have a few iPhone browser visit, somewhere around seven visitors in the last year. Even if I had that much BlackBerry, I do not think it would be worth it anyway. BlackBerry is more associated with the businessman type of person. They are not the kind of people who would read my blog anyway.

Different operating system are using different font rendering engine. Different browsers are using different default margin values. Managing absolute consistency is a a great walk into hell. Do not go over there. Instead, focus on what people want: easy access to content. Focus on what is technically feasible: degrade gracefully.

Books to learn

A huge stack of books by austinevan

A huge stack of books by austinevan

There is two kind of software developers: those who are still learning and those who stopped learning. Please do not be the later. If you want to stop learning, at least wait until you are old. Wait until you are really old. Wait until you are obviously old, like cold dead. Software development is not really for living people who do not want to learn.

Since I completed my degree, I choose to not to be the kind of developer who stop to learn. As a matter of fact, I have been buying around ten to twelve software development related books per year on average since I left the university. Not only did I buy them, but I read them all.

I have started buying the really good ones recommended by most people like Code Complete, Rapid Development and The Mythical Man-Month. Then I moved into the less but still highly recommended books. I am now starting to exhaust most obvious recommendations I can find on the web. I also have another problem which is space. I do not have much space left in my office to store them all. I will have to buy another bookshelf in a few weeks to make some room.

Books are not all made equals. Some of them are quite thick and dense while others are a few pages long with big pictures in them. Some of them gives a better chance at learning to your brain while others are not forgiving. This brings me to the Head First series.

The Head First series is designed to make you think and remember stuff you read. This is plain and simple. Let’s take the design patterns books example. In one corner, you have the official reference: Design Patterns: Elements of Reusable Object-Oriented Software. This is the book that mostly started the design patterns’ field. In the other corner, you have Head First Design Patterns. Both of these books will teach you about the same thing, but you will learn more and, most importantly, you will remember more with the Head First one. If you have only one book to buy, get the Head First one. If you have the money, I would suggest you would still buy and read them both.

How you can learn more with the Head First books? It is well explained in the book, but to summarize it, it is full of pictures, it makes you feel and it repeat the same stuff in different ways. You can check out the Head First website to learn more about it.

Since I have the money, I usually buy many different books on the same subject to have different points of view. You can do the same, but if you do not, you should have a serious look at the Head First books.

Drupal development team setup

Recently, I had to find some ways to setup a Drupal development team with many developers working in different locations.

I searched the web and I asked a few questions in the Drupal help channels, but I did not find anything or anyone with a good environment setup for how to develop a Drupal application with a team. Here is how I would setup such an environment.

First, you need a good version control system to track changes and share them in the source code. Use the one you know and focus on it. If you want a very good one, have a look at Mercurial. Than you need a good bug/issue tracker. There are plenty of them of various quality. Use the one you know and stick to it. You need it because you know there are bugs. They never miss a chance to show up at the party.

Next, you need some local hosting stack to develop and debug your application that can run Drupal. If you are on Windows, I suggest you have a look at XAMPP. It includes all you need to get Drupal up and running in no time including Apache, PHP and MySQL.

I am a big fan of the development principle that says that each developer should be able to screw up his development environment if he wants to. This means that each developer should run the whole application on his PC. No code directly shared on a server somewhere and no shared database. This way, one developer making a part of the application crash will not impact another developer.

With a good VCS, it is easy to manage code changes from one developer to another and share them. Managing database changes is a much harder task. What we have been doing is to use file that contains the full database and a virtual lock on the database. We had a ticket in our issue tracking software that was associated with the lock. Whoever was assigned to that ticket had the access to modify the database. Whenever he was done, he would put it back to unassigned and someone else could take it to do some database changes.

The database virtual lock is a good comprise in my opinion for Drupal. There are many other ways this could be done, but because of the way Drupal works with some of the common modules, a change in the database administration section of the application can have multiple impacts in different tables. Tracking those changes would be painful and error prone.

Another important point to have is a good editor with PHP support. Eclipse with the PDT pluging is a nice choice.

Finally, if you are to start any Drupal project, I suggest you have a look at Pressflow. It is a 100% compatible fork of the Drupal core that includes some of the most interesting features you could not find elsewhere.

Automating my PC maintenance tasks

Automate it by Gastev

Automate it by Gastev

Recently, I automated a few of my deployment processes. They were taking too much time to do and they were frankly boring. I managed automate everything including the database backup, putting the site in maintenance mode, creating the file package, sending the file package, extracting the file package on the server, preparing the database package and sending the database package.

Back at home, I was still doing my manual PC maintenance tasks. I finally got tired of it. I decided it was time to get productive and avoid those boring tasks.

There is two maintenance tasks I was doing regularly that needed more attention: defragmentation and backup. I started by looking for some usefull tools. For backup purposes, I did a few searches and I found that rdiff-backup suits all my needs. It is open source, built with Python, I can easy extend it if I need it and it is free. For defragmentation, I went to one of my favourite freeware site and found Auslogics Disk Defrag. It is free and includes a command line version. This is all I needed to get started.

Next comes the when. I asked myself when was it the most appropriate time to run those maintenance tasks. The best answer I could came up with was when I am not using my PC. Obviously, the PC has to be running to execute those tasks. I also wanted to run those tasks once a day.

I started to look at finding some idle time on my PC. Should I run those tasks when my screen saver starts ? When does my screen saver actually starts ? What is an idling computer ? I started to dig at that definition and I found out there is no definitive answer on that. There can be no interactive activity on my PC (i.e. the mouse is not moving and there no key strokes) but that does not mean there is no background process using all the CPU, memory, disk IO and network. I would not want my maintenance tasks to start at that time.

After that, I though about how I use my computer. I usually turn it on sometime after I come back from work and turn it off before going to sleep. A good opportunity to run those tasks would be just before it turns off. I found out Windows has a mechanism for shutdown scripts. I added my scripts there.

A few days later, I had to let my computer turned on for more than one day. It stroke me as a lightning. If I am leaving my PC turned on, my maintenance tasks will not be executed. I added a scheduled task to start my maintenance script at 4:50AM. Since I am usually not in front of my PC at that time and I do not mind the resource usage involved, I think it is a good compromise.

This sums up the process I went into to try to optimize those automated maintenance tasks. There is still one minor problem with this setup. Sometimes, I want to reboot my PC for some updates and I do not want to run the maintenance tasks. If you know a way to detect a reboot in the shutdown scripts or to add a switch somewhere in the shutdown process that I can detect with my scripts, let me know.

For your information, here are the batch scripts I am using.

set MYDEFRAGPATH=C:\Program Files\Auslogics\Auslogics Disk Defrag\cdefrag.exe
set DEFRAGLOGFILE=C:\Program Files\Auslogics\Auslogics Disk Defrag\daily-defrag-logs.txt
set DEFREGLOGHTML=C:\Program Files\Auslogics\Auslogics Disk Defrag\logs
echo ************************************* >> "%DEFRAGLOGFILE%"
echo Shutdown Daily Defrag: %DATE% %TIME% >> "%DEFRAGLOGFILE%"
echo ************************************* >> "%DEFRAGLOGFILE%"
"%MYDEFRAGPATH%" -c -log:"%DEFREGLOGHTML%" >> "%DEFRAGLOGFILE%" 2>&1
set BACKUPLOGFILE=D:\Backups\logs.txt
set RDIFFBACKUPPATH=C:\Program Files\rdiff-backup-1.2.8\rdiff-backup.exe
echo ************************************* >> "%BACKUPLOGFILE%"
echo Shutdown Backup: %DATE% %TIME% >> "%BACKUPLOGFILE%"
echo ************************************* >> "%BACKUPLOGFILE%"
"%RDIFFBACKUPPATH%" --force --remove-older-than 1M "D:/Backups/Documents and Settings"
"%RDIFFBACKUPPATH%" --exclude "C:/Documents and Settings/MyPC/Mes documents/Downloads" "C:/Documents and Settings" "D:/Backups/Documents and Settings" >> "%BACKUPLOGFILE%" 2>&1

Being lazy

Alright, so I have been lazy lately. Very lazy. I have not posted on my blog for a while. I did not do all those nice projects I wanted to do. I did not help with those open source projects I wanted to help. I feel bad. I have not put much time into making sure the only public project I have, yaCAPTCHA, is working properly with the latest stuff. I feel ashamed.

I am going to blame games for this. I got three games for my birthday. They are all long time consuming RPGs including Dragon Age Origins which is the best time sink I have had. I was mad when I made those suggestions. I should not ask for game as gift anymore. One of my friend got crazy with online poker and I felt in the trap. You shall not waste time with games is my new motto.

In order to redeem myself, I will be fixing this bug with Open Office. It makes my girlfriend go crazy and the last thing I want is having two crazy people living together like this. My real quest is set. Let me open the quest book and see how to get this thing started.

My first though was to develop this fix on Windows, but when I saw how difficult it was to setup a build environment on Windows including all the messy stuff I would need, I decided I will do it on Ubuntu. I am now setting up a virtual machine to do this.

I hope I can keep the focus and complete this.