Shutting down a computer

Create your own function to execute an OS command through the command line? For the sake of an example. But know where and why you’d want to use this as others note. public static void main(String arg[]) throws IOException{ Runtime runtime = Runtime.getRuntime(); Process proc = runtime.exec(“shutdown -s -t 0”); System.exit(0); }

Cross-Browser Javascript XML Parsing

The following will work in all major browsers, including IE 6: var parseXml; if (typeof window.DOMParser != “undefined”) { parseXml = function(xmlStr) { return ( new window.DOMParser() ).parseFromString(xmlStr, “text/xml”); }; } else if (typeof window.ActiveXObject != “undefined” && new window.ActiveXObject(“Microsoft.XMLDOM”)) { parseXml = function(xmlStr) { var xmlDoc = new window.ActiveXObject(“Microsoft.XMLDOM”); xmlDoc.async = “false”; xmlDoc.loadXML(xmlStr); return … Read more

Cross platform IPC [closed]

In terms of speed, the best cross-platform IPC mechanism will be pipes. That assumes, however, that you want cross-platform IPC on the same machine. If you want to be able to talk to processes on remote machines, you’ll want to look at using sockets instead. Luckily, if you’re talking about TCP at least, sockets and … Read more

Cross-platform, cross-browser way to play sound from Javascript? [duplicate]

You will have to include a plug-in like Real Audio or QuickTime to handle the .wav file, but this should work… //====================================================================== var soundEmbed = null; //====================================================================== function soundPlay(which) { if (!soundEmbed) { soundEmbed = document.createElement(“embed”); soundEmbed.setAttribute(“src”, “/snd/”+which+”.wav”); soundEmbed.setAttribute(“hidden”, true); soundEmbed.setAttribute(“autostart”, true); } else { document.body.removeChild(soundEmbed); soundEmbed.removed = true; soundEmbed = null; soundEmbed = document.createElement(“embed”); … Read more

MongoDB GUI client (cross-platform or Linux) [closed]

Robomongo – cross-platform MongoDB GUI client. Update: Mac OS X and Linux(as Debian/Ubuntu, RHEL/CentOS packages) versions released. Update: Robomongo officially changed it’s name and released two different products Studio 3T and Robo 3T. Old robomongo is now called Robo 3T. Studio is for professionals. Update: from October 2022 Robo 3T is named Studio 3T Free.