April 12, 2011

Plesk Error: Unable to update hosting preferences: hosting update is failed: object ID is invalid

If you get this error in plesk when you are trying to create a new domain, chances are you moved your /var/www/vhosts to a new partition or disk with more space, and you forgot to copy the .skel directory to the new partition.

December 14, 2010

PHP Snippet for the Day

Did you know?

As of PHP 5, you can easily modify array’s elements by preceding $value with &. This will assign reference instead of copying the value.

<?php $arr = array(1, 2, 3, 4);
foreach ($arr as &$value) {
$value = $value * 2;
}
// $arr is now array( 2, 4, 6, 8 )
unset($value); // break the reference with the last element
?>

January 6, 2010

Google Waves Best Use Cases – Wave – Lifehacker

Transportation: Controlling Air Traffic

James is a Traffic Management Coordinator at the Philadelphia International Airport Control Tower. He said:

My job is to reduce departure delays and to maintain an efficient flow of air traffic into and out of the Philadelphia International Airport. Currently we utilize a Google Spreadsheet to share real-time departure and weather issues, airport construction updates, and snow removal operations with the airlines and other interested parties. Im excited at the prospect of being able to embed real-time weather radar gadgets to provide users an up-to-the-minute graphical look at the weather. We currently use the chat feature on Google Spreadsheets but it appears that the more robust communication capabilities in Wave would greatly enhance our communication with the airlines. The ability to review conversations and data will help us to further reduce delays at Philadelphia International Airport. This will result in a savings of time for passengers, reduced fuel and operating costs for the airlines, and fewer complaints from both.

via Google Waves Best Use Cases – Wave – Lifehacker.

All I can say is: wow.  ATC on Google Apps? Nice.

June 18, 2009

Sorting Multiple Columns With MySQL

Ever wanted to sort your MySQL results by several columns?

SELECT * FROM orderspecs ORDER BY height, depth, width;

Now what if you want the columns to have different sort orders in the sub-sorted columns? No problem. Just specify the order for each column.

SELECT * FROM orderspecs ORDER BY height DESC, depth ASC, width DESC;

April 29, 2009

Setting an HTML element’s class with Javascript

I was pulling my hair out trying to figure out why I was getting a parse-error with this code… DUH!

document.getElementById('test').class = "test"

“class” is a reserved name, of course… So you access it with:

document.getElementById('test').className = "test"