contract IsContract {

    ////////////////////////
    // Internal functions
    ////////////////////////

    function isContract(address addr)
        internal
        constant
        returns (bool)
    {
        uint256 size;
        // takes 700 gas
        assembly { size := extcodesize(addr) }
        return size > 0;
    }
}
function isContract(address addr)
    internal
    constant
    returns (bool)
{
    uint256 size;
    // takes 700 gas
    assembly { size := extcodesize(addr) }
    return size > 0;
}

////////////////////////