Easy tech stuff!

How to dynamically call javascript functions

Posted: May 22nd, 2010 | Author: Nischal Shetty | Filed under: JavaScript | Tags: , , , | No Comments »

I’ve had a lot of moments when I needed to call a javascript function dynamically. By dynamic function call in javascript, I mean when you do not know the function name to be called before hand i.e. the function name to be executed is provided at runtime.

All you need to do is – window["functionname"]();

Yeah, that’s all! Here functionname would be replaced with the name of your function. As always, I’ll provide a working example so that there is no confusion as to how to make dynamic function calls in Javascript.


How to remove Active Desktop Recovery screen

Posted: July 13th, 2009 | Author: Nischal Shetty | Filed under: Windows | Tags: , | 22 Comments »
  1. Go to Run and type regedit
  2. Now navigate to this path – HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\SafeMode\Components
  3. You would find a key named DeskHtmlVersion
  4. Right click the key and select Modify
  5. Under the label Base, select the radio button Decimal
  6. Change Value data to 0
  7. Click OK

This should do the trick. If the screen doesn’t go then try restarting your PC for the changes to take effect.


javac bug – no unique maximal instance

Posted: April 28th, 2009 | Author: Nischal Shetty | Filed under: Java | Tags: , | No Comments »

While trying to compile my java class files with the 1.6 java compiler, I came across an error message that read :

no unique maximal instance exists for type variable U with upper bounds U

The weird thing was that the file compiled just fine in eclipse!

On further probing I realized it’s a javac bug (check the bug here)

Here’s the workaround -

Bug Scenario :

public class SomeObject {

<U extends SomeObject> U foo1() throws Exception {

SomeObject obj = new SomeObject();
return obj.foo1();
}

}

Solve this way :

public class SomeObject {

<U extends SomeObject> U foo1() throws Exception {

SomeObject obj = new SomeObject();
return obj.<U>foo1();
}
}