Wednesday, September 10, 2008

Javascript cloning object

Cloning Objects in Javascript

This example illustrates how to clone an object in javascript. It would allow to call clone() on any object to make a copy of the respective object.










Object.prototype.clone = function () { // prototype for clone method in object
function c(o) {
for (var i in o) {
this[i] = o[i];
}
}
return new c(this);
};

var t = new Object();
t.test = "xyz";
t.setTest = function(a) {
this.test = a;
}

t.getTest = function () {
return this.test;
}

alert(t.getTest());
var u = t.clone(); // cloning of object
u.setTest("abc");
alert(u.getTest());
alert(t.getTest());


Thursday, June 19, 2008

System Commands for Windows

Following are some commonly used system functions which furthermore can be accomplished by system commands as per follows. Simply Navigate to Start Menu --> Run --> Type the System Command as required. Enjoy and have Fun...!!!
1. Diskmgmt.msc --> Opens the Disk Management window.
2. compmgmt.msc --> Opens the Computer Management window.
3. access.cpl --> Opens the Accessibility Options window.
4. appwiz.cpl --> Opens the Add or Remove Programs window.
5. Desk.cpl --> Opens the Display Properties window.
6. firewall.cpl --> Opens the Windows firewall.
7. Hdwwiz.cpl --> Opens the Add Hardware Wizard window.
8. Inetcpl.cpl --> Opens the Internet Properties window.
9. Intl.cpl --> Opens the Regional and Language Options window.
10. Jpy.cpl --> Opens the Game Controllers window.
11. Main.cpl --> Opens the Mouse Properties windows.
12. Mmsys.cpl --> Opens the Sounds and Audio Device Properties window.
13. Ncpa.cpl --> Opens the Network Connections window.
14. Netsetup.cpl --> Opens the Wireless Network Setup Wizard window.
15. Odbccp32.cpl --> Opens the ODBC Data Source Administrator window.
16. Powercfg.cpl --> Opens the Power Options Properties window.
17. Sysdm.cpl --> Opens the System Properties window.
18. Telephon.cpl --> Opens the Phone & Modem Options window.
19. Timedate.cpl --> Opens the Date and Time Properties window.
20. Wuaucpl.cpl --> Opens the Automatic Updates window.