sarathonline.com/blog | Trouble viewing this page? Give Feedback .
Try my blog on: Ajax Version
Search

Thursday, December 08, 2011

My first blog from my android tablet

Acre Iconia Tab A500
I picked up my Acer Iconia. A500 tablet from BestBuy yesterday. 24hrs later, the screen looks like its been used for 6 months. It's scary how these things keep you captivated. There are thousands of reviews out there, so I am not going to bore you with another "in-depth" review. Here is short and sweet account of my rendezvous with my new found love interest.

Thursday, September 15, 2011

Happy Engineers Day!

Today is Engineer's Day in India.



Happy Engineers Day..

Sunday, September 11, 2011

Tribute: The day that is 9/11.

One has to admire the relentless spirit of a nation to value the immense loss on this day ten years ago. And their courage to stand by it. Hats off to those in United 93 who chose to sacrifice thier life over thier fellow countrymen. And to the countrymen who don't forget the loved ones, and show gratitude to those who served.

May the families, whose loss is immeasurable, find peace this day. May the souls rest in peace. May there be "No such day to any nation on the face of the planet, EVER again". Today, so We pray.

Saturday, August 13, 2011

Thank you.. For the Rakhis


Archana..
image

Amulya..
image

Friday, July 29, 2011

Friday, June 17, 2011

MySql Copying Table Structures.

Some times you need to copy only table structures across databases. This article describes two ways of doing it.

If the whole database schema need to be exported, mysqldump is very effective. A --nodata flag will dump all tables' schema.

Like this.

mysqldump --nodata -p -u username databaseName

But if you want to copy a specific table, individually, you could use "create table like" feature. You could create it even from a different database. However it must be on the same mysqld instance.

Like this.
create table newtable like oldtable;
--Or from a table in other database
create table mytable like otherdatabase.tablename;

Tuesday, June 14, 2011

Developing Userscripts for Chrome (caveats)

To develop Chrome extensions, crx is the best way. But the user scripts that are developed in general for Greasemonkey can also be delivered for Chrome, if a few easy rules are followed.

1. @required and @resource don't work.

By default, atleast for now, These two Userscript metatags donot work on Chrome. If you need to load a js file, instead of using @required - try to use document.createElement. Similarly with @resource.

2. Some GreaseMonkey helper methods don't work or are restricted.

Methods with GM_ prefix from userscript api may not work. Particularly, unsafeWindow, GM_registerMenuCommand, GM_setValue, or GM_getValue are not supported. GM_xmlhttpRequest will work but not only on the same domain.

3. @includes are not shown while installing.
This may not be a deal breaker for developers, but sure is for users. The patterns used in @include is not shown while installing. Instead a generic message is shown as below. This message may scare the users away.

image

To over come this, add @match and show the @include pattern there. The message window pics up the domain portion of the pattern.

image

This actually can be used maliciously. A developer may install a script with a different include pattern and show a different match pattern, there by luring the users to install a malicious script. Although Chrome follows the @include pattern to add script to the page. Just the installation window pops open with @match pattern. Please use this for responsibly.

Here is comments from The Chromium source that explains the reasoning, valid/invalid patterns @match can take:
// Examples of valid patterns:
// - http://*/*
// - http://*/foo*
// - https://*.google.com/foo*bar
// - file://monkey*
// - http://127.0.0.1/*
//
// Examples of invalid patterns:
// - http://* -- path not specified
// - http://*foo/bar -- * not allowed as substring of host component
// - http://foo.*.bar/baz -- * must be first component
// - http:/bar -- scheme separator not found
// - foo://* -- invalid scheme
// - chrome:// -- we don't support chrome internal URLs
//
// Design rationale:
// * We need to be able to tell users what 'sites' a given URLPattern will
//   affect. For example "This extension will interact with the site
//   'www.google.com'.
// * We'd like to be able to convert as many existing Greasemonkey @include
//   patterns to URLPatterns as possible. Greasemonkey @include patterns are
//   simple globs, so this won't be perfect.
// * Although we would like to support any scheme, it isn't clear what to tell
//   users about URLPatterns that affect data or javascript URLs, so those are
//   left out for now.

© SarathOnline.com 2000-'11