Javascript – Is an Object Empty?

To check if an object is empty in Javascript:

Object.getOwnPropertyNames(obj).length === 0;

Where obj is the object you’re testing e.g.:

var obj = {};
Object.getOwnPropertyNames(obj).length === 0; //true
obj = {'not' : 'empty'};
Object.getOwnPropertyNames(obj).length === 0; //false

Or to wrap it in a function:

function isEmpty(obj){
    return (Object.getOwnPropertyNames(obj).length === 0);
}

This only works in ECMAScript 5 compatible browsers, so is useful when developing mobile / desktop web apps.

UI Guidelines for Common Mobile / Tablet Apps

Mobile Web Programming have a nice list of official UI guidelines for popular devices, which is pretty cool as I can’t stand apps that don’t follow the expected design patterns.

Have a look – UI Guidelines for mobile and tablet web app design

They’ve missed out the Windows Phone 7 UI Design and Interaction Guide

Site Seeing – Week Three

Css Desk – An Online CSS Sandbox

http://cssdesk.com/

A great web app for playing around with HTML and CSS in the browser, would be interesting to see if it works on the iPad.

Pictaculous – A Colour Palette Generator

http://www.pictaculous.com/

Pictaculous (from MailChimp) lets you upload or email a photo and then generates a colour palette from it. You can email (color@mailchimp.com) straight from your iPhone and get a reply complete with your colour palette results. It also suggestion palettes from kuler and COLOURlovers.

A Comparison of Dedicated Servers By Company

http://www.intac.net/

This chart from Intac shows the ridiculous amount of servers Google are estimated to have:

Chart showing the comparison of dedicated servers

Who owns the most servers?

You made it this far, have a song – Metronomy – You Could Easily Have Me (spotify)