Friday, September 30, 2011

Install python 2.5 after 2.7

I already have python 2.7, To install python 2.5 without replacing current python installation - 
do -

1) ./configure
2) make altinstall


Svn connector install error in Eclipse

While installing a svn connector in eclipse, an error comes up -

Error resolving hostname community.polarin.com

 To resolve this issue -
add the following in ur hosts file.


212.227.210.100 community.polarion.com

Saw the solution here -

https://bugs.eclipse.org/bugs/show_bug.cgi?id=306786

Wednesday, September 7, 2011

Bind event on changing selected option using Jquery

Below I am sharing a code , using which we can -

a) add an event
b) remove the event
c) modify the event on changing the option.

First bind the function with change and keyup events (Keyup is required when the user chnges option using his up and down keys)

$("#id").bind('change keyup',function(){
required_func(this);
});


Now, the required function

function required_func(element)
{
if($(element).val() != "")
{
var parent = $(element).parent();

                // action = do something 

// Append.
if ( // no action )
{
// append action
}
// Update.
else
{
$(element).attr();
                        $(element).show();
}
}
// Remove.
else
{
$(element).hide();
}
}


Hope this helps..

The important thing is , it takes into consideration all cases
1) on key up
2) removing action
3)modifying action