Friday, 27 January 2012

JavaScript function to get XML object from string

Here's a function that you can use to load an xml object from an xml-formatted string in JavaScript:

function loadXMLFromString(text)
    {
        try //Internet Explorer
        {
            xmlDoc=new ActiveXObject('Microsoft.XMLDOM');
            xmlDoc.async='false';
            xmlDoc.loadXML(text);
        }
        catch(e)
        {
            try //Firefox, Mozilla, Opera, etc.
            {
                parser=new DOMParser();
                xmlDoc=parser.parseFromString(text,'text/xml');
            }
            catch(e) {alert(e.message);}
        }
       
        return xmlDoc;
    }


Thursday, 26 January 2012

How to remove whitespace dots in Visual Studio Text Editor

If white space (spaces, tabs, etc) is showing as dots in the visual studio text editor, you can undo this by using the key combination Ctrl+E,S.

If you prefer the dots (why??) you can enable them again by pressing Ctrl+R,W.

HTH

Friday, 23 September 2011

How to redirect in web.config

Let's say you want to redirect visitors from one subdomain to another. You can do this by putting this in your web.config for the redirected-from application:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpRedirect enabled="true" destination="https://abc.example.com/newpages" httpResponseStatus="Permanent" />
    </system.webServer>
</configuration>

This is ideal for obsolete website addresses that may still be saved in favorites, or linked to on a corporate intranet, or for redirecting common mistakes, such as users entering www.example.com/webmail when what they really want is mail.example.com/webmail.

Monday, 29 August 2011

Flash CS3 Vista install problems

If you are having trouble with a silently failing install of Adobe Flash CS3 on Windows Vista, I may have the solution:

Start -> All Programs -> Accessories
Right-Click -> Run as Administrator.
Enter the command:

regsvr32 jscript.dll

hit enter.

Once the jscript dll is registered, the Adobe installed should now be a ble to run and install Flash CS3 on your computer.






Monday, 18 July 2011

Google Chrome standalone installer

Admins often need to install and upgrade via group policy or install packages on machines that are not connected to the internet. For Google's Chrome browser this can be accomplished by downloading the Chrome Standalone Installer.

Wednesday, 29 June 2011

List all databases with sqlcmd

sqlcmd -s <db server or instance> -q "exec sp_databases"

Examples:
 sqlcmd -s localhost -q "exec sp_databases"
 sqlcmd -s dbserver -u loginname -p password -q "exec sp_databases"
 sqlcmd -s ./MSSQLSERVER -u loginname -p password -q "exec sp_databases"