Monday, August 6, 2012

jquery 1.7.1 and IE8

jQuery 1.7.1 running on IE8 fails when trying to call the focus method on elements while opening jQuery UI dialog.

In  jquery-1.7.1.js, function jQuery.event.trigger (a method of jQuery.event) begins with:

    trigger: function( event, data, elem, onlyHandlers ) {

        // Don't do events on text and comment nodes

        if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {

            return;

        }
and ends with

            // Call a native DOM method on the target with the same name name as the event.
            // Can't use an .isFunction() check here because IE6/7 fails that test.
            // Don't do default actions on window, that's where global variables be (#6170)
            // IE<9 dies on focus/blur to hidden element (#1486)
            if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
                // Don't re-trigger an onFOO event when we call its FOO() method
                old = elem[ ontype ];

                if ( old ) {
                    elem[ ontype ] = null;
                }

                // Prevent re-triggering of the same event, since we already bubbled it above
                jQuery.event.triggered = type;
                elem[ type ]();
                jQuery.event.triggered = undefined;

                if ( old ) {
                    elem[ ontype ] = old;
                }
            }
        }
    }
    return event.result;
},


In the last bit, change


elem[ type ]();
to
try {
     elem[ type ]();
} catch(err) {
     // ignore errors
}
 With this change the dialog opens successfully.

Monday, July 23, 2012

Android SDK Manager missing platform versions

When I first installed the Android SDK I only installed Android 4.0.3 (API 15), which was current at the time. Later I wanted to test against Android 2.2, so I returned to the Android SDK Manager to find that Android 4.0.3 was the only platform version listed. There were also Android 8 and Android 10, but these didn't include the SDK Platform and couldn't be installed.

I googled for a couple of hours and all the advice was the same, install Android 2.2 (API 8). But how does one install it when it isn't in the list of packages to be installed?

I had restarted Android SDK Manager several times and, as I am running on Windows 7, I had been careful to right-click and run as root but this made no difference.

Finally, in desparation, I shut down Windows and re-booted. After this, I started Android SDK Manager (right-click and run as administrator), and the packages list now had a full assortment of platform versions, including Android 2.2 (API 8).

And the lesson is: Android SDK Manager and/or Windows 7 are flakey. Before wasting time researching problems, try a reboot. It may save you hours with Google and reading feedback to instructions for newbs.

Wednesday, July 18, 2012

Why is Windows so slow?

This is just venting.

I often have to transfer files to remote Microsoft Windows servers, connected via VPN and RDP. My broadband connection is a bit slow - my uplink speed is often only 500-700kbps and sometimes only 200-300kbps, though rarely worse than that.

If I zip the source folder, which takes less than 5 seconds, I can copy it to the remote system in about 3 seconds and unzipping to the destination is sub-second. A total of about 30 seconds, including opening explorer, navigating to the source and destination folder, etc.

If I copy and paste the folder using Microsoft Windows explorer functions, it takes 5 to 15 minutes to transfer the same data. It takes a minute or more to complete the copy, traversing the few directories to find the few hundred files. Then many minutes to paste the files to the target on the remote server. The uncompressed data is less than 5 times the size of the zip file so even if RDP doesn't compress data through the pipe it doesn't come close the explaining the performance difference.

I can't imagine what nonsense Microsoft Windows Explorer is doing that it takes so long to copy then so much longer to paste a few files. Certainly not anything of any benefit to me. And certainly not anything necessary, given the few seconds it takes to transfer the files in the form of a zip file.

Friday, June 29, 2012

More or Less

More or Less: Democracy and New Media is a thought provoking essay covering a variety of current social issues. Well worth the time to read it.

Thursday, June 28, 2012

A dark day for democracy

Information is power and the root of democracy. There are many in the world who would deny information to the masses and only a few who vigorously defend and support the natural right to information of all people. Without unfettered information for the masses there is no democracy and without democracy there is no reasonable chance or hope for justice.

Today the BBC reported that Julian Assange has been served with an extradition notice. He is now one step closer to being silenced.  He is one of the most effective defenders of democracy in recent times. He will, very likely, soon be in the hands of the US industrial/military complex where, I expect, his prospects for natrual justice, freedom or even survival are slim.

My condolences to Julian Assange. You should be hailed a hero of the free world, not condemned and persecuted. Thank you for what you have done and good luck to you.

It is a dark day for democracy.

Tuesday, June 12, 2012

Sidestreet Reny

I just got all SSR's "unreleased" CDs - they're great! You should check them out on YouTube.

Check out Brooklyn, or SSR Featured Videos.

He has music with a message for young people.

Sunday, June 10, 2012

Morality

It has been on my mind the past few years that the U.S.A has lost its moral compas and credibility, at least with me. Today, for entirely other reasons and in response to a very different argument, it occurred to me that:

Without morality there is no justice, without justice there is no hope, without hope there is no incentive to work, without incentive to work there is no production and no innovation, without which there's less wealth.

Labels