Saturday, June 19, 2010

find & unzip recursively

find . -name "*.zip" -exec unzip '{}' \;

Wednesday, December 2, 2009

JQuery onchange event

("#textAreaId").change(function() {
     //....
});

The onchange event only triggers after the textArea loose its focus. The solution is to use keyup event.

("#textAreaId").keyup(function() {
     //....
});

Saturday, November 28, 2009

MySQL drop constraints

To see all constraints, look in information_schema.table_constraints.

In MySQL constraints are stored using indexes.

To remove a contstraint:

alter table [table_name] drop index [constraint_name]

Sunday, November 8, 2009

javax.transaction:jta:jar:1.0.1B is not available in maven repos

Credits : http://stigebil.wordpress.com/2008/06/03/javaxtransactionjtajar101b/

Download from here.

Install:

mvn install:install-file -Dfile=./jta-1_0_1B-classes.zip -DgroupId=javax.transaction \
-DartifactId=jta -Dversion=1.0.1B -Dpackaging=jar

Tuesday, September 15, 2009

javascript clear all children for an element

function removeAllChildren(elem) {

if (elem.hasChildNodes())
{
while (elem.childNodes.length >= 1)
{
elem.removeChild(elem.firstChild);
}
}
}

Sunday, April 26, 2009

Friday, January 30, 2009

sqlserver 2005 start/stop from commandline

net start mssqlserver
net stop mssqlserver