Posts

Showing posts from July, 2012

Updating firmware for the Android smartphone

My Android phone is severely old, and obviously not supported by the manufacturer (it's not Nexus). The battery life was too short, and I had concerns that it's not because the phone is too old and battery just died, but because of a number of bloatware installed by the manufacturer (like Facebook applications which can't be deleted). So I decide to update the ROM and use something decent without any junk inside. To my surprise, my concerns were correct, and after upgrade the phone lives much longer on the battery. Let me give simple steps how to do it (because mostly tutorials are too complex for beginners): Root the phone. I recommend Superoneclick Install CWM Recovery , make partitions for FS and SWAP, wipe all the data and cache. Install custom ROM (like Cyanogenmod ). You don't need to copy files to SD card directly, you can use 'mount USB option' from CWM Recovery menu and copy zip-files from PC using the cable. Install gapps if you need Google ac

Single-quoted attributes are valid HTML

The subj is a small surprise for me, but it's true - single quotes for attributes are valid HTML: HTML 5:  http://dev.w3.org/html5/markup/syntax.html#attr-value-single-quoted <input type='checkbox' /> HTML 4:  http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2 By default, SGML requires that all attribute values be delimited using either double quotation marks (ASCII decimal 34) or single quotation marks (ASCII decimal 39). XHTML(XML):  http://www.w3.org/TR/REC-xml/#sec-common-syn AttValue ::= '"' ([^<&"] | Reference)* '"'  | "'" ([^<&'] | Reference)* "'"

Why jQuery.isFunction?

Usually you can test whether JS object is function by using this test: (typeof fn === 'function') However, this doesn't always work (IE8): typeof alert => 'object' typeof document.createElement('input').getAttribute => 'object' Before jQuery 1.4 internally they used the same check, but now they've fixed it. So to be sure that passed object is a function which can be called, just use $.isFunction method: $.isFunction(function() {}) => true $.isFunction(alert) => true $.isFunction(document.createElement('input').getAttribute) => true