What if I am 25?

March 29th, 2006

This year I am signing up for the World’s Greates Shave - a great Australian fund raising event to gather donations for Leukemia research and support.

During the sign-up, it soon became clear that I existed in a demographic that either was not eligable to shave their head for charity, or had been completely overlooked by the developers of the sign-up page of the website.

Imagine, for a second, that you are 25 years old. What box would you tick in the following list:

What if I am 25?

CSS variables

March 18th, 2006

While making a few changes to a stylesheet today, I found myself constantly reaching for colorzilla in order to remember the specific hex or rgb value I had used for a certain class. Not only that, having to do a find-and-replace to change all instances of #b3dca3 is a pain the the butt if all you want to do is change your colour scheme.

Imagine if at the top of a stylesheet you could define some variables.

var customGreen = #b3dca3;

Then, whenever you needed that colour in the stylesheet, you could simply write:

.someClass { color: customGreen; }

This would certainly save some time, as you would not have to remember the specific hex value of the colour you require for a certain class. I feel like I spend half my day scrolling up and down my stylesheets to copy and paste existing hex/rgb values from similar classes.

I realise something similar can be achieved using classes like .customGreen {color: #b3dc3a;}, but this would require adding that class to your markup, which is not really semantically ideal. What happens if you want to change your colour scheme to blue? You could change the one reference in the stylesheet and it would work fine, but your markup will have all of these nosensical classes of customGreen that are actually now blue.

What are your thoughts? Maybe this is something that should be available for CSS4. That way I might just be able to use such a feature in about 20 years time - if and when CSS4 is implemented (or even thought of for that matter).

Bill Gates concedes to Linux

January 11th, 2006

Windows Live injected!… at least according to an official microsoft website.

As you can see, Microsoft is stupidly using a query string to pass an error message. In case they fix this problem (which they no doubt will) I have added a screenshot to the right.

Absolute web development lunacy.

Update: The page has already been fixed.

AJAX browser detection

January 2nd, 2006

If you have ever stumbled across Rasmus’s 30 second AJAX Tutorial, then you probably have the code copied, pasted, bookmarked or memorized. There are however a few limitations in this piece of code, especially with the upcoming release of IE7.

The javascript uses a small function to detect the browser.

function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == 'Microsoft Internet Explorer'){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

Basically, if the browser has a User Agent of Microsoft Internet Explorer, then it is delivered an ActiveXObject rather than an XMLHttpRequest. This is fine for IE6 and below (actually quite necessary) but IE7 is set to be natively compatible with XMLHttpRequest, so we don’t want to be sending it ActiveX objects as well.

An easy way to overcome this is to use a browser compatibility check, rather than a user agent check, such as in the following example:


function createRequestObject() {
    var ro;
    try {
      ro = window.XMLHttpRequest ? new XMLHttpRequest():
    			new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) {
      ro = false;
    }
    return ro;
}

This checks if the browser supports XMLHttpRequest, and if it doesn’t, then and only then, it initiates the ActiveXObject. This is regardless of the user agent string being broadcast by the browser.

Obligatory warning: the above code has not been tested, and in fact has barely even been proof read, so it may not work without modification, but I am sure you will get the general gist of it. Also, Rasmus’s code has a few other failings, such as no provision for multiple xmlhttprequests, and issues with IE caching, so be warned.

Blink tags are phat

December 19th, 2005

Blink tags are phat

Open Office Easter Egg

December 12th, 2005

In any cell of a spreadsheet type =Game("StarWars") and a small Space Invaders-style game will appear.

Easter egg
n.
An undocumented function hidden in software that may or may not be sanctioned by management.

Stop New Mail Notifications in Bash

September 30th, 2005

This is going to be short and sweet.

Does it bug you everytime you use bash on your linux box (via a terminal-emulator, ssh or otherwise), and it echos new mail notifications every five minutes? Well, if you are signed up to some high traffic mailing lists like I am, you will know my pain.

Here is how you ditch those notifications.
In /etc/profile comment out the following (or change the y to an n):

# Notify user of incoming mail.  This can be overridden in the user's
# local startup file (~/.bash.login or whatever, depending on the shell)
if [ -x /usr/bin/biff ]; then
 biff y
fi

Another option is to simply stop your computer from running the biff executable:

chmod -x /usr/sbin/biff

NOTE: This will make system-wide changes for every user. If you want to make the change only for one user, add biff n to their .bash_profile and/or .bashrc. (Bash login shells use .bash_profile; bash non-login shells use .bashrc)

AVI + AVI + Linux = DVD

August 11th, 2005

This one is for the code vault, and for my own personal reference.

Situation:

  1. You have a movie you really like, but for some reason (such as being a dirty movie pirate.. arrrr!) the movie has been split into multiple files of <700MB for burning across multiple CDRs.
  2. You infact own a DVD burner, and as such, want to combine these files seamlessly into one, and burn it to a single DVDR.
  3. You are an uber-geek (in the eyes of your grandma) and use linux and are not afraid of using the command line

Using 6 simple commands you can successfully burn this movie to DVD without skippy playback or out-of-sync audio. Here’s how:

Continue reading »

Not Quite Genuinely Advantageous

July 28th, 2005

This is a rare post, straight from the trenches of Windows XP activation de-activation activism.

In the never-ending battle of anything-you-can-do-I-can-do-better, fought bare-knuckled between Microsoft’s finest anti-piracy gang, and those who seek to circumvent their attempts to force ‘product activation’ on the masses, another blow has been struck against Microsoft.

After months of planning and scheming, Microsoft finally rolled out yet another anti-piracy measure in the form of Microsoft Genuine Advantage only to have a workaround found within hours of its release.

For those that care to know, the tactics employed by these dastardly pirates are so simple it is almost embarrassing. Simply disable the ‘Genuine Advantage’ ActiveX applet once installed, and then… well… nothing. That is it!

To me this constant battle is a waste of time. Humans are an inquisitive bunch, and everyone knows that as soon as you are told that you can’t do something, the first thing you want to do is prove them wrong! I would even argue that Microsoft (and while I mention it, Adobe) have become their respective market leaders due not only to the value and usefulness of their products, but also the fact that they are so widely pirated. Think about it. By the time you are in a moral and/or financial position to legitimise your software, you are already accustomed to one brand, and more than likely you will purchase the very product that you had used for free for so long.

Fish gotta swim, birds gotta fly, and software activation/validation gotta be circumvented. It is the way of all things, and the sooner Billy Gates understands this he might realise that the funds used to (unsuccessfully) stop people copying his software might be better spent making said software any good in the first place.

UPDATE: BoingBoing has since posted another way to get around the validity check. Simply paste this into the address bar and press enter before clicking on Custom or Express:

javascript:void(window.g_sDisableWGACheck='all')

What happened to my Plesk Updater?

July 24th, 2005

I ran into this problem today when updating a client’s server to the latest version of Plesk.

Did you know that upgrading to >7.5.2 disables the ‘Updater’ button in the ‘Server’ section of Plesk?

I didn’t, but after a bit of head-scratching I found the ‘fix’. (NOTE: Not really a ‘fix’ as nothing was really broken - just disabled).

Anyway, enough of the banter, re-enabling the ‘Updater’ button again is as simple as one MySQL command:

mysql -uadmin -p`cat /etc/psa/.psa.shadow`
use psa;
UPDATE misc SET val='false' WHERE param='disable_updater';
exit

UPDATE: It should be pointed out that it is a bad idea to enable the updater if your plesk installation is running under Virtuozzo. Plesk running in a virtual environment needs to be updated via templates, not the control panel update feature, and as such is disabled for a pretty good reason. For more information, refer to the following link:

http://kb.swsoft.com/article_117_786_en.html