<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../xsl/road-faq.xsl"?>

<rf:topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
   xsi:schemaLocation="http://schemas.roadintranet.org/road-faq-1 ../xsl/road-faq.xsd"  
   xmlns:rf="http://schemas.roadintranet.org/road-faq-1"
 title=" Windows OS"
 file="win-os.xml"
 fileid="$Id: //main/2005/road/road-faq/xml/win-os.xml#33 $$Change: 1140 $"
 fileChange="$DateTime: 2010/01/03 11:42:01 $$Author: bbarber $">
    <div><h4>Windows OS  -- notes on Windows from Road Intranet</h4></div>
    
    <rf:copyright>
        <a href="../../../road/COPYING.txt">Copyright</a> (c) 2005-2010, C.B. Barber
    </rf:copyright>
   <rf:section id="win-links" title="Useful Links">
      <div class="twocol">
         <div class="col leftcol">
            Help
            <ul><li>
               <a href="http://msdn.microsoft.com/">Microsoft MSDN</a>
            </li><li>
                <a href="http://connect.microsoft.com">Report Microsoft Bugs</a> -- 
                <a href="http://connect.microsoft.com/Main/content/content.aspx?ContentID=2220">New
                products</a>,
                <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=CEBF3C7C-7CA5-408F-88B7-F9C79B7306C0">
                    Reporting Tools</a> (Product Support)
            </li><li>
               <a href="http://www.microsoft.com/windows2000/en/server/iis/">Microsoft IIS
                  documentation</a>
            </li><li>
               <a href="http://www.lookuptables.com/">ASCII, Unicode, Character code</a> --
               character tables.
            </li><li>
                <a href="http://codeidol.com/">CodeIdol</a> -- free, on-line books on coding and IT
            </li><li>
                <a href="http://www.chicagotech.net">ChicagoTech</a> -- advice on networking
              </li><li>
                  <a href="http://www.petri.co.il/kb.htm">Petri's Knowledge Base</a> -- Advice on Win2K,
                  Server 2003, XP, Active Directory, Exchange
              </li><li>
                  
              </li><li>
                  
              </li></ul>

             Tables
             <ul><li>
             </li><li>
                 <a href="http://www.lookuptables.com/">ASCII, Unicode, Character code</a> --
                 character tables.
             </li><li>
                <a href="http://www.chebucto.ns.ca/~rakerman/port-table.html">Port assignments</a>
                 (<a
                     href="http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers">Wikipedia</a>)
              </li><li>
                  <a href="http://www.liutilities.com/products/wintaskspro/dlllibrary/system/">Win OS
                  dlls</a>
             </li><li>
                 <a href="http://filext.com/">File Extensions</a>
              </li><li>
              </li><li>
                  
              </li></ul>
            
            ASP.NET
            <ul><li>
               <a href="http://www.asp.net">www.asp.net</a>
            </li></ul>
         </div>
         <div class="col rightcol">
            Developer Resources
            <ul><li>
                <a href="http://msdn.microsoft.com/">Microsoft MSDN</a>
            </li><li>
                Report Microsoft Bugs -- 
                <a href="http://connect.microsoft.com/Main/content/content.aspx?ContentID=2220">New
                    products</a>, <a
                        href="http://forums.microsoft.com/MSDN">MSDN Forums</a>,
                <a href="http://msdn.microsoft.com/newsgroups/">MSDN Newsgroups</a>,
                
            </li><li>
               <a href="http://devresource.hp.com/drc/topics/index.jsp">HP Dev Resource</a>
            </li><li>   
               <a href="http://www.alphaworks.ibm.com/tech/adesigner">Accessibility Designer</a>
            </li></ul>
            
            SQL
            <ul><li>
                <a href="http://www.ss64.com/sql">SQL Server</a>    
                and <a href="http://www.ss64.com/ora/">Oracle</a> commands
            </li><li>
                <a href="http://www.1keydata.com/sql/sql.html">SQL Tutorial</a> -- Geting started with SQL by 1keydata.
            </li><li>
                <a href="http://www.sqlis.com/">SQLIS.com</a> on SSIS (DTS for SQL Server 2005)
            </li><li>
                <a href="http://sqlservercentral.com/">SQL Server Central</a>
            </li><li>
                <a href="http://www.sqldev.net/">SQL Server Developer's Network</a>
            </li><li>
                <a
                    href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcabout_this_manual.asp">ODBC
                Programmer's Reference</a> (Microsoft)
            </li><li>
                <a
                    href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbc_test_overview.asp">ODBC
                Test</a> (Microsoft) -- Part of MDAC SDK
            </li></ul>
         </div>
      </div>
       <div>
           . <!-- clear the two column display -->
       </div>
   </rf:section>
    <rf:section id="sec-win-setup" title="Setup Windows"  order="sorted">
       <rf:item id="win-setup" title="1. Setup Windows XP" date="Nov 2005" author="bbarber">
           <ul><li>
               <rf:iref item="setup-directory"/> -- separate data files for backup from application
               and temporary files.
           </li><li>
               <rf:iref item="setup-vmware"/> -- Includes a recommended configuration for
               setting up Windows machines
           </li><li>
               <rf:iref item="setup-explorer"/> -- access to your files
           </li><li>
               <rf:iref item="setup-taskbar"/> -- access to your applications
           </li><li>
               <rf:iref item="setup-links"/> -- access to your directories
           </li><li>
               System Information (Start->All Programs->Accessories->System Tools) -- Periodically take a snapshot of your system.  Ran the snapshot on a quiet system.
           </li><li>
               Maintain a record of software installations, upgrades, registration ids, etc.
               
           </li></ul>
           
           
           <p>Other control panels</p>
           <ul><li>
               Controls->Java->Advanced->Miscellaneous->Java Quick Start -- Disable unless you run Java apps frequently.
           </li><li>
               Controls->Power Options->Hibernate -- Check <code>Enable hibernation</code>.  Press
               <code>Apply</code>
           </li><li>
               Controls->Power Options->Advanced -- If you use a hardware boot password, consider
               unchecking <code>Prompt for password when computer resumes</code>
           </li><li>
               Controls->Power Options->Advanced->Power buttons -- Select <code>Hibernate</code>
           </li><li>
               Controls->Sounds->Sounds->Sound Scheme -- set to "No Sound"            
           </li><li>
           </li><li>
               clt-alt-del->Task Manager->Add Columns  -- To help identify run-away processes, select virtual memory, I/O etc.
           </li></ul>
           
           TweakUI in <rf:iref item="powertoys"/> provides many configuration options.    Search for
           "TweakUI" on this page for more suggestions.
           <ul><li>
               Missing logon -- Logon -> Check box for "Show 'ID' on Welcome screen"
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li></ul>
       </rf:item>
       <rf:item id="setup-vista-security" title="Setup Vista security" date="Jun 2007" author="bbarber">
           <p>Vista tightens the security settings compared to Windows XP.  For a top-level review,
               see Microsoft's <a
                   href="http://www.microsoft.com/technet/windowsvista/security/guide.mspx">Vista
                   Security Guide</a></p>
           <ul><li>
               User Access Control (UAC) --- Vista restricts administrative rights.  By default,
               users run as non-administrators even if they belong to the administrators group.  For
               an introduction, see <a
                   href="http://www.microsoft.com/technet/windowsvista/security/defend_against_malware.mspx#EGD">Chapter
               2</a> of the security guide.
           </li><li>
               Administrator Approval Mode -- For administrators, UAC leads to frequent dialog boxes
               asking if it is OK to perform an action.   The Group Policy setting (gpedit.msc) can further
               restrict access by transferring prompts to a secure desktop.  This setting does not
               work well for automation scripts and unattended operation.  Furthermore, it occurs so
               frequently, that users may approve malware requests.  
           </li><li>
              Turn off Administrator Approval -- Go to <code>Control Panel->Administrative
                  Tools->Local Security Policy->Local Policies->Security Options->User Account
                  Control</code>.   Set <code>Behavior of the elevation prompt for administrators
                      ...</code> to <code>Elevate without prompting.</code>
           </li><li>
               Turn off User Account Control -- Go to <code>Control Panel->User Accounts->Turn User
               Account Control</code>.  Uncheck and reboot.   You will need to turn on Network
               Discovery and File Sharing (Goto Network, it will eventually prompt you).  The previous suggestion,
               <code>Elevate without prompting</code> removes the User Account Control messages but
               does not remove "Destination Folder Access Denied".
           </li><li>
               Windows Firewall -- See Microsoft's <a
                   href="http://technet2.microsoft.com/WindowsVista/en/library/9428d113-ade8-4dbe-ac05-6ef10a6dd7a51033.mspx?mfr=true">Windows
               Firewall with Advanced Security</a>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
               
           </li></ul>
       </rf:item>
       <rf:item id="setup-net" title="Setup Windows networking" date="Dec 2006" author="bbarber">
           <p>Some hints (needs expansion). </p>
           <ul><li>
               Missing default domain -- If ping works for fully qualified domain names, but not for
               simple names, you may have a static IP assigned without a default domain.  Add
               default domains to TCP/IP from <code>Control Panel->Network
                   Connections->Local Area Connection->Properties->Internet Protocol
                   (TCP/IP)->Properties->Advanced->DNS->Append these DNS suffixes</code> [bsearles]
           </li><li>
               
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
               
           </li></ul>
       </rf:item>
       <rf:item id="setup-directory" title="Setup directory structure" date="Nov 2005" author="bbarber">
           <p>If there are two disks, consider using C: for program
                 files and D: for all data and user configuration.   If so, you can rebuild C:
                 without deleting your data -- if you are careful about keeping data in D:</p>
          <p>Example directory structure. </p>
             <ul><li>
                 C:\Program Files -- all installed programs
             </li><li> 
                 D:\cbb --  a personal folder to simplify backup.  Consider using a shared drive
                 <ul><li>
                     cbb/config -- all configuration, e.g., your bookmarks
                 </li><li>
                     cbb/mydocs -- set to "My Documents"
                 </li><li>
                     cbb/myhome -- home directory for <rf:iref item="setup-cygwin"/>
                 </li></ul>
             </li><li>
                 D:\download\installers -- Download directory and downloaded installers
             </li><li>
                 D:\bin\.  -- standard utilities such as, TextPad
             </li></ul>
   
       </rf:item>
       <rf:item id="setup-explorer" title="Setup Windows Explorer" date="Nov 2005" author="bbarber">
           <p>Windows Explorer is your primary navigation to your files.</p>
            <ul><li>
               right-click "My Documents"->Properties -- set Target to c:\cbb\myhome (<rf:iref
                   item="setup-directory"/>)
            </li><li>
                Explorer->View->Details -- Drag "Date Modified" after "Name".  In
                <code>Explorer->Tools->Folder Options->View</code>, select "Apply to all folders"
            </li><li>
            </li><li>
               Explorer->Tools->Folder Options->General --  Use Windows Classic
            </li><li>
                Explorer->Tools->Folder Options->View -- Select "Show hidden files and folders"
            </li><li>
                Explorer->Tools->Folder Options->View -- Uncheck "Hide Extensions"
             </li></ul>
           
           <p>To create a Quick Launch shortcut to a directory</p>
           <ul><li>
               Drag the directory to the QuckLaunch section of the toolbar
           </li><li>
               Right-click and select Properties
           </li><li>
               Change the <code>Target</code> from FILEPATH to a file or directory within your directory
               <pre> explorer.exe /e,/select,FILEPATH\FILE_OR_DIRECTORY</pre>
           </li><li>
                Press <code>Apply</code> -- the icon should change.  
           </li><li>
               Fix the icon by pressing <code>Change Icon...</code> 
           </li><li>
              Commas separate the options for explorer.exe.
           </li><li>
               /n -- Opens a new window.
           </li><li>
               /e -- Includes the explorer bar (e.g., folders view).
           </li><li>
               /root,FILE_PATH -- Restricts explorer.exe to FILE_PATH and its subdirectories.
           </li><li>
               /select,FILE_PATH -- Opens explorer.exe to FILE_PATH.
           </li></ul>
       </rf:item>
       <rf:item id="setup-taskbar" title="Setup Windows task bar" date="Nov 2005" author="bbarber">
           <p>The Windows Taskbar is your primary navigation to your applications</p>
            <ul><li>
               right-click Taskbar->Properties -- Uncheck "Lock ...", "Group similar...", "Hide inactive".  
            </li><li>
               right-click Taskbar->Properties -- Check "Show Quick Launch".  To add icons to Quick
               Launch, ctrl-drag a Start menu item or Desktop alias.   Extra items at the end of
                Quick Launch become a menu. 
                For a sub-menu,  <code>right-click Quick Launch->open
                    folder->New->Folder</code>.  The Quick Launch folder apparently can not be moved
                like the Favorites folder.
            </li><li>
               Consider moving Taskbar to another window edge.    The left-edge works well, even
                with many open windows.  The bottom-edge works well for Remote Desktop Connections,
                especially with two rows -- one current applications, the other quick-launch.
            </li><li>
               right-click QuickLaunch->View->Small Icons
            </li><li>
               Start->Programs->Accessories -- drag <code>Windows Explorer</code> to Taskbar->QuickLaunch
            </li><li>
                Start->Programs->Accessories -- drag <code>Command Prompt</code> to
                Taskbar->QuickLaunch.  <rf:iref item="setup-cmd"/>.  Add Start->Control
                Panels <code>Add or Remove Programs</code> and <code>System</code>.  
                Add <code>Start->Control
                Panels->Administrative Tools->Computer Management</code>.  Add
                Windows/system32 calc and  taskmgr.    Alternatively use the calculator from Windows
                <a href="http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx">PowerToys</a>. 
             </li><li>
                 Grouping -- By default, the task bar groups related buttons into a pull-down list. 
                 Control this feature with TweakUI in <rf:iref item="powertoys"/>, <code>Tweak
                 UI->Taskbar and Start menu->Grouping</code>.  A good setting is to group 6 or more
                 items of the same name.
             </li><li>
             </li><li>
             </li><li>
             </li><li>
             </li><li>
             </li><li>
             </li><li>
             </li><li>
            </li></ul>
           
       </rf:item>
       <rf:item id="setup-links" title="Setup Windows Explorer Links" date="Nov 2005" author="bbarber">
           <p>The Links toolbar allows quick access to any directory or file.  For frequently used
           directories, also consider drive letters.  To assign a drive letter use the
               <code>subst</code> command from <rf:iref item="cmd-useful"/></p> [kzhu]
           <pre>
               subst S: "G:\QAVault\MathcadClient\Trunk\SmokeTest\smoke_test_files"
           </pre>
           <p>Setup Links toolbar for Explorer</p>
            <ul><li>
                 Right-click Explorer toolbar and Check "Links Toolbar"
            </li><li>
                As recommended above, create a personal <code>config</code> directory.
            </li><li>
                Move your existing Favorites to the <code>config</code> directory.   
                Right-click on the Favorites folder in <code>Documents
                    and Settings/your-ID</code>.  Drag into your <code>config</code> directory
                and select <code>Move To</code>.    The Links directory is now
                <code>config\Favorites\Links</code>.     If you want to move the Favorites directory
                again, use <code>TweakUI->My Computer->Special Folders</code> from <rf:iref item="powertoys"/>
            </li><li>
                Create sub-directories in the Links folder for a hierarchical
                Links menu.   Place the names on the menu bar for multiple link menus.   
                Sub-directories also provide sub-menus on Quick Launch.
            </li><li>
                Remove "Shortcut to" -- By default Windows prepends "Shortcut to" before each
                short cut.  To delete this prefix
                <ul><li>
                    On Windows XP, using <code>regedit</code>, modify or create the
                    '<code>link</code>' value in the registry key 
                    <code>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer</code>.
                     Set its data to <code>REG_BINARY   00 00 00 00</code>.
                </li><li>
                    On Windows Vista, also create the '<code>link</code>' value in the registry key 
                    <code>HKEY_CURRENT_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer</code>.
                    Set its data to <code>REG_BINARY   00 00 00 00</code>.
                </li><li>
                    Reboot the computer.
                </li><li>
                    ON XP, note that the corresponding HKLM key does not work.
                </li><li>
                    Alternatively, use TweakUI in <rf:iref item="powertoys"/> to remove "Shortcut to" from shortcut
                    names.   
                </li><li>
                    For Windows Server 2003, neither the registry edit nor TweakUI fixes this
                    problem.  HKLM may work as it does in Vista.
                </li><li>
                    On Windows XP, use <code>Send to ->Desktop</code> as a poor alternative.
                </li></ul>
            </li><li>
                Desktop -- Create an <code>apps</code> directory on the Desktop for application
                links.  Then periodically copy the <code>Links</code> directory to the Desktop.  
                Use these links for the <code>Save as</code> and Open dialog boxes. 
            </li><li>
                Auto update Links -- To keep the Desktop links updated, create a scheduled task to
                copy the links, e.g., 
                <code>xcopy "D:\cbb\config\Favorites\Links\*" "C:\Documents and Settings\bbarber\Desktop" /D /S /Y</code>  
            </li><li>
                You may need to Log-off or reboot to instantiate the new settings.
                </li><li>
                    Taskbar -- You can add Links to the taskbar, but they do not launch explorer
                    windows with the folder view or Links menu.    If wanted anyway,  select <code>right click
                        taskbar->Toolbars->Links</code>
                </li><li>
                    %QTDIR%/README -- A link can use environment variables.  This allows the link to carry over between versions.
                </li><li>
                </li><li>
                    
                </li></ul>
           
           <p>Using the Links toolbar</p>
            <ul><li>
                  Keep Links toolbar on the right margin.  Links on the pull-down menu open in the
                  same window, but links on the toolbar open a new window without the folder view.              
            </li><li>
                 Show folders on the menu bar.  If a folder is at the top of the pull-down menu, drag-and-drop will place
                new items into that folder.
               </li><li>
                  Drag any folder to the Links toolbar.    You may reorganize the Links folder via Internet
                   Explorer's Favorites toolbar.  
               </li><li>
                   Right-click Links menu->Sort By Name -- clean up the Links menu.  Names that
                   start with '_' go to the top.
               </li><li>
                   Links on the menu bar -- You can add Links to the menu bar, but clicking the link
                   does not show
                   the folder view, nor the links menu.
               </li><li>
               </li></ul>

           <p>Make your Desktop a mirror of the Links Toolbar.   Then  File Open gives you one-click
               access to everything in your Links.</p>
           <ul><li>
               Apps folder -- Create an 'Apps' folder on your desktop, and move all of the
               application links to this folder.
           </li><li>
               Remove default links -- Using TweakUI->Desktop, remove the default icons that you do
               not have elsewhere.
           </li><li>
               Copy Links -- Copy all of the links in your Config/Links directory to the desktop.
           </li><li>
               File Open -- Click on Desktop and there are your links.
           </li><li>
               As needed, recopy the Links folder.   Alternatively, move your Desktop to the Config
               directory and move your Favorites to the Desktop (see previous directions).  Then
               Desktop->Favorites->Links gets to your links. 
           </li></ul>
         </rf:item>
      <rf:item id="standard-apps" title="2. Setup standard applications" date="Nov 2005" author="bbarber">
            Useful utilities and applications.    For more suggestions, see <rf:iref
                item="Software"/>.
          <ul><li>
                 </li><li>
               <rf:iref item="setup-beyondcompare"/> -- excellent,
               inexpensive file, directory, and zip differences.
            </li><li>
                    <a href="http://www.ioisland.com/cleartweak/">ClearTweak</a> -- enhance LCD
                     displays (freeware) [metacosm]
                 </li><li>
                <rf:iref item="setup-firefox"/> -- main competitor to IE 
            </li><li>
                <rf:iref item="setup-mwsnap"/> -- free image clip.
            </li><li>
               <a href="http://www.mirekw.com/winfreeware">PINs </a> -- free password
               vault
            </li><li>
                <rf:iref item="setup-opera"/> -- free browser alternative to Firefox and IE.
            </li><li>
                <rf:iref item="setup-outlook"/> -- avoid problems with delayed send.
            </li><li>
                <rf:iref item="setup-oxygen"/> -- good XML and XSLT editor
            </li><li>
                <rf:iref item="powertoys"/> -- free UI customization, etc.
            </li><li>
                <a href="http://www.microsoft.com/Downloads/details.aspx?familyid=C26EFA36-98E0-4EE9-A7C5-98D0592D8C52"
                    >Synctoy</a> --  Synchronize two or more directories (e.g., for a laptop or backup to a network drive).   Consider turning off  ''Save overwritten files in the Recycle Bin''.
                After setting up a folder pair, do not delete the folders (Synctoy will drop the folder pair).
            </li> <li>
                <a href="http://www.freewebs.com/nerdcave/taskbarshuffle.htm">Taskbar
                    Shuffle</a> (free)--
                Drag-n-drop taskbar buttons with instant close.  Add it to your startup folder.  Keep applications together with
                <code>Right-click Taskbar->Properties->Group similar
                taskbar buttons</code>.    Select <code>Allow middle click to close task
                    button/group</code>.
            </li><li>
                <rf:iref item="setup-textpad"/> -- much better than Notepad.  Inexpensive 
            </li><li>
                <a href="http://www.x1.com/">X1</a> -- fast, non-intrusive search of your email and disk files.  
                <ul><li>
                </li><li>
                    Developers should add ".pl,.c,.sh,.h,.sql,.cpp" to <code>Tools->Options->Files->Specify File Types->Additionally index...</code>  
                </li><li>
                    Tools->Options->Indexing -- Set <code>Allow indexing when minimized</code>
                </li><li>
                    Tools->Options->Indexing->Email -- Clear <code>Keep copies of email in index</code>.  Copying the emails can lock up the processor for a minute or two.
                </li></ul>
              </li><li>
              </li><li>
              </li><li>
                  
              </li></ul>
          
             Debugging and development
          <ul><li>
          </li><li>
              <rf:iref item="setup-bash"/> -- portable shell for Windows, Macintosh, and Linux
          </li><li>
              <rf:iref item="setup-cmd"/> -- Windows command shell
          </li><li>
              <rf:iref item="setup-curl"/> -- Command line access to the web.
          </li><li>
              <rf:iref item="setup-depends"/> -- Dependency walker for
              exe and dll files.   Solve dependency problems and explore exported methods. 
              Integrates with MSDN help.
          </li><li>
              <a href="http://www.fiddlertool.com">Fiddler2</a>  -- HTTP and HTTPS debugging.
              Set <code>Rules->Performance->Show Response Timestamp</code>.
              To configure <a href="http://www.gotnet.biz/UsingFiddler2WithFirefox.ashx"
                  >Firefox for Fiddler2</a>, set <code>Firefox->Tools->Options->Advanced->Network->Connection->Settings->Automatic proxy configuration URL</code> 
              to <code>file:///C:\Document%20and%20Settings\kevin\My%20Documents\Fiddler2\Scripts\BrowserPAC.js</code>
              and press 'Reload' followed by 'OK'.
          </li><li>
              <a href="http://www.dns.net/dnsrd/">dig</a> -- Investigate DNS records (replaces nslookup).
          </li><li>
              <a href="http://www.pathanalyzer.com/ ">Path Analyzer Pro</a> -- traceroute for Windows and Mac TCP/IP
          </li><li>
              <rf:iref item="setup-logparser"/> -- process log files, HTTP access logs, Windows event logs, and tabular data
          </li><li>
              <rf:iref item="setup-putty"/> -- SSH/telnet client for Win32             
          </li><li>
              <rf:iref item="setup-sysinternals"/> -- free utilities for exploring Microsoft Windows
              as documented by <rf:iref item="russME_2005" />
          </li><li>
              <a href="http://www.ethereal.com/">Wireshark</a> (Ethereal) -- monitor network activity.  Reads tcpdump files
          </li><li>
          </li></ul>
          
             Other advice
             <ul><li>
             </li><li>
                 On-access virus scan -- Consider turning off on-access virus scan.   It can
                 degrade performance during disk-intensive operations (e.g., copying long
                 directories).  Be careful - If  on-access virus scan is turned off, a virus may be installed between scans.
             </li></ul>
      </rf:item>
       <rf:item id="setup-messenger" title="Setup Windows Messenger" date="Apr 2007" author="bbarber">
           Windows Messagenger is Microsoft's Instant Messaging client.  It is installed with
           Windows XP.  
           <ul><li>
               <a href="http://support.microsoft.com/kb/307887">How to use Windows Messenger</a>
              (Microsoft) -- Includes instructions for setting up Passport.
           </li><li>
               If Windows Messenger is not installed -- Install from <code>ControlPanels->Add/Remove
                   Programs->Windows Components</code>.  Check <code>Windows Messenger</code>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
               
           </li></ul>
       </rf:item>
       <rf:item id="setup-chinese" title="Setup Windows for Chinese applications" date="Oct 2006"
           author="kzhu">
            <p>An English Windows system can run Chinese applications, but non-unicode application
                displays characters in the current code page, i.e., gibberish when using an English
                code page.</p>
           <ul><li>
               Add East Asian language support -- Install East Asian language support from CD or ISO
               images, <code>Control Panels->Regional and Language Options->Languages->Install files
               for East Asian Languages</code>
           </li><li>
               Select the language --   Select the language in  <code>Control Panels->Regional and
                   Language Options->Advanced->Language for non-Unicode programs</code>
           </li><li>
               For traditional chinese -- Select Chinese (Taiwan).
           </li><li>
           </li></ul>
       </rf:item>
      <rf:item id="powertoys" title="Setup PowerToys" date="Oct 2005" author="bbarber">
         <p><a href="http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx">XP
             Power Toys</a> -- Try CmdWinHere, Deskman virtual desktop [ltegeler], TweakUI, PowerCalc</p> 
   <p>TweakUI settings, Start->Programs->Power Toys->TweakUI</p>
         <ul><li>
            General -- Uncheck <code>Optimize hard disk when idle</code>.  Periodically run
            <code>Start->Programs->Accessories->System Tools->Disk defragmenter</code>
         </li><li>
           General->Focus -- turn off  "Prevent applications from stealing focus."
         </li><li>
            Mouse->Hover -- Hover time = 50 ms
         </li><li>
            Mouse->Wheel -- Scroll by 20 lines at a time
         </li><li>
            Explorer  -- Uncheck <code>Prefix "Shortcut to"</code>
         </li><li>
         </li><li>
            Explorer->Customizations -- Folders=0
         </li><li>
            Common Dialogs->Places Bar -- Ignore since many applications do not read these settings.
             See <rf:iref item="win-setup"/> for using your Desktop as a mirror of the
             <code>Links</code> menu.
         </li><li>
             Taskbar and Start Menu->Grouping -- Change <code>Button Grouping</code> to "with at
             least 6 windows".
         </li><li>
            My Computer->Special Folders -- Create 'Favorites' and 'Desktop'  folders in your config
            directory.  Then change the location of these folders from <code>Documents and
               Settings</code> to your own config folder.  Makes it easier to backup and manage. 
            <code>Favorites/Links</code> is the Links directory
            for Explorer.  Consider moving your 'My Documents'  and 'Download' folders as well.
            Alternatively, you can use Explorer to move these folder from <code>Documents and
               Settings</code> to your config folder.
         </li><li>
            If you install programs for all users, their icons go into Documents and Settings->All
            users->Desktop
         </li><li>
            Sorting Favorites->Links -- If you have Links selected in Explorer, right-click->Sort by
             Name.  Otherwise, use Internet Explorer to sort your Favorites->links directory.
         </li><li>
         </li><li>
         </li><li>
            
         </li><li>
            Internet Explorer -> View Source -- TextPad
         </li></ul>
<p>Other notes</p>
          <ul><li>
              CmdWinHere -- Adds a context menu item to launch a command shell at a directory.  To fix the window settings, see <rf:iref item="setup-cmd"/>.    Switch
              to bash by typing <code>bash</code>.
          </li><li>
              CmdWinHere w/o PowerTools -- Create an Explorer action with
              <code>Explorer->Tools->Folder Options->File Types->Folder->Advanced->New</code>.  Set
              the program to <code>%SystemRoot%\system32\cmd.exe /K cd "%1"</code> [ssteward]
          </li><li>
          </li><li>
          </li></ul>
      </rf:item>
      <rf:item id="setup-opera" title="Setup Opera" date="Oct 2005" author="bbarber">
         <p><a href="http://www.opera.com/">Opera</a> is a free browser with a tabbed interface and gesture UI.  Excellent bookmark orgranizer.  Excellent download manager.
         </p>
         <ul><li>
             Configure Opera --
             Find <code>opera6.ini </code> in <code>C:\Documents and Settings\...\Application Data\Opera\Opera\profile</code>.
            <br/>- Hot List File Ver2=D:\cbb\config\Opera7.adr
            <br/>- Download Directory=d:\download
         </li><li>
            Right click Toolbar->Customize->Buttons -- Add Google Search, Right-click and remove other searches.
         </li><li>
            View->Toolbars->Panels -- In new left panel, click Bookmarks, then right-click left panel and uncheck "Show panel toggle..."
         </li><li>
             Options->Toolbars -- Click on leftmost navigator panel.  Hide the panel by setting <code>Placement=Off</code>
         </li><li>
            View->Sidebars -- select History
             </li><li>
                 <a href="http://nontroppo.org/wiki/WebDevToolbar">Web Developer</a> toolbar and
                 menu -- excellent collection of links and tools
             </li><li>
             </li><li>
             </li><li>
             </li><li>
                 
             </li></ul>
      </rf:item>
      <rf:item id="setup-firefox" title="Setup Firefox" date="Jan 2006" author="bbarber">
         <p><a href="http://www.mozilla.org/products/firefox/">Firefox</a> is a full replacement for Internet Explorer, except for IE-centric websites.
         </p>
         <ul><li>
            Install Firefox from the free download.
         </li><li>
            View->Sidebars -- select History
         </li><li>
            Tools->Options->Downloads->Download Directory->Other...->d:\download\installers
         </li><li>
            Tools->Options->Advanced -- Select "Begin finding..."
         </li><li>
         </li></ul>
         <p>Useful extensions and plugs:</p>
         <ul><li>
             <a href="https://addons.mozilla.org/en-US/firefox/addon/1865"
                 >AdBlock Plus</a> -- Block ads with <a href="https://addons.mozilla.org/en-US/firefox/addon/1136"
                     >AdBlock Filterset G</a>.
         </li><li>
         </li><li>
             
            <a
               href="https://addons.mozilla.org/extensions/moreinfo.php?id=35">IEView</a>
            -- Add context menu to view link in IE.  

             <p>To view networked drives</p>
             <ul><li>
                 Open Tools->Extensions->IE View->Options
             </li><li>
                 Set IE Location -- C:\Program Files\Internet Explorer\IEXPLORE.EXE
             </li><li>
                 Add Site -- file://library
             </li><li>
             </li></ul>
         </li><li>
            <a
               href="https://addons.mozilla.org/extensions/moreinfo.php?id=532">LinkChecker</a>
            -- Check all links on a page.
         </li><li>
             <a href="https://addons.mozilla.org/en-US/firefox/addon/3829">Live HTTP</a> -- Show HTTP headers.  An alternative is <a href="http://www.fiddlertool.com">Fiddler2</a>.
         </li><li>
            <a href="https://addons.mozilla.org/extensions/moreinfo.php?id=1192">XPather</a> -- show
            XPath expression for any element.  
            Requires custom install of Firefox with "Developer Tools" (i.e., DOM Inspector).
         </li><li>
            <a href="https://addons.mozilla.org/extensions/moreinfo.php?id=60">Web Developer bar</a> --
            useful items for web development (e.g., outline block-level elements)
         </li><li>
            <a href="https://addons.mozilla.org/extensions/moreinfo.php?id=115">ReloadEvery</a> --
            Reload every n seconds.    Use 0.6.1 for Firefox 1.0.  Should reload on file update, but
            it isn't available (It may be added to Web Developer Bar).
         </li><li>
             <a
                 href="http://jennifermadden.com/scripts/ViewRenderedSource.html">ViewRenderedSource</a>
             -- Color-coded source tree just before it displays.
         </li><li>
             <a
                 href="https://addons.mozilla.org/extensions/moreinfo.php?id=1815&amp;application=firefox">Console2</a>
            (Firefox 1.5)  -- Replacement for JavaScript Console 
         </li><li>
             Consider <a
                 href="https://addons.mozilla.org/extensions/moreinfo.php?id=1843&amp;application=firefox">FireBug</a>
             (alpha) for debugging Javascript
         </li><li>
         </li><li>
         </li><li>
         </li><li>
             
         </li></ul>
      </rf:item>
       <rf:item id="setup-hardcopy" title="Setup Hardcopy" date="Apr 2006" author="bbarber">
           <p><a href="http://www.hardcopy.de/hardcopy/english/">Hardcopy</a> -- Free image capture and
               editing.   For just image capture, consider <rf:iref item="setup-mwsnap"/></p> 
           <ul><li>
               <code>Settings->Options->Save</code> to <code>Jpeg Interchange  (Standard)</code>
           </li><li>
           </li><li>
           </li><li>
           </li></ul>
       </rf:item>
       <rf:item id="setup-mwsnap" title="Setup MWSnap" date="Apr 2006" author="bbarber">
           <p><a href="http://www.mirekw.com/winfreeware">MWSnap </a> is a free image clip utility.  
               It is easy to use for reporting bugs.  For many more features, see <rf:iref
                   item="setup-hardcopy"/></p>
           <ul><li>
              Tools->Settings->General -- Select <code>Minimize to tray</code>, <code>Minimize on
                  closing</code>    
           </li><li>
               Tools->Settings->Snaping->Delay before snapping  -- Reduce to 400
           </li><li>
               Tools->Settings->Snaping  -- Select <code>Auto copy snapped images</code>    
           </li><li>
               Tools->Settings->Snaping  -- Uncheck <code>Restore MwSnap after snapping</code>    
             </li><li>
                 In the Snap panel -- Select <code>Any rect. area</code>
             </li><li>
                 Snap any area (or press space) -- Click once for upper-left.  Click again for
                 lower-right.   Another space allows you to reset upper-left.
             </li><li>
                 Paste your image into a file.
             </li><li>
             </li><li>
             </li></ul>
       </rf:item>
        <rf:item id="setup-putty" title="Setup PuTTY" date="May 2008" author="bbarber">
            <p><a href="http://www.chiark.greenend.org.uk/~sgtatham/putty">PuTTY</a> is an excellent graphical client for SSH, telnet, and rlogin. 
            </p>
            <p>Configure PuTTY's default settings</p>
            <ul><li>
                Open PuTTY -- "Default Settings" is selected.
            </li><li>
                Session->Logging -- Change <code>Log file name</code> to <i>putty-any-&amp;Y&amp;M&amp;D&amp;T.log</i>
            </li><li>
                Terminal -- Set <i>Auto wrap mode initially on</i>
            </li><li>
                Window -- Set <code>Rows</code> to 60 and <code>Lines of scrollback</code> to 9000.
            </li><li>
                Window->Behaviour -- Uncheck <i>Warn before closing window</i>
            </li><li>
                Connection->SSH->Auth -- If using pagent, Check <i>Allow agent forwarding</i>.  At startup, run <code> ./pageant ~/.ssh/bbarber-ispy-20091205.ppk</code>
            </li><li>
                Save your settings -- In <code>Session</code>, select "Default Settings".  Then click <code>Save</code>
            </li></ul>

            <p>Configure a connection</p>
            <ul><li>
                Session -- set Host Name
            </li><li>
                Session->Logging -- Change log file for the connection name.
            </li><li>
                Window->Behaviour -- Set the Window title.  Alternatively, set the title in the host's .bashenv (<code>export PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME/a172.26.105/}\007"'
                </code>).  It also works for XTERM.
            </li><li>
                Save the connection -- In  <code>Session</code>, enter the connection name and click <code>Save</code>
            </li><li>
            </li></ul>
            
            Create an quick launch alias
                <ul><li>
                    QuickLaunch->right click->Open Folder -- Create a new folder called "machines".
                </li><li>
                    Make a short cut to putty.exe in the machines folder.
                </li><li>
                    Rename the shortcut to your connection
                </li><li>
                    Right-click the short cut->Properties -- Append <i>-load "connection-name</i> to <code>Target</code> to 
                </li></ul>
            
            Save your PuTTY configuration.  
            <ul><li>
                PuTTY stores its connections and configuration in the Windows registry
            </li><li>
                To save the configuration -- <code>regedit //ea putty.reg 'HKEY_CURRENT_USER\Software\SimonTatham\PuTTY' >PuTTY-config.reg</code>
            </li></ul>
        </rf:item>
           <rf:item id="setup-textpad" title="Setup Textpad" date="Oct 2005" author="bbarber">
         <p><a href="http://www.textpad.com">Textpad</a> is a full replacement for Notepad.  Recommended.
             Alternatives include <a href="http://notepad-plus.sourceforge.net">NotePad++</a>
             and <a href="http://www.notetab.com/">NoteTab</a> 
         </p>
               <p>Configure TextPad</p>
         <ul><li>
            Click Textpad.exe (doesn't require an installer)
         </li><li>
             Close all other instances of Textpad (otherwise these changes will be overwritten)
         </li><li>
             Configure->Preferences->General -- uncheck "Display startup"
         </li><li>
            Configure->Preferences->File->Recent Files/Workspaces --- change both to 15
         </li><li>
             Configure->Preferences->Document Classes->Default->Tabulation -- Change 'indent' from 8
             to 4
         </li><li>
            Configure->Preferences->Associated Files --- add .txt
         </li><li>
            Configure->Preferences->Editor->Keystroke compatibility -- change to Microsoft Applications
         </li><li>
             Configure->Preferences->Keyboard -- Change SearchFindPrevious to Shift+F3.   Select
             SearchFindPrevious, Press Shift+F3, Click Assign, Select Shift->Ctrl->F, Click Remove
         </li></ul>
               
              <p>Hints</p>
               <ul><li>
                   Prefer Textpad for editing -- Consider using Textpad instead of the built-in editor for  web applications.   For example, keep a working copy for Wiki pages that you change frequently.   It helps prevent lost work.
               </li><li>
                   File->Workspace->Save As -- Open a file, then save as a workspace in your
                   config directory.   Name it "Textpad Files" and drop into your Quicklaunch.
               </li><li>
            Column cut &amp; paste -- drag select a column while holding down the Alt key.  
         </li></ul>
      </rf:item>
      
      <rf:item id="setup-iis" title="Setup IIS" date="Oct 2005" author="bbarber">
         <p>Internet Information Services (IIS) is Microsoft's web server.  See also<rf:iref
             item="bash-iis"/>,                <a href="http://www.microsoft.com/windows2000/en/server/iis/">Microsoft IIS
                 documentation</a>
         </p>
         <p>To create a new web site:</p>
         <ul><li>
            Control Panels->Administrator Tools->Internet Information Services -- expand your
            computer
         </li><li>
            right-click Default Web Site->New->Virtual Directory -- select a name and directory. 
            The URL is http://computername/webname
         </li><li>
             Assign virtual web site -- To create a new web site, set the <code>Host Header Name</code>
             (e.g., www.mysite.com).   It can be configured later with right-click
             <code>yourSite->Properties->Web Site->Advanced->Add->Host Header value</code> (TCP port
             = 80).   If so, you need to restart IIS by right-click <code>yourServer->All
                 Tasks->Restart IIS</code>
         </li><li>
            To add default.html as the default, right-click <code>yourSite->Properties</code> and set the default file.
         </li><li>
             Content Expiration -- See the http caching links in the xml-faq.    As a workaround,
             use <code>IIS Manger->website->Properties->HTTP Headers->Enable Content Expiration->Expire
                 Immediately</code>
         </li><li>
             MIME types -- Define MIME types for file extensions.  They are required in MS Server
             2003.  <code>IIS Manager->website->Properties->HTTP Headers->MIME Types</code>.  There
             are many MIME Types, e.g., <code>text/plain</code> and <code>text/xml</code>
         </li><li>
             logging -- Turn on logging with <code>your_web_site->Properties->Web Site</code>. 
             Select  <code>Enable logging</code> and <code>Enable
             logging->Properties->Advanced->Referer</code>.  Analyze the log with 
             <rf:iref item="setup-analog"/>
         </li></ul>
          Useful commands
          <ul><li>
              iisext (<a href="http://support.microsoft.com/kb/328360/EN-US/">doc</a>) -- Manage IIS Web Service Extensions from the command line
          </li><li>
             Programmatic Administration Guide -- IIS Help documentation on administrating IIS
          </li><li>
              <a href="http://www.isapirewrite.com/">ISAPI_Rewrite</a> -- IIS implementation of
              mod_Rewrite
          </li><li>
              Network drives -- Windows Server 2003 does not allow access to mapped drives from IIS.
               To use network resources, supply a UNC path.  See Microsoft's
              <a href="http://support.microsoft.com/kb/207671/EN-US/"
                  >How to access network files from IIS applications</a> and
              <a href="http://support.microsoft.com/kb/257174"
                  >Using Mapped Drives with IIS</a>
          </li><li>
          </li><li>
          </li><li>
          </li><li>
          </li><li>
              
          </li></ul>
      </rf:item>
       <rf:item id="setup-analog" title="Setup Analog" date="July 2007" author="bbarber">
           <p><a href="http://www.analog.cx/">Analog</a> is a free website analyzer with extensive
           customization. </p>
           <ul><li>
               Download the installer.
           </li><li>
               Extract into <code>C:\Program Files</code>
           </li><li>
               Edit <code>analog.cfg</code>.  
           </li><li>
               Set LOGFILE to the location of your logs.  Use '*' as
               wildcard.
           </li><li>
               Set OUTFILE to the desired output file
           </li><li>
               Set IMAGEDIR to the images for OUTFILE.  Copy the images in <code>analog
                   6.0/images</code> to this location
           </li><li>
               Click on analog.exe to generate the report.  Consider the following customizations.
           </li><li>
               REQFLOOR 1r -- Get all requests
           </li><li>
               FROM 070101 -- Statistics since 1/1/2007
           </li><li>
               DNS WRITE -- look up all DNS names and cache the result.
            </li><li>
                DIRSORTBY REQUESTS -- sort directories by requests instead of bytes
            </li><li>
                HOSTSORTBY REQUESTS
            </li><li>
                PAGEINCLUDE *.xml -- count xml files as pages
            </li><li>
                FILEINCLUDE /xml/* -- If first, only report on files that match /xml/*
            </li><li>
                FILEEXCLUDE /img/* -- Exclude images from the report
            </li><li>
                FILEALIAS /db-trunk/build/*,* /db-build/$1.html -- Rewrite URLs to treat many URLs
                the same.
            </li><li>
                analog 6.0\examples\big.cfg -- Lots of other settings to try.  Also read the
                documentation.
            </li><li>
            </li><li>
                
           </li></ul>
       </rf:item>
      <rf:item id="vpn" title="Setup VPN" date="Nov 2005" author="jbell">
         <p>VPN is a protocol for a virtual private network.  Other techniques include VNC and SSH2. 
            To configure VPN</p>
         <ul><li>
            Control Panel->Network Connections->New Connection Wizard->Next->Connect to internet at
            my workplace->Virtual Private Network -- Enter a name and the IP address for the VPN
            connection.  
         </li><li>
            Create icon on your desktop.  Configure for your use only.  Click <code>Finish</code>
         </li><li>
            The VPN connect dialog will automatically launch. 
         </li><li>
            Connect VPN->Properties->Options -- Check <code>Include Windows logon domain</code>
         </li><li>
            Connect VPN->Properties->Advanced->Internet Connection Sharing  -- Uncheck <code>Allow other network users</code>
         </li><li>
            Connect VPN->Properties->Advanced->Windows Firewall -- Select <code>Off</code> only if
            you another hardware or software firewall
         </li><li>
            Connect VPN->Properties->Advanced->Windows Firewall->Advanced -- If using a firewall,
            make sure that the VPN connection is enabled.
         </li><li>
            Login with the given username, password, and Login domain.  These credentials are
            different from your network credentials at work.   
         </li><li>
            Use <rf:iref item="remote-desktop"/> to access your computer.
         </li></ul>
      </rf:item>
      <rf:item id="remote-desktop" title="Setup Remote Desktop" date="Nov 2005" author="bbarber">
         <p>Microsoft's remote desktop provides remote access to Windows sessions.  An alternative
             is <rf:iref item="remote-assistance"/>.</p>
          <p>To allow remote users to access your computer</p>
          <ul><li>
              Control Panels->System->Remote -- Check <code>Allow users to connect remotely</code>
          </li><li>
              Control Panels->System->Remote->Select Remote Users  -- Check <code>Allow users to connect remotely</code>
          </li><li>
              Control Panel->User Accounts -- If you are not on an intranet, create local users as needed and assign to the appropriate
              group. 
          </li><li>
              Passwords required -- Passwords are required to log on remotely.  Otherwise, remote
              login returns "Unable to log you on because of an account restriction".
          </li><li> 
              Only one connection -- XP SP2 only allows one connection at a time.   For a discussion
              see <a href="http://sig9.com/articles/concurrent-remote-desktop">Concurrent Remote
              Desktop</a>.
          </li><li>
              No access -- Can you ping the machine?   If not, check its firewall.  It may be
              blocking ping and remote desktop requests.   Is remote desktop enabled?  Double-check
              the previous steps.
          </li></ul>
          <p>To create a configuration file with access to your local disks and quick login (both
            machines must be secure):</p>
         <ul><li>
             Create <code>machines</code> folder on your desktop.    If you prefer a sub-menu from
             the taskbar's Quick Launch, <code>right-click Quick Launch->open
                 folder->New->Folder</code>.    Place the <code>machines</code>  folder at the end
             of the Quick Launch menu.    If you prefer quick access from the Links
             Toolbar, create the <code>machines</code> folder in Documents and
             Settings->your-ID->Favorites->Links.
         </li><li>
            Start->Programs->Accessories->Communications->Remote Desktop->Options -- Enter the
            computer name, user name, and password.  
         </li><li>
            Local Resources -- Check  <code>Disk drives</code>.  
           </li><li>
            General->Save As -- Save the configuration file to your <code>machines</code> directory.
         </li></ul>
         <p>For one-time
            use, Run the following command with the machine-name: <code>mstsc
               -v:machine-name</code>.  For quick setup using a link:</p>
         <ul><li>
            Create 'machines' folder on your desktop
         </li><li>
            Start->Programs->Accessories->Communications -- Ctrl-drag Remote Desktop  to the 'machines' folder
         </li><li>
            Rename the newly created alias to the machine's name.
         </li><li>
            Right-click the alias->Properties->Target -- Add '-v:machineName' (e.g.,
            -v:donai).    Add '/console' if you want to attach to the console session (the same
            session that you use at the machine itself).    /console does not work for networked
             computers running XP (use Windows Server or <rf:iref item="remote-assistance"/>).
         </li><li>
            Double-click the alias and log in. 
         </li><li>
            Use fully qualified DNS names.
         </li></ul>
         <p>Hints</p>
         <ul><li>
             Restart remote computer -- Run <code>shutdown -t 0 -r </code>  (After 0 seconds,
             shutdown and restart).  Use -f to force applications to close without warning. 
         </li><li>
             Restart remote computer via Start menu -- On the remote computer, <code>Start->Windows
                 Security->Shut Down->Shut Down</code> [mliang]
         </li><li>
             To restart without login -- Run <code>shutdown -m '\\computername'  -t 0 -r </code>  
             You may need to connect to the computer first using <code>Explorer</code>.
         </li><li>
             "The terminal server has exceeded the maximum number of allowed connections"  -- Only
             two adminstrator logins are allowed at one time.  Either close one of the logins or
             restart from a remote machine using <code>shutdown -m '\\computername' -t 0 -r </code>
             .Microsoft suggests using <code>mstsc /console myremote.rdp</code>, but this does not
             appear to help.
         </li><li>
             taskmgr -- Add the task manager, <code>c:/WINDOWS/system32/taskmgr.exe</code>, to QuickLaunch. 
             Alternatively, use Ctrl-Shift-Esc when you are full-screen.
         </li><li>
             <rf:iref item="blank-desktop"/>
         </li><li>
         </li></ul>
      </rf:item>
       
          <rf:item id="remote-assistance" title="Setup Remote Assistance" date="Nov 2005" author="bbarber">
           Remote assistance may be used in place of  <rf:iref item="remote-desktop"/>.  It allows
            someone else to control your computer, chat, and send files.   It may be used to control
              two computers from one keyboard without using Windows Server 2003.   [bbarber 7/2007]
              Unfortunately the lease expires, requiring a new set up.  Hardly worth the bother.
          <ul><li>
              Control Panels->System->Remote -- Check <code>Allow remote assistance ...</code>- 
          </li><li>
              Follow the instructions for sending an invitation as a file <a
                  href="http://www.microsoft.com/windowsxp/using/helpandsupport/learnmore/remoteassist/viafile.mspx">How
              to request remote assistance</a>
          </li><li>
          </li><li>
              You will need an email client.   If using the <a href="http://www.blat.net/">blat</a> 
              (<rf:iref item="cmd-win"/>):
              <ul><li>
                  Save the invitation in C:\
              </li><li>
                  blat -s 'remote invitation' -attach \RAInvitation.msrcincident
              </li><li>
              </li><li>
              </li></ul>
          </li><li>
              Save the invitation into a 'machines' folder in your favorites/Links --  You can then
              invoke it from Windows Explorers/Links.
          </li><li>
              On the remote machine, open Windows Task Manager ('ctrl-shift ESC') before taking
              control.  Otherwise, you will lose control when you need to monitor tasks.
            </li><li>
            </li><li>
            </li><li>
                Avoid using the ESC key -- it exits your session.  So does any combination using the
                ESC key.
            </li><li>
                Do not close the Remote Assistance window -- If you do, the next ESC will
                permanently drop your session.  You will need to reboot the computer before
                reconnecting.
               
            </li></ul>
      </rf:item>
      <rf:item id="setup-beyondcompare" title="Setup Beyond Compare" date="Jan 2006" author="bbarber">
         <p><a href="http://www.scootersoftware.com/">Beyond Compare</a> is an excellent file and
            directory diff program.   Also see <rf:iref item="merge-diff"/></p>.
         <p>Set up</p>
         <ul><li>
            Tools->Options->General -- Check <code>Include Beyond Compare in Explorer context menus</code>
         </li><li>
            Tools->Options->Startup -- Check <code>Show dialog with quick comparison</code>
         </li><li>
            Tools->Options->Startup -- Select <code>Rules-based quick compare</code>
         </li><li>
            Tools->Options->Startup -- Check <code>Open viewer automatically</code>
         </li><li>
            Tools->Options->File Viewer -- Check <code>Open to first difference</code>
         </li><li>
            Tools->Options->Open With -- Change Notepad to Textpad (if you have it) with command
            ilne <code>C:\bin\TextPad\TextPad.exe "%f"(%l)</code>
         </li><li>
            Tools->Export Settings -- Save all settings in your config directory for the next
            install.
            </li><li>
               View -- Select <code>Side-by-Side layout </code>
            </li><li>
               View -- Select <code>Ignore unimportant differences</code>
            </li><li>
               View -- Select <code>Line details</code>
            </li><li>
                To compare zip files, Change 'Zip Extensions' in
                Tools&gt;Options&gt;Folder View&gt; to "zip;jar;ear;war;dar". To compare embedded zip
                files, unpack the distribution first.
            </li><li>
                Beyond Compare is a good replacement for Vault's and Perforce's Diff tools (see their
                configuration options).   Perforce Diff works better than Beyond Compare on large
                XML files.
            </li><li>
                <a href="http://www.scootersoftware.com/support.php?c=kb_removablemedia.html"
                    >Thumb drive</a> -- Beyond Compare may be deployed on thumb drive without using
                 an install or the registry.  Use this technique for customized rule sets.
            </li></ul>
          
          <p>To report differences between files in two directories</p>
          <ul><li>
              Select one folder as the left side
          </li><li>
              Select the other folder as the right side
          </li><li>
              In BeyondCompare
          </li><li>
              Set Session->Comparison Control->Rules-based comparison
          </li><li>              
              Set Session->Comparison Control->Automatically scan subfolders in background
          </li><li>              
              Set Session->Comparison Control->Only expand subfolders with differences
          </li><li>              
              Set View->Display Filters->Mismatches but not orphans.    Include orphans if you want
              to see files that are in one folder but not the other.
          </li><li>              
              Set Tools->Options->File Viewer->Number of context lines to 2 (or whatever you wish)
          </li><li>
              Using ctrl-click, select the files that you want to report.   Unfortunately, selecting directories
              disables the File Differences Report
          </li><li>
              Run Actions->File Differences Report
              <ul><li>
              Set Side-by-Side
              </li><li>              
              Set Report Options to “Differences with Context”
                  </li><li>
              Run Print Preview to check your comparison.   Beyond Compare provides many options to
                      adjust the comparison and identify differences.                      
                  </li></ul>
          </li><li>
          </li><li>
          </li></ul>

      </rf:item>
        <rf:item id="setup-postgres" title="Setup Postgres" date="Jun 2008" author="bbarber">
            <p><a href="http://www.postgresql.org/">Postgres</a> is a open source database.</p>
           <ul><li>
               standard_conforming_strings -- By default Postgres uses non-standard characters for regex searches (e.g., '_' is the arbitrary character symbol).    To fix this behavior, add <code>standard_conforming_strings = on</code> to the <code>postgresql.conf</code> file.
             </li><li>
             </li></ul>
        </rf:item>
       <rf:item id="setup-scheduled" title="Setup scheduled task" date="Sept 2006" author="bbarber">
           <p>To add a scheduled task</p>
           <ul><li>
               Write bat file -- Write a .bat file that you want executed periodically, <rf:iref
                   item="setup-bat"/>.  Add <code>ping wait.some</code> at the end to keep the window
               visible for a short time.
           </li><li>
               Start->Options->Scheduled Tasks->Add Scheduled Task -- Use <code>Browse</code> to
               select your bat file.
           </li><li>
               Name the task, set frequency -- For hourly or more frequent tasks, set <code>Daily</code>.   Then in
               <code>Properties->Schedule->Advanced</code>, configure the hourly repetition.
           </li><li>
               Right-click->run -- Run the task.  Then right-click on the window bar to configure
               the window, <rf:iref item="setup-cmd"/>.  Use dark-orange text to distinguish
               from a normal window.
           </li><li>
           </li></ul>
       </rf:item>
      <rf:item id="setup-debugging" title="Setup Debugging" date="Nov 2005" author="bbarber">
          See also <rf:iref item="setup-sysinternals"/>
         <ul><li>
            Install <a href="http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx">Microsoft
               Debugging Tools for Windows</a> -- kernel debug and MS symbol loader.
         </li><li>
            qslice (Windows 2000 resource kit) -- show CPU time by process <rf:iref item="russME_2005" page="18"/>
         </li><li>
             <rf:iref item="setup-logparser"/> -- process log files and tabular data
         </li><li>
            Dr. Watson (drwtsn32) -- crash debugger from Microsoft.  For usage instructions see  <rf:iref item="russME_2005" page="117"/>
         </li><li>
            cpustres (Platform SDK) -- CPU stress tool  <rf:iref item="russME_2005" page="355-357"/>
         </li><li>
            Regentry.chm  (Windows 2000 resource kit) -- documentation for registry keys and values
            <rf:iref item="russME_2005" page="80"/>.
            Broken link at <code>http://www.microsoft.com/windowserver2003/techinfo/reskit/deploykit.mspx</code>  -- registry info, regentry.chm <rf:iref item="russME_2005" page="184-191, 197-207"/>
         </li><li>
             <a href="http://www.ollydbg.de/">OllyDbg</a> -- A 32-bit assembler level debugger for Windows. OllyDbg features an intuitive user interface, advanced code analysis capable of recognizing procedures, loops, API calls, switches, tables, constants and strings, an ability to attach to a running program, and good multi-thread support. 
         </li><li>
            pmon (Windows support tools) -- system and process memory information.  For memory leaks, check private committed virtual memory  <rf:iref item="russME_2005" page="379-381"/>
         </li><li>
            Application Verifier tool, like Driver Verifier 
         </li><li>
            SPTCC_TOL.doc (Windows Server 2003 Tools for Troubleshooting) -- using Microsoft tools
            for debugging           
         </li><li>
            pfmon (Windows XP Support Tools) -- page fault monitor  by process <rf:iref item="russME_2005" page="474"/>
         </li><li>
            msinfo -- system configuration including drivers, environment variables, services, etc.  <rf:iref item="russME_2005" page="699"/>
         </li><li>
            Network Monitor (Windows component) -- watch network activity  <rf:iref item="russME_2005" page="834"/>
         </li></ul>
      </rf:item>
       
       <rf:item id="setup-depends" title="Setup Dependency Walker" date="Aug 2007"
           author="bbarber">
           <p><a href="http://www.dependencywalker.com/">Dependency Walker</a> is an excellent utility for
               understanding dll's and their many dependencies.  Shows missing dll's and other dependency errors. </p>
        Includes excellent documentation.
           <ul><li>
                Options->Configure handled file extensions -- Add EXE and DLL for right-click access
                from Explorer.
           </li><li>
               Options->Configure Module Search Order -- Investigate missing dependencies by reviewing the
               module search order.  On XP and later, Side-by-side components
               (<code>windows\winsxs</code>) may be defined by the
               <code>.manifest</code> file or <code>RT_MANIFEST</code> resource.
           </li><li>
               
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li></ul>

          <p>With Dependency Walker and Process Monitor, you can collect detailed logs of a
          program's activity</p>
           <ul><li>
               <a
                   href="http://www.microsoft.com/technet/sysinternals/utilities/processmonitor.mspx">Process
               Monitor</a> (procmon)
               -– Monitor file, registry, and process activity
           </li><li>
               Dependency Walker profile –- Monitor DLL calls.
           </li><li>
               Configure Dependency Walker for profiling
               <ul><li>
                   Launch depends.exe -- If running a 32-bit app on a 64-bit machine use the 32-bit version of depends
               </li><li>
                   Open the exe file 
               </li><li>
                   Configure Profiling -- Open <code>Profile->Start profiling</code>
                   and select these options
                   <ul><li>
                       Log LoadLibrary
                   </li><li>
                       Log GetProcAddress
                   </li><li>
                       Log First Chance Exceptions
                   </li><li>
                       Log Debug output messages
                   </li><li>
                       Use full paths
                   </li><li>
                       Automatically open and profile
                   </li></ul>
               </li></ul>
           </li><li>
               Set up Procmon
               <ul><li>
                   Launch Procmon
               </li><li>
                   Stop the log on procmon (the icon looks like a magnifying glass).
               </li><li>
                   Clear the log  (the icon looks like an eraser).  
               </li></ul>
           </li><li>
               Capture the logs
               <ul><li>
                   Turn on the log  (the same icon as ‘stop’)
               </li><li>
                   Start the application by clicking 'OK' in Dependency Walker's <code>Profile Module</code>
               </li><li>
                   When the problem occurs, stop the log on procmon
               </li><li>
                   Save the procmon log using <code>File->Save</code>
               </li><li>
               Save the Dependency Walker information using <code>File->Save</code>
               </li></ul>
           </li><li>
               Analyze the logs
               <ul><li>
                   Synchronize the procmon log with Dependency Walker by removing FileMon and RegMon
                   activity (the registry and file icons).  
                   <code>Load Image</code> in Procmon corresponds to <b>Loaded</b> in Dependency Walker.
               </li><li>
               When reviewing the profile log, events may be out of order due to multi-threading.  For example, modules get unloaded before an ACCESS_VIOLATION (0xc000005) gets logged.  If you have two runs on the same machine, Beyond Compare works well.
               </li></ul>
           </li></ul>
       </rf:item>
        <rf:item id="setup-systemrescuecd" title="Setup System Rescue CD" date="Mar 2008" author="bbarber">
           <p> <a href="http://www.sysresccd.org">SystemRescueCD</a> is a complete Linux system.   
          Boot Linux on a crashed system with full access to your disks and network.
           </p>
          <ul><li>
              Burn a CD -- Download an iso image and burn it onto a CD.
          </li><li>
              Boot from CD -- With the CD in your primary drive, restart your system in boot from CD mode (F12 on Dell
              computers).
          </li><li>
              Configure the network -- Type '<code>net-setup eth0</code>' to configure the network.    Use
              either DHCP or static IPs for your computer and gateway.
          </li><li>
              Start the UI -- Type '<code>wizard</code>' to start the graphical user interface.
          </li><li>
              Identify your disks  -- Run the partition program (gparted) and locate the names of
              your disk drives (e.g., /dev/sda2).
          </li><li>
              Mount read-only disks -- Type '<code>mount /dev/sda2 /mnt/windows</code>' to mount the sda2
              disk as /mnt/windows.  If you have multiple partitions, create additional directories
              in /mnt.
          </li><li>
              Mount a USB stick -- Plug in the USB stick and type '<code>dmesg | more</code>'. 
              Scroll to the first disk by entering '<code>/sda</code>.  Create an empty directory
              with '<code>mkdir /mnt/usb</code>' followed by '<code>mount /dev/sdaXX
                  /mnt/usb</code>' where XX is from dmesg.
          </li><li>
             Mount a read-write disk -- Instead of mounting a read-only disk, you can mount a disk
              for read-write with '<code>ntfs-3g /dev/sda2 /mnt/windows</code>.
          </li><li>
              Shutdown Linux -- Run the '<code>shutdown</code>' command to stop Linux.
          </li></ul>
            
      </rf:item>
       <rf:item id="setup-vmware" title="Setup VMWare" date="Oct 2006" author="bbarber">
           <p><a href ="http://www.vmware.com/">VMWare</a> provides multiple virtual machines on a
               single host.  It is particularly useful for QA.      An alternative is Norton Ghost for creating test
               environments.</p>
           
           VMWare Setup
           <ul><li>
           </li><li>
               Minimum Requirements -- VMWare requires at least 1G of memory and 1G of available
               disk..   If purchasing a system for VMWare, maximize the memory.  Use a stripped RAID
               array with multiple disk controllers.  Use a dedicated disk for the OS and its
               virtual memory.
           </li><li>
               64 bit -- VMWare requires recent chipsets to run on 64-bit hosts.  See <a
                   href="http://kb.vmware.com/vmtnkb/dynamickc.do?externalId=1901&amp;sliceId=SAL_Public&amp;command=show&amp;forward=nonthreadedKC&amp;kcId=1901">Hardware
                   requirements for 64-bit</a>
           </li><li>
               VMWare workstation -- Use VMWare Workstation to create and maintain virtual machines,
               snapshots, and clones.  It can record movies of screen activity and add devices to a
               VM.
           </li><li>
               VMWare console -- Use VMWare Console for shared access to VM images and remote admin
               of the server.   VMWare console does not require a license.
           </li><li>
               Defragment with contig -- VMWare is a voracious consumer of disk space.  Keep its
               disk images defragmented by frequently running <a
                   href="http://www.microsoft.com/technet/sysinternals/utilities/contig.mspx">Contig</a>
               (e.g., <code>contig -s c:\VMWare\*</code>)
            </li><li>
                Turn off Vista UAC -- On Vista, turn off User Access Control.  It does not work with
                scripting.  See <rf:iref item="setup-vista-security"/>.
           </li></ul>

             Setup a VMWare machine, including foreign language machines.  If managing multiple VMs,
           try to keep the configuration the same.
           <ul><li>
           </li><li>
               VMWare setup from a clone -- You can create a VM from a copy of an existing VM.   The
               VM should not contain many snapshots, nor a lot of usage.  Both activities
               can increase disk requirements dramatically.
               <ul><li>
                   Copy the clone directory to your local disk.   Copying a directory is faster
                   than using VMWare's <code>Clone</code> operation.   Be sure you have several
                   gigabytes of free
                   space.  If building multiple VMWare images, copy the image from the network, then
                   recopy that image locally.
               </li><li>
                   Do not delete snapshots -- Apparently, VMWare requires all disks and
                   snapshots for an image.
               </li><li>
                   Edit the
                   <code>.vmx</code> file.  -- Delete the <code>ethernet0.generated*</code> lines; they
                   will be recreated.   
               </li><li>
                   Rename the clone -- Use the same name for  the disk
                   directory and VMWare's displayName.  Edit the <code>.vmx</code> file and change <code>displayName="VMWare_name_for
                       clone"</code>.
               </li></ul>
           </li><li>
               Open a VM -- Double click a vmx file, or create a new image.
           </li><li>
               Pick memory size (e.g., 500 Megs) -- It limits how many VMs can run at once.  As rule
               don't exceed physical memory minus 500 MByte for the OS.
            </li><li>
               Turn off unused devices -- Before starting the VM, turn off devices that you are not
                using.   Double-click each device and deselect <code>Connect at power
                    on</code>.
            </li><li>
                Add the VM to your favorites -- Right-click the tab and select <code>Add to
                    favorites</code>, or use the menu, <code>File->Add to Favorites</code>.
            </li><li>
                Start the VM -- Click-through to <code>Create</code> a new identify.  It also
                generates a new ethernet address (i.e., <code>ethernet0.generated*</code>)
            </li><li>
               Install an operating system if starting from scratch.  
            </li><li>
                Register Windows -- If prompted, register windows by clicking through the prompts.
           </li><li>
               Set keyboard to English -- Set the default keyboard if needed, <code>Control
                   Panel->Region and Language Settings->Language (Tab #2)->Details</code>.    For quick
               changes, use the language tab on the task bar or <code>Alt-Shift</code>.    The
               login will continue to be the native keyboard.
           </li><li>
               Create a user -- Add a user with <code>Control Panels->User Accounts</code>.   Set the domain 
               to <code>WORKGROUP</code> . 
           </li><li>
               Assign a simple password -- Remote Desktop requires a password.  Special characters do not work
               well with foreign language keyboards.  Go to <code>Control Panel->User
               Accounts->Create a new account (2nd of 3)</code>.  Then assign a password by
               selecting the user name, <code>Create a password (2nd of 4 choices)</code>.  Use the
               alphanumeric characters -- "user" works for many languages. 
           </li><li>
               Display Settings -- Right-click the screen and select <code>Properties->Settings</code>.  Change the screen
               resolution to 1024 x 768.  Set color quality to 16 bit.
           </li><li>
               Screen saver -- Set it to blank, or some other static image (<code>Control
                   Panel->Display->Screen Saver</code>).
           </li><li>
               Auto updates -- Turn off auto updates, <code>Control Panel->Security
               Center->Automatic Updates</code>.    Updates are expensive in network and disk
               resources.  Instead of auto update, periodically revert to the image's snapshot,
               install updates, and take a new snapshot.
           </li><li>
               System restore -- Turn off system restore, <code>Control Panel->System->System
               Restore</code> or <code>Start->run->msconfig->System Restore</code>.   
               Restore uses a lot of disk space.   Restore a VM from a snapshot or
               archived
               image.
           </li><li>
               Firewall  -- Enable remote desktop and ping.  Set <code>Allow incoming echo requests
                   (1st of many)</code> in <code>Control Panel->Security->Windows
               Firewall->Advanced->ICMP Settings</code>.  Allow
               <code>Exceptions->Remote Desktop</code>
           </li><li>
               Enable remote desktop -- Enable remote desktop from <code>Control
                   Panel->System->Remote</code>
           </li><li>
               Adjust performance -- Select  "Adjust for best performance" from <code>Control
                   Panel->System->Advanced->Performance->Visual Effects (3rd of 4 choices on first tab)</code>
           </li><li>
               Change computer name -- Change the computer name to indicate the VM and its host. 
               <code>Control Panel->System->Computer Name</code>.  For example, a German XP system
               running on doyle could be named "wxp-de-doyle".
           </li><li>
               Install VMWare Tools -- While running the VM, install VMWare tools.  It is a
               collection of VMWare drivers and accelerators.    Run <code>VMware
                   Workstation->VM->Install VMWare tools</code>.  It will reboot the system.
           </li><li>
               Reboot -- Reboot the VM via its start menu.  Alternative run <code>shutdown -r -t
                   0</code>.   Do <i>not</i> log off or close the VMWare workstation.
                Cancelling the VM session is the same as pulling the plug on a machine.  You may
                lose work or damage the virtual disk image.  Periodically reboot to
                make sure that your changes are saved to disk.
           </li><li>
               Is the VM on the network? -- Test the network connection from another computer using
               <code>ping machine_name</code>.  If this fails, try the IP address from the VM's
               <code>ipconfig /all</code>.   If the IP works but the machine name does not,  renew
               DNS with <code>ipconfig /renew</code> on the VM.
           </li><li>
                Set up Remote Desktop -- Edit a Remote Desktop Connection [<code>Start->All
                    Programs->Accessories->Communications-></code>.   Set its Display to  1024 x 768 and Color to
                16 bit.  Set Experience to <code>Modem</code>.   Turn off disk and printer sharing. 
           </li><li>
               Save the Remote Desktop Connection -- Create a folder in your task bar's Quick
               Launch.  Then save the connection's rdp file into this folder.   If the folder is not
              visible on Quick Launch, the connection is readily selected as a menu.
            </li><li>
                Connect via Remote Desktop
            </li><li>
                Set up Explorer -- In <code>Tools->Folder Options (last one)</code>, set <code>Use
                    Windows classic folder</code>.    Unclick <code>Folder Options->Advanced
                        Settings->Hide extensions for known file types</code> (it is above one of the
                "(Recommended) settings).   In the same section, unclick <code>Show hidden files and
                folders</code> (under the Hidden... folder)
            </li><li>
                Set Explorer->View->Details and drag the <code>Date Modified</code> column between
                'Name' and 'Size'
            </li><li>
                Set up the task bar -- Right-click the toolbars.  Unlock the tool bar.  Select
                <code>Toolbars->Quick Launch (last of 4)</code>  and <code>Toolbars->Links</code>. 
                Drag the Quick Launch area below the task area by dragging below the window.
            </li><li>
                Turn off the "Shortcut to" prefix -- By default,  Windows adds "Shortcut" to every
                shortcut name.  To remove this prefix (a suffix in Vista)
                <ul><li>
                    Using regedit
                    (<code>Start->run->regedit</code>), navigate to
                    <code>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer</code>
                </li><li>
                    Change the 'link' key to '00 00 00 00' -- Double-click the key, highlight the
                    non-zero characters, and type '00'.   Takes effect on the next reboot.
                </li><li>
                    If the 'link' key does not exist -- <code>Right-click->New->Binary Value (2nd of
                    5)->OK</code> and change the name to 'link'.  If too late, right-click the key
                    and select Rename (the last option).
                </li><li>
                    For Vista, add the same key under
                    HKEY_LOCAL_MACHINE.  
                </li><li>
                    Alternatively, <rf:iref item="powertoys"/> and uncheck <code>Explorer->Settings->Prefix
                        "shortcut" ...</code>
                </li></ul>
            </li><li>
                Disable system standby -- Check that system standby is off by default.    If not,
                disable it
                from <code>Control Panel->Power Options</code>.  On the first tab, <code>Power
                Schemes</code>, select "Never" (the last option) for <code>Turn off hard
                    disks</code> and <code>System standby</code> [last two menus].
            </li><li>
                Reboot -- To lock in these changes, and instantiate the regedit change.  Remember to
                use the VM's start menu.   Do not use VMWare's Power Off.   To reboot from Remote Desktop, execute <code>shutdown -r
                    -t 0</code>.  It may take a minute or two before Remote Desktop is enabled.
            </li><li>
                Set up Quick Launch -- Copy the following shortcuts to the Quick Launch menu:
                <ul><li>
                    From <code>C:\Windows</code>, add regedit.exe .      On 32-bit applications on 64-bit machines, use
                    <code>C:\Windows\SysWOW64\regedit</code> instead.  Their registry keys are
                    virtualized.
                </li><li>
                    From <code>C:\Windows\System 32</code>,  add cmd.exe, notepad.exe, taskmgr.exe
                 </li><li>
                    From <code>Start->Accessories</code>,  copy <code>Explorer</code>
                 </li><li>
                     From <code>Control Panel</code>, create shortcuts to <code>System</code> and <code>Add/Remove
                         Programs</code>.  Add <code>Start->Control
                             Panels->Administrative Tools->Computer Management</code>.  
                 </li><li>
                     If using sysinternals, add Process Explorer.
                </li><li>
                </li><li>
                    
                </li></ul>
            </li><li>
                Configure cmd -- Configure the window attributes for cmd.
                <ul><li>
                    Launch cmd from Quick Launch and right-click the menu bar.  Select <code>properties (last
                        item)</code>.   
                </li><li>
                    QuickEdit Mode -- Select  <code>Options->Edit Options->QuickEdit Mode
                        (bottom-right box).</code>
                </li><li>
                    Lucinda Console -- Select <code>Font->Lucinda Console</code>
                </li><li>
                    50 lines -- Increase Height from 25 to 50 (<code>Layout->Window
                        Size->Height</code>.  
                </li><li>
                    999 lines -- Increase buffer size from 300 to 999 lines <code>Screen Buffer Size</code>
                </li><li>
                    Black on White -- On the <code>Colors</code> tab, make the "Screen Background"
                    white and the "Screen Text' black.
                </li><li>
                    Click OK -- Change the radio button to "Modify shortcut that started this
                    window (last choice)"
                </li></ul>
            </li><li>
                Set up Links -- Right-click the Explorer toolbar, Select <code>Links</code>.  Find
                the Links directory under <code>C:\Documents and
                Settings\yourname\Favorities</code>.  Drag it to the Links, making it easy to
                manage them.  In the Links menu, rename "Links" to "_Links".  It keeps it first so
                that drag-and-drop ends up in Links.
            </li><li>
                Continue with application-specific configuration.
            </li><li>
                Snapshot the VM -- The snapshot allows users to restore the VM to a known
                configuration.  Always shut down the VM before taking a snapshot.  It makes the
                snapshot much smaller.  Turn off background snapshots
                <code>Edit->Preferences->Priority->Snapshots</code>
            </li><li>
                Archive the VM -- Shutdown and turn off the VM (Using the VM's start menu, or
                <code>psshutdown -t 0</code>  [sysinternals]).  Then archive of the VM's disk
                directory.   The archive allows you to recreate the VM on any machine.
            </li></ul>
           
           Update VMWare archive -- If reconfiguring an image, update the archive instead of the
           current image.    Otherwise the virtual disks become full of unusable blocks.
           <ul><li>
               Shutdown  the old image -- Shut down the old VM and remove it from VMWare
               Workstation.  Rename its disk folder.  It will be deleted later.
           </li><li>
               Restore the archived image -- Restore the archived image to the VMWare folder.
           </li><li>
               
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li><li>
               
           </li></ul>
           
           Problems
           <ul><li>
           </li><li>
               Shut down -- Use the Start menu to shut down a virtual machine.  Do <i>not</i> use
               Power Off (i.e., the red square, or window close box).    Power Off is the same as
               pulling the plug.   VMWare includes an option for shut down on power off, but it
               does not work on all VMs.
           </li><li>
         
                XP Activation -- Whenever you move a VMWare instance, it needs to be reactivated.
           </li><li>
               Disk space -- VMWare uses gigabytes of disk space per image.  If you run out of disk
               space, you will need to restart each VMWare service, and then visit each virtual
               machine.  Be careful of 'abort' from the out-of-disk message from a VM.   
               VMWare was not able to recover from clicking 'abort'. 
           </li><li>
               Logon is unresponsive -- VMs take a while to  initiate the log in dialog.  You need
               to click on the password prompt even if the password is empty. [fsmietana]
             </li><li>
             Unresponsive -- The VMWare User process can hog the machine.  Check <code>Task
                Manager (ctrl-shift-esc)->Processes->VMWare User</code>.  Try restarting the VM.
             </li><li>
               Network inaccessible -- On startup, if the network is inaccessible, try restarting
               the VM [fsmietana].
           </li><li>
p               Unknown owner of lock file (lck) -- VMWare uses a lock file to prevent dual ownership
               of a virtual machine.   To free the lock, you need to shut down the VM, remove it
               from your favorites, and remove it from the VMWare windows.  VMWare does not identify who 
               locked the VM [?].  If you need
               to get rid of a locked VM, either reboot the host computer or delete or move the other
               data files.
           </li><li>
                vmware-authd.exe -- Once installed, VMWare Authorization runs forever, page faulting
                and using up memory.    It is only
                needed if you run VMWare as a non-admin user.  Shut it down from the Control
                Panel-->Administration->Services.  Also set its Properties to <code>Manual</code>. 
               Likewise, vmnat.exe and mvnetdhcp.exe run forever, but they are relatively innocuous.             
           </li><li>
                Do not run Disk Defragmenter -- Do not defragment files on the VM
                [ <a href="http://www.vmware.com/support/ws55/doc/ws_performance_defrag.html">Guest
                Fragmentation</a>].    Once you have taken a snapshot, all updates go to the
                VM's redo logs (Defragmenter writes many updates).   Only run the Defragmenter
                before creating the first snapshot.
            </li><li>
                Fragmented VMWare files -- VMWare uses gigabyte files to represent the VM's disk.   If these
                files are badly fragmented, file access, virtual memory, and registry access are slow.  Use <rf:iref
                item="setup-sysinternals"/> to defragment the VM's virtual memory and registry hives
                (<code>pagedefrag</code>) and VMWare's vmdk and vmsn files (<code>Contig
                    '*.vm*'</code>).
             </li><li>
                Clone -- Copying a VMWare directory is faster the creating an independent clone. 
                You need to update the vmx file, as described previously.
         </li></ul>

           Errors
           <ul><li>
               invalid NUMA -- A multi-processor system shows different clocks.  The virtual clocks
               may disagree.  See 
               <a href="http://kb.vmware.com/vmtnkb/search.do?cmd=displayKC&amp;docType=kc&amp;externalId=VMTN-F19-T52291-M460609&amp;sliceId=M460609&amp;dialogID=2836991&amp;stateId=0%200%202838172&amp;doctag=Forum%20Posts">
                   VMWare KB 1236
               </a>
           </li><li>
               DHCP times out, "PXE-E53 No boot filename received", dialog "No bootable CD" -- Your DHCP servers 
               are still not configured for PXE. They are offering IP address to the guest, but they do not send boot filename to the guest. 
               Configure DHCP/PXE servers you are configuring correctly... [VMWare.com
               messageID=832078].   Received after restarting a cloned Win2KSP4 FR image with a
               smoketest install.
           </li><li>
           </li><li>
           </li></ul>

Performance
           <ul><li>
           </li><li>
               Whitepapers --
               <a href="http://www.vmware.com/pdf/esx_network_planning.pdf">Network Throughput</a>
               <a href="http://www.vmware.com/pdf/esx_performance_tips_tricks.pdf">Performance Tips </a> 
               <a href="http://www.vmware.com/pdf/esx2_checklist1.0.pdf">Performance Problem Check
                   List</a>
           </li><li>
               Set memory -- For XP, set memory to 512 MB.
           </li><li>
               Turn off unused hardware devices -- Clear <code>Connect at power on</code> for
               CD-ROM, Floppy, Audio.   Need to investigate actual effect on performance.
               
           </li><li>
           </li><li>
           </li><li>
               
               <a href="http://www.vmware.com/support/ws55/doc/ws_performance_defrag.html">Guest Fragmentation</a> -- 
               Defragment the virtual machine before the first snapshot.    Then do
               <i>not</i> defragment.  It can write many disk blocks to a redo log.  
           </li><li>
               Host Fragmentation -- Keep the host files defragmented.  Contig from <rf:iref
                   item="setup-sysinternals"/> allows you to defragment the VMWare VM directory. 
           </li><li>
               Screen saver -- Use a plain screen saver for improved [?] performances, <code>Control
               Panels->Display->Screen Saver</code>
           </li><li>
               <a
                   href="http://www.vmware.com/support/ws55/doc/ws_performance_improve_winnt.html">Enable
               DMA for IDE drives</a>  -- Does this help?
           </li><li>
               <a href="http://www.vmware.com/support/ws55/doc/ws_special_acpi_guest.html">Turn off
               Guest ACPI S1 Sleep</a> -- If using remote desktop for VM access, turn off sleep. 
               Also the following line to the vmx file <code>chipset.onlineStandby=FALSE</code>
           </li><li>
              <a
                  href="http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&amp;docType=kc&amp;externalId=1687&amp;sliceId=1&amp;docTypeID=DT_KB_1_1&amp;dialogID=15255981&amp;stateId=0%200%2015253422">Page
                  faults</a>  -- Keep page faults reduced.
           </li><li>
               <a
                   href="http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&amp;docType=kc&amp;externalId=775&amp;sliceId=2&amp;docTypeID=DT_KB_1_1&amp;dialogID=15255981&amp;stateId=0%200%2015253712">Tips
               on performance</a>
           </li></ul>
           
       </rf:item>
       
      <rf:item id="reinstall-win" title="Reinstalling windows from scratch" date="Mar 2006"
         author="bbarber">
         It's best to avoid reinstalling windows.  There are lots of steps and a mistake can make
         the computer inoperable.         
         <p>These instructions are for a Dell computer.   Review
            these instructions since they may be out-of-date.</p>
         <ul><li>
            Get the drivers for your computer from Dell.   It is best to do this ahead of time and
            copy it to a CD or UPS drive.
         </li><li>
            Install Windows XP as a new installation.  For upgrade licenses, Microsoft only
            validates one machine for upgrading.  If you try to install on multiple machines, only
            the first machine will validate.  You will be able to use the OS for a month.  Sometimes you
            can convince Microsoft to validate anyway, but it takes a lot of time.
         </li><li>
            Install driver for Intel chipset
         </li><li>
            Install Dell desktop system software
         </li><li>
            Install driver for ATI video
         </li><li>
            Install Sound Blaster Live from CD
          </li><li>
             Install driver for Conexant modem
          </li><li>
             Install driver for Intel Pro/100 network
          </li><li>
             If using fixed IP addresses, right-click My Network Places->Local Area Network
             Properties->TCP/IP properties
          </li><li>
             Install printer driver if needed
          </li><li>
             Control Panel->System->Advanced->Performance->Settings->Advanced->Virtual
             memory->Change -- Set the initial and maximum size to the recommended size.  This helps
             avoid a fragmented page file.
          </li><li>
             Start->Windows Updates -- Install all critical updates for the operating system, and
             Microsoft Office.
          </li><li>
             Consider uninstalling Microsoft Outlook if you use Eudora or another mail client.
          </li><li>
          </li><li>
                Start->Programs->Accessories->System Tools->Disk Defragmenter -- Run it now, and
                several times a year.
          </li><li>
             Start->run->msconfig->System Restore->Create a system checkpoint -- it allows you to
             reset your configuration in case the registry becomes damaged.
             </li><li>
             </li><li>
                
                
             </li></ul>
          
          Other hints
          <ul><li>
              Using the operating system CD, try the second instance of repair.  It rewrites the
              boot sectors and operating system files but leaves your data and registry settings
              intact [bartonn].

          </li><li>
          </li><li>
          </li><li>
          </li><li>
          </li><li>
          </li></ul>
      </rf:item>
   </rf:section>
   <rf:section id="ms-office" title="Microsoft Office">
      <rf:item id="excel" title="Excel hints" date="Dec 2005" author="bbarber">
         <ul><li>
             Excel Help -- For concise documentation of Excel see Frey, <i>Excel Pocket Guide</i>,
             O'Reilly.
         </li><li>
             Excel Setup 
             <ul><li>
                 Turn off adaptive menus -- <code>Tools->Customize->Options->Always show full menus</code>
             </li><li>
                 Increase recent files -- <code>Tools->Options->General->Recently used</code>
             </li><li>
             </li><li>
             </li><li>
             </li><li>
             </li><li>
             </li><li>
             </li><li>
                 
             </li></ul>
         </li><li>
            Shared workbooks -- Online collaboration with many people adding and modifying data. 
            Excel keeps track of the changes and prompts for merging as needed.  Store the file on a
            shared drive and appoint one person to periodically check the file into source control. 
            Turn on by checking <code>Tools->Share Workbook->Allow changes</code>.   
         </li><li>
             <rf:iref item="sql-server-setup"/>
         </li><li>
             TSV files -- When working with a tab-separated file, turn on AutoFilter [Select the
             header line->Data->Filter->AutoFilter] and a split window [Select cell
             A2->Window->Split].
         </li><li>
             <a href="http://www.cpearson.com/excel/topic.htm">Pearson's Excel
                 topics</a> -- Help with Excel
         </li><li>
         </li></ul>
      </rf:item> 
      <rf:item id="ms-word" title="Word hints" date="Dec 2005" author="bbarber">
         <ul><li>
            Track changes -- Review and accept changes made by others.   Turn on by
            <code>Tools->Track Changes</code>.   If the document doesn't show changes
            <code>View->Markup</code>.    View change history with <code>Show->Reviewing
               Pane</code>.  Accept
            all changes from <code>View->Toolbars->Reviewing.</code>.    Before sending documents
            to customers be sure to <code>Reviewing Toolbar->Delete all Comments in Document</code>;
            otherwise the recipient may have more information than intended.
         </li><li>
            Compare and merge -- Combine multiple versions of a document with <code>Tools->Compare
               and Merge Documents</code>.   With VBA, compare and merge can be integrated with
            source control [e.g., Perforce's <a
               href="http://www.perforce.com/perforce/products/plugins-ofc.html">p4ofc</a>].
         </li><li>
            Spelling -- To remove custom words from the dictionary <code>Tools->Spelling and
               Grammar->Options->Custom Dictionaries->Modify</code>.
         </li><li>
         </li></ul>
      </rf:item> 
   </rf:section>
   <rf:section id="outlook" title="Outlook FAQ">
       <rf:item id="setup-outlook" title="Setup Outlook" author="bbarber" date="Oct 2005">
           <ul><li>
               Other->general -- Uncheck <i>Empty the delete folder on exit</i>
           </li><li>
               Reading Pane -- Adjust the reading pane by right clicking its margin.   Consider moving it to the bottom, leaving enough room to view the entire subject line.
           </li><li>
              <rf:iref item="delay-send"/>    
           </li></ul>
           </rf:item>

       <rf:item id="delay-send" title="Outlook - delayed sending of messages" author="gturi" date="Oct 2005">
         <p>Delayed sending of messages helps avoid embarrassing mistakes.</p>
          <ul><li>
              Online -- If needed, go online by clearing <code>File->Work Offline</code>
          </li><li>
              Define Send/Receive Groups -- Change the settings for "All Accounts" when Offline.  Go
              to <code>Tools->Send/Receive->Define Send/Receive Groups</code>.  Select "All
              Accounts".   Check all of the boxes and schedule an automatic send/receive every 15-30
              minutes.  Close the dialog box
          </li><li>
              Uncheck 'Send immediately when connected -- It is located at <code>Tools->Options->Mail
                  Setup->Send/Receive</code>.  Alternatively, go off-line by setting <code>File->Work Offline</code>
          </li><li>
              Immediate Send/Receive -- Double-click the Send/Receive toolbar button or press
              <code>F9</code>
          </li><li>
              Mail will be sent and received every 15-30 minutes.  Giving you more time for work
              while allowing second thoughts about unhappy emails.
          </li><li>
              Password change when offline -- If you need to reset your password due to password expiration, you
              may need to reset Outlook.  Apparently, the automatic check of connection status does
              not automatically update if you are offline.  Did not figure out how to fix this
              problem.
          </li></ul>
          
          
          <p>If you want to stay "on-line", you can define a rule to delay sending.   A problem is
              that all messages are delayed.  There is no way to immediately send a previously
              delayed message.</p>
          <ol><li>
             
            On the Tools menu, click Rules and Alerts, and then click New Rule. 
         </li><li>
            Select Start from a blank rule. 
         </li><li>
            In the Step 1: Select when messages should be checked box, click Check messages after sending, and then click Next. 
         </li><li>
            In the Step 1: Select condition(s) list, select any options you want, and then click Next. 
         </li><li>
            If you do not select any check boxes, a confirmation dialog box appears. Clicking Yes applies this rule to all messages you send.
         </li><li>
            In the Step 1: Select action(s) list, select defer delivery by a number of minutes. Delivery can be delayed up to two hours. 
         </li><li>
            In the Step 2: Edit the rule description (click on an underlined value) box, click the underlined phrase a number of and enter the number of minutes you want messages held before sending. 
         </li><li>
            Click OK, and then click Next. 
         </li><li>
            Select any exceptions, and then click Next.  Use "qw" in body text to send now.
         </li><li>
            In the Step 1: Specify a name for this rule box, type a name for the rule. 
         </li><li>
            Click Finish. 
         </li></ol>
      </rf:item>
       
       <rf:item id="outlook-memory" title="Outlook -- Hitting the storage limit"
           date="Nov 2006" author="kzhu">
           
           From time to time, you will get alert email that your mailbox is reaching its storage
           limit.
           One way to solve the problem is to move emails into your personal folder, which is stored 
           locally in your computer.
           
           <ul><li>
               How to create a personal folder -- 
               <a
                   href="http://spike.wharton.upenn.edu/consult/email/personal_folders.cfm?menu=Two">URL</a>
           </li><li>  
               Backup personal folder -- <a
                   href="http://office.microsoft.com/en-us/outlook/HA010875321033.aspx?pid=CL100626971033"
                   >Microsoft</a>
           </li></ul>   
       </rf:item>
       
       <rf:item id="outlook-clear" title="Outlook -- How to clear auto-complete addresses "
           date="Oct 2006" author="rmorgenstein">
         When you migrate Outlook, old auto-completes may no longer work in the new environment.
            If so, clear auto-completes by typing each letter, 'a' to 'z'.  Use the <code>Delete</code> key to
           delete each auto-complete that appears.
       </rf:item>
      
      <rf:item id="Eudora-outlook" title="How to use Eudora or another POP client with Outlook" date="2001" author="bbarber">
         <p>If you want to use Eudora or Netscape for e-mail</p>
         <blockquote>
            
            <p>If you are a Eudora POP user, e-mail is downloaded to your workstation or laptop. It is
               not retained on the server.</p>
            
            <p>Since Outlook uses e-mail for meeting proposals, you will not be able to respond to
               meeting requests. An easy fix is to use IMAP instead of POP.</p>
            
            <p>If you want to continue using Eudora as a POP client</p>
            
            <p>First create a new folder in your Outlook InBox, called Meeting Requests Then create a
               rule to copy meeting requests to your folder:</p>
            
<pre>
   1) Create a Rule using Tools &gt; Rules Wizard
   2) Start with a blank rule and select 'Check messages when they arrive'
   3) Select, 'Uses the form name form'
   4) Click on 'form name' in the rule description box
   5) Select 'Application Forms'
   6) Add all the forms with "Meeting"
   _Accept Meeting Response_, 'Decline Meeting Response_,
   _Meeting Cancellation_, _Meeting Request_,
   _Tentative Meeting Response_.
   7) Select 'move a copy to the specified folder'
   8) Click on 'folder name' and select the Meeting Requests folder that you created above.
   0) Select 'stop further processing"
</pre>
            
            <p>When a meeting request is made, it is sent to both your Eudora client and Outlook's
               Meeting Request folder. In Outlook, the folder name will be in bold face. Click on the
               message and press the Accept button.</p>
            
         </blockquote>
          <p>To hide new headers in Eudora messages     [<a href="http://eudorabb.qualcomm.com/showthread.php?t=13310">EudoraLab</a>]
          </p>
          <blockquote>
                <p>TabooHeaders is a comma separated list of headers that will not show when ShowAllHeaders is 
                turned off. The easiest way to implement this is with an Option:   <code>&lt;X-Eudora-Option:TabooHeaders=></code>
                </p>
                    
                    <p> Copy the link and paste it in the body of a new message in Eudora. Press the enter key once if the 
                link doesn't appear in blue.  Then hold down the alt key while clicking the link. A "Change Option" window 
                will appear. In the "New Value" field type the headers you don't want to see.   If you just type the first letter 
                of a header, then all headers starting with that letter will be tabooed. You may want to type
                a,b,c, etc ......z,  and omit d for Date, f for From, s for Subject, t for To, and so forth. 
                </p>
            </blockquote>
      </rf:item>
   </rf:section>
    <rf:section id="clearcase" title="Clearcase">
        <rf:item id="setup-clearcase" title="Setup Clearcase" date="Nov 2007" author="bbarber">
            Set up ClearCase on Windows
            
            Notes on setting up ClearCase.  Your administrator should supply a pre-configured
            ClearCase installer.
            <ul><li>
            </li><li>
                view_storage -- ClearCase uses a shared directory to store its information about
                views.  Do not modify this directory or its contents.  It must be assigned 'Full
                Control' for your network login ID [<code>right-click->Sharing and
                    Security->Share this folder->Permissions->Add</code>].  You can turn off
                read access to 'Everyone'.  
            </li><li>
                Install <a href="http://kdiff3.sourceforge.net/">Kdiff3</a> -- ClearCase's
                comparison and merge does not handle Unicode.    Download Kdiff3 from
                <a
                    href="http://sourceforge.net/project/showfiles.php?group_id=58666">Sourceforge</a>.
                Start Kdiff3 and install the ClearCase integration
                (<code>Settings->Configure->Integration->Integrate with ClearCase</code>).
                After integrating with ClearCase, 
                stop/start ClearCase by going to <code>Clearcase HomeBase->Administration->Control
                    Panel->Services</code>.
        </li><li>
            ClearCase HomeBase -- HomeBase provides access to ClearCase configuration
            and features.  
            Add a link to ClearCase Home to Quick Launch or your desktop,
            <code>Start->All Programs->IBM Rational->IBM Rational Clearcase->Home Base</code>.
        </li><li>
            Filenames with Unicode characters -- If file names include Unicode characters (e.g.,
            Japanese), you must install the corresponding language support in Windows.  Otherwise
            ClearCase can not update or add these files.  To install Japanese, go to <code>Control Panels->Regional
            and Language Options->Languages->Supplemenary language support</code> and select
            <i>Install files for East Asian Languages</i>.  It requires an installation CD.
        </li></ul>            
        </rf:item>
        <rf:item id="clearcase-config" title="Clearcase client configuration" date="Nov 2007"
            author="bbarber">
            Clearcase configuration
            <ul><li>
                Move log files -- By default MVFS writes logs into <code>CL\mvfslogs</code>. 
                Consider moving it to your Clearcase directory using
                <code>HomeBase->Administration->Control Panel->MVFS->Logging Path</code>
            </li><li>
                Turn off "VOBs are mounted" -- By default, Clearcase announces that its VOBs are
                remounted at startup.  Turn off this message from
                <code>HomeBase->Administration->Control Panel->Options->Display confirmation
                    message</code>
            </li><li>
                Drive letter for dynamic views --  In Windows, ClearCase uses a drive letter for dynamic views.  It is configured at <code>ClearCase Home Base->Administration->Control
                    Panel->MVFS->Drive Letter</code>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
                
            </li></ul>
            
        </rf:item>
        <rf:item id="clearcase-vault" title="Differences between Clearcase and Vault" date="Nov
            2007" author="bbarber">
            Differences between Vault and ClearCase
            <ul><li>
                No Vault history -- The history and branches from Vault are difficult to import.  So
                ClearCase contains the last version of each file and branch from Vault.
            </li><li>
                Individual files -- In ClearCase, only individual files and directories have
                versions.  There is no equivalent to Vault's global version number for a
                repository.   ClearCase uses labels (aka baseline) to identify a consistent set
                of files.  You need to lock the files when creating a label.  Otherwise some
                files of a check-in may be in the label, but not all.
            </li><li>
                Branching -- In ClearCase, a branch is metadata assigned to individual files
                and directories.  It is not part of the directory hierarchy (as in Vault and
                Perforce).  The first check-out a branched file creates the branch
                for that file (via -mkbranch in the config-spec).
            </li><li>
                Directory hierarchy -- In ClearCase, all files retain the same directory
                hierarchy as the repository/VOB.   You can not map files to specific locations
                on your disk.  You can assign a drive letter to any directory (<code>subst X:
                    N:\view_name\a\b\c</code>).
            </li><li>
                Dynamic views -- ClearCase has both snapshot and dynamic views.   A snapshot
                view is similar to Vault.  A dynamic view is a network directory that is always
                up-to-date according to a "viewspec".
            </li><li>
                symlink vs. sharing -- ClearCase uses symlinks (aka <i>hyperlinks</i>) instead of shared files
                and folders.    While Vault allows multiple shares for a file, ClearCase allows only
                one symlink.  While Vault shares are bidirectional, ClearCase has a master copy and
                linked copies.  As in Vault, a ClearCase symlink has the same name as the target.  A symlink directory is
                otherwise the same as a normal directory.    For files, use the symlink menu to
                check out a file.
            </li><li>
                Renaming breaks symlinks -- In Vault, shared files are bidirectional links.  Renaming
                or moving files keeps track of the corresponding shares.  Symlinks in ClearCase behave like symbolic links in Unix.  
                A symlink is simply a text string.  The target does not track its symlinks.  Given a
                target you can not easily find its symlinks.  Renaming or moving a target breaks all
                of its symlinks.
            </li><li>
                Labels and checkouts exclude symlinks -- Cleartool commands do not follow symlinks. 
                 For example, if you recursively label a directory, its symlink targets are not
                 labelled.  You can not checkout a symlink.  Instead you check out the symlink's
                 target.
            </li><li>
                Authentication -- On Windows, Vault uses password authentication while ClearCase requires
                Windows authentication.    ClearCase uses Windows authentication to access the
                <code>view_storage</code> shared directory on your disk.
            </li><li>
                Case Sensitive -- Filenames in ClearCase are case sensitive while in Vault they are
                case insensitive.
            </li><li>
                
            </li></ul>
            
        </rf:item>
        <rf:item id="clearcase-help" title="Learning Clearcase" date="Nov 2007" author="bbarber">
            Learning ClearCase
            <ul><li>
                Tutorial -- Read the ClearCase Tutorial from the Start Menu or  <code>C:\Program
                Files\Rational\ClearCase\doc\tutorial\</code>.  If you use Base Clearcase, 
                skip the material on UCM (Unified Change
                management).
            </li><li>
                Skip ClearCase Help -- The help documentation is difficult to navigate and needs
                editing.  It is best viewed from <code>Rational ClearCase Explorer->Toolbox</code>
            </li><li>
                Online manuals and Glossary -- Add a link to online manuals (i.e., pdf files) to Quick Launch or your
                desktop, <code>C:\Program Files\Rational\ClearCase\doc\books</code>.  It is
                not readily available from the Start menu or ClearCase Home.    For a documentation
                map see <code>C:\Program Files\Rational\ClearCase\doc\help\cc_main\clearcase_docmap.htm</code>
                <ul><li>
                    Introduction (cc_intro.pdf) -- The Glossary is particularly good.  Otherwise, this file duplicates the
                    Tutorial.   It introduces Unified Change Management (UCM),  Base ClearCase, and
                    ClearCase concepts.  
                </li><li>
                    Guide to Managing Software Projects (cc_proj.pdf) -- Read "Part 3: Working with base ClearCase". 
                    It covers the same material as cc_intro in greater detail.
                </li><li>
                    Developing Software (Base ClearCase, cc_dev.pdf) -- Reference documentation on
                    using ClearCase.   Read
                    other introductions first; this manual is unorganized.    Unless you use
                    ClearQuest, skip the sections on ClearQuest.
                </li><li>
                    Command Reference (cc_ref_1.pdf, cc_ref_2.pdf) -- Documentation for cleartool
                    commands.
                </li><li>
                </li><li>
                </li><li>
                </li><li>
                </li><li>
                    
                </li></ul>
                IBM's <a
                    href="http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m0/index.jsp?topic=/com.ibm.rational.clearcase.hlp.doc">online
                    manual</a> -- A copy of the Help documentation with search 
                (e.g., <a
                    href="http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m0/index.jsp?topic=/com.ibm.rational.clearcase.cc_ref.doc/topics/config_spec.htm"
                    >config_spec</a>)
            </li></ul>
        </rf:item>
        <rf:item id="clearcase-dynamic" title="Create a dynamic view" date="Nov 2007"
            author="bbarber">
            A dynamic view is a network drive (e.g., N:) with
                access to all files in ClearCase.   It is particularly useful for browsing VOBs and
                reorganizing directories.
                <ul><li>
                    Create a dynamic view from
                    <code>HomeBase->Views->Create View->Next->Dynamic View</code>.
                </li><li>
                    Name your view -- Include your login name.                      
                    Include your machine name if you plan to use ClearCase on multiple machines.
                </li><li>
                    Set the drive letter to <code>{None}</code>.   Do not assign a drive letter.  You will access the dynamic
                    view using the network drive assigned at install time
                </li><li>
                    Click <code>Advanced Options</code>
                </li><li>
                    Set the <code>View storage
                        location</code> to your shared folder
                    (<code>cc_admin\view_storage</code>)   If you do not see "view_storage',
                    create a shared directory as described above ("Install ClearCase ...").                    
            </li><li>
                Mount the  VOBs -- After you install ClearCase, you need to mount the
                 VOBs.   This only needs to be done once.  Select all of the VOBs in <code>HomeBase->VOBs->Mount VOB</code>
                and click the Mount button.
            </li><li>
                Check the view --  Using Windows Explorer, go to the Clearcase drive ("view on 'view').
                You should see your dynamic view.   Click into the view and you should be able
                to navigate the view.  Right-click will show the ClearCase menu.
            </li><li>
                ClearCase Explorer -- Launch ClearCase Explorer.  It is on your desktop and the
                Start menu.   Click the Views shortcut pane (lower left).  It will be empty. 
                Run <code>View->Refresh View Shortcuts</code>.  Your view should appear. 
                Clicking will start the Explorer pane (upper right).
            </li><li>
                \\view\myclient -- Dynamic views are a network directory mounted as
                <code>\\view\myclient</code>
            </li></ul>
            Limitations of dynamic views
            <ul><li>
                On Windows, a dynamic view is the same as a network drive.  Like a network drive, it
                provides easy access to shared resources.  It is typically slower than a local
                drive, and prone to network errors.
            </li><li>
                Clearcase adds extra layers.  When you request a Clearcase element, Clearcase uses
                your config-spec to map the element to a physical version of a file.  It caches the
                result for faster access in the future.
            </li><li>
                Programmatic access -- Except for delays on opening a directory, interactive access
                works well under Windows Explorer or Clearcase Explorer.   For programmatic access
                (e.g., nmake or IIS), dynamic views may throw errors which the application does not handle
                correctly.
            </li><li>
                Incorrect function -- This error appears to have multiple causes.  It may be
                Spyware, misconfiguration, or network glitches from the dynamic view.
            </li><li>
                Permissions -- A dynamic view is owned by the user.  By default, other users have
                read access.   For example, IIS runs as IUSER_MACHINE.
            </li><li>
            </li><li>
            </li><li>
            </li><li>
                
            </li></ul>
            
        </rf:item>
        <rf:item id="clearcase-snap" title="Create a snapshot view" date="Nov 2007"
            author="bbarber">
            <p>
            A snapshot view is a directory on your computer that
            gets refreshed by ClearCase.  On Windows, use a snapshot view for your working folders and
            programmatic access (e.g., website, builds, or automated tests).   On Unix (and
            Windows), use a snapshot view for disconnected access to your files.</p>
            <ul><li>
                Create a snapshot view from
                <code>HomeBase->Views->Create View->Next->Snapshot View</code>.
            </li><li>
                Set the view directory -- Use a short pathname for your view directory
                (e.g., <code>C:\cc</code>).   It must be a new directory.   
                Use your local disk instead of a network drive (for faster loads).            
            </li><li>
                Click <code>Advanced Options</code> -- If you skip this step, ClearCase will
                report an error <i>storage directory must be in UNC style</i>.
            </li><li>
                Set the <code>View storage
                location</code>.    Enter the same shared directory as for a dynamic view
                (e.g., <code>cc_admin\view_storage</code>)
            </li><li>
                Set Timestamps to 'VOB time'    
            </li><li>
                Give a unique name to your view.  Include your own name.  Include the machine name
                if you use ClearCase on multiple computers.
            </li><li>
                Select directories for your view --  Click Finish and OK to reach the dialog
                box for choosing elements (a.k.a. <i>load rules</i>).   Add those
                directories that you want in your view.  If no VOBs are visible, click 'Show all VOBs'. 
                You may need to mount the VOBs using <code>ClearCase Home->VOBs->Mount
                    VOB</code>.
            </li></ul>
            Limitations of snapshot views
            <ul><li>
                As with dynamic views, pathnames include the view directory, VOB name, and
                intermediate directory names.  You may assign a drive letter to a directory using
                <code>subst</code>.
            </li><li>
                Subdirectories included -- The load rules of a snapshot view select the directories to load into the
                snapshot.   To exclude a subdirectory, select rev 0 in your configspec, for
                example
                <pre>element         /mathcad_classic/Documentation/...          /main/0</pre>. 
                <i>Warning</i> -- unloaded, hijacked files will be renamed to <code>*.unloaded</code>
            </li><li>
                Keep snapshots small -- Depending on the connection and other activity, 
                ClearCase loads about 100-300 files per minute.  Thousands of files will 
                take over an hour to load.  Updates are faster, but still take a while.
            </li><li>
                Keep top level paths short -- The maximum path length in Windows is 250 characters. 
                Since the snapshot view uses the full path from ClearCase, it may exceed this limit.
            </li><li>
            </li><li>
            </li><li>
            </li><li>
                
            </li></ul>
        </rf:item>
        <rf:item id="clearcase-configspec" title="Clearcase configspec, e.g. branches" date="Nov 2007"
            author="bbarber">
            <p>The <a href="http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m0/index.jsp?topic=/com.ibm.rational.clearcase.cc_ref.doc/topics/config_spec.htm">ConfigSpec</a> selects a version of each element (<code>HomeBase->Views->Edit
                View Properties->ConfigSpec</code>).  It is a sequence of rules.  The first
            matching rule for an element, selects the element and performs additional
            operations.</p>
            
            <p>A branch view selects branched versions in place of the mainline.
                For example, a branch spec may look like</p>
            <ul><li>
                element * CHECKEDOUT -- If you have checked out an element, select it.
            </li><li>
                element  .../mybranch/documentation/...  /main/0 -- Ignore the contents of the
                documentation folder [There is a space between ... and /main/0]
            </li><li>
                element * .../mybranch/LATEST -- If the element has a version on the
                branch 'mybranch', select it.
            </li><li>
                element * mybranch-base -mkbranch mybranch -- If the element has a version
                in the 'mybranch-base' label, select it.  If you check out the element,  make a 'mybranch' branch for
                it.
            </li><li>
                element * /main/0 -mkbranch mybranch -- If you create a new element (i.e.,
                version 0 on the 'main' branch), select it and make a 'mybranch' branch for
                that element..
            </li><li>
                
            </li></ul>
            
        </rf:item>
        <rf:item id="cleartool-help" title="Clearcase command line (cleartool)" date="" author="">
            ClearCase includes a good command line tool, cleartool.  
            Start it from
            ClearCase Explorer by right-clicking any folder and selecting <code>Command
                Prompt</code>. 
            <ul><li>
                For documentation, type <code>man</code>     or view the Command
                References (cc_ref_1.pdf and cc_ref_2.pdf) in the online manuals.                 
            </li><li>
                Ostrander's <a
                    href="http://members.cox.net/ejostrander/clearteam/cc_howto.html">ClearCase/ClearQuest</a>
                -- How to ... using cleartool with examples.
            </li><li>
                List symbolic links -- <code>cleartool find . –type l –print</code>
            </li><li>
                IBM's <a
                    href="http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m0/index.jsp?topic=/com.ibm.rational.clearcase.hlp.doc">online
                    manual</a>  documents each command
            </li><li>
                <a href="http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m0/topic/com.ibm.rational.clearcase.hlp.doc/cc_main/c_hood_co_file_dir.htm"
                    >Under the hood</a> -- What happens when you check out a file or directory.
            </li><li>
            </li><li>
                
            </li></ul>
            
        </rf:item>
        <rf:item id="clearcase-error" title="ClearCase errors" date="Dec 2007" author="bbarber">
            <ul><li>
            </li><li>
                Error creating view ... storage directory must be in UNC style -- When creating a
              snapshot view, always assign view
                storage using the <code>Advanced Options</code> button.
            </li><li>
                Error: Type manager "text_file_delta" failed create_version operation -- The file
                its registered as a text file in ClearCase while the new version contains binary
                data.  If the file should contain binary data, change its type to 'compressed_file'.
                
            </li><li>
                High-bit ASCII in filenames -- ClearCase does not support high-bit ASCII characters
                across different languages (e.g., the 'not' sign and the 'Euro' sign.   It may be
                the same as the Unicode problem reported above.  ClearCase apparently stores
                non-ASCII characters using code pages, and fails when these pages are not installed
                (e.g.., Japanese)
                or differ (e.g., high-bit ASCII).   
            </li><li>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
                
            </li></ul>
        </rf:item>
     </rf:section>
   <rf:section id="vault" title="Vault source control">
      
      <rf:item id="setup-vault" title="Setup Vault source control" date="Nov 2005" author="bbarber">
          <p>The Vault client must be compatible with the Vault server.   Review <rf:iref item="vault-avoid"/>.  Vault's
          client is available at  <a
              href="http://www.sourcegear.com/vault/downloads.html">Vault downloads</a>.</p>
          
         <p>Besides following the company preferences, consider setting the following</p>
        <ul><li>
        </li><li>
           Tools->Options->General -- Uncheck <i>Show snapshots in the folder tree</i>
        </li><li>
           Tools->Options->General -- Uncheck <i>Check for latest Vault version at startup</i>
        </li><li>
           Tools->Options->General -- Check <i>Make Vault your default</i>  
        </li><li>
           Tools->Options->Check In -- Uncheck <i>Auto-commit after each operation</i>
        </li><li>
           Tools->Options->Local Files -- Check <i>Prompt before overwriting</i>
        </li><li>
           Tools->Options->Diff/Merge -- Select Default item to diff as <i>Diff against current
               version</i>.  Unfortunately, diff is always against a cached, read-only copy.
        </li><li>
           Tools->Options->Diff/Merge -- A good, alternative diff program is <rf:iref item="setup-beyondcompare"/> with 
           Arguments "/title1="%LEFT_LABEL%" /title2="%RIGHT_LABEL%" "%LEFT_PATH%" "%RIGHT_PATH%" /noedit
        </li><li>
          File list pane -- Move the <code>Status</code> column to the left.  It is easy for the
            disk to get out-of-sync with Vault.     You need to be able to scan the Status column. 
            See  <rf:iref item="vault-avoid"/>.
        </li><li>
            Pending Change Set -- Sort the pending change set by Details with modifications at the
            top.    This identifies all open files that are modified.
         </li><li>
   
        </li></ul>
      </rf:item><rf:item id="help-vault" title="Help with Vault" date="Nov 2005" author="bbarber">
         <p><a href="http://www.sourcegear.com/vault">Vault</a> is a source control system that
            mimics Visual Source Safe. </p>
         <ul><li>
             <a href="http://download.sourcegear.com/misc/vault/help/client/vaulthelp.html">Vault Help</a> --
            client documentation for Vault.
         </li><li>
             <a href="http://download.sourcegear.com/misc/vault/help/admin/vaulthelp.html">Vault Admin Help</a> --
            admin documentation for Vault
         </li><li>
            <a href="http://support.sourcegear.com/viewtopic.php?t=792">Vault Knowledge Base</a> --
            a list of topics concerning Vault
         </li><li>
            Vault command line -- Command line options for
            vault.exe.  See also <code>vault help ...</code>.  Generate the help page by <code>vault
               helphtml</code>.
         </li><li>
             View changes by version -- Viewing changes by version is much faster than viewing
             changes by file.  Check option <code>Tools->Options->CommandDialogs->Commands used on
                 folders->History Filter</code>.  Then select a folder and Show History.   Select
             <code>View folder history by version</code>
         </li><li>
             Get source tree as of a version -- Select a folder.  View changes by version.  Select the
             changelist.  Click <code>Get Tree</code>
         </li><li>
         </li><li>
         </li><li>
            
         </li><li>
            For help with other source control systems see <a
               href="http://public.perforce.com:8080//guest/brad_barber/road/web/xml/p4-faq.xml">Perforce
               FAQ</a> and 
            <a
               href="http://public.perforce.com:8080//guest/brad_barber/road/web/xml/p4-faq-admin.xml">Perforce
               Admin FAQ</a>
         </li></ul>
      </rf:item>
      <rf:item id="vault-avoid" title="How to avoid problems with Vault" date="Nov 2005" author="bbarber">
         <p>Be careful of the following problems with Vault.</p>
         <ul><li>
            <b>Checkout is always latest version</b> -- The <code>Checkout</code> command always
            downloads the latest version.  It does not warn you if your version is out-of-date.  
              <ul><li>
                 If you want to edit a previous version, use Right-click->Show
                 History on the file, select your current version, Right-click->Check-out.   
              </li><li>
              </li><li>
              </li></ul> 
         </li><li>
            <b>Add folders before files</b> -- The <code>Add Files/Folders</code> dialog will add
            files to the current directory even though the file is in a subdirectory.  First add the
            folder, check in the add, then navigate to the folder in vault and add the file.  
         </li><li>
             <b>Renegade and Needs merge</b> -- Vault's Get Latest Version does not always update
             your files.   Some files may be have Renegade or Needs merge status.  
             <p>To check the status of all files</p>
             <ul><li>
                Select the top-level directory.  Goto the
                 <code>Search</code> pane.  Check <code>Recursive</code> and <code>Lock onto this
                     folder</code>.  Select Search->Any Status.   
             </li><li>
                 <b>Note:</b> Updating the Search
                 pane can take a long time.  It is updated after every change.   Only view the
                 Search pane when you need it.  Consider taking an image snapshot when you need to fix multiple entries.
             </li><li>
                 To improve modified file detection -- Tools->Options->Local Files.  Check
                 <code>Detect modified files using CRCs</code> and reduce the size limit to 1 MB. 
                 It slows down <code>Get Latest Version</code>, so you may prefer periodic status
                 checks.
             </li><li>
             </li><li>
             </li></ul>
         </li><li>
             Email notification -- Use Vault's e-mail notification to track changes to files or
             directories.  See the <code>Email</code> tab at the bottom of Vault's dialog box.
         </li></ul>
      </rf:item>
       <rf:item id="vault-restore" title="Synchronizing with Vault after a crash or long absence" date="July 2007"
           author="jbarnes">
           <p>If Vault requires recovery from backup, or if you have continued to modify files after
           disconnecting from Vault.</p>
           <ul><li>
               Review all of the steps below.
           </li><li>
               Install a directory comparison program such as <rf:iref item="setup-beyondcompare"/>
           </li><li>
              Make zip archives of your original directories.  This step is not necessary, but it provides a fall back if you make a mistake (e.g., by copying files in the wrong direction).
           </li><li>
               Rename your original directories (e.g., ‘…\MyFolder-July07’). 
           </li><li>
                Reset your Vault cache – This step may be unnecessary, see (c).
               <ul><li>
                   Open the VaultGUIClient
               </li><li>
                   Go to Tools->Options->Local Files->Cache/Backup Locations
               </li><li>
                   Is ‘In Working Folders’ set for ‘Store Working Folder State’?  If so, you do not need to reset the cache.  Vault stores its cache information in your working directories.  Vault will create new cache folders (_sgvault) when downloading the files. 
               </li><li>
                   If ‘In Client Cache Folder’ is set, you need to reset the cache as follows --
               </li><li>
                   Click on ‘Click here to open the existing cache folder’ – It will open an Explorer window to …\SourceGear
               </li><li>
                   Close the VaultGUIClient
               </li><li>
                   Delete the cache folder.  
               </li><li>
                   Restart VaultGUIClient
                 </li></ul>
           </li><li>
               Get Vault’s version of each directory that you want to recover
               <ul><li>
                Right-click the corresponding Vault directory and select Set Working Folder
               </li><li>
               Browse or enter its original name (e.g., …\MyFolder)
               </li><li>
                Vault should prompt about creating the folder.  If not, double check step (4)
               </li><li>
               Get Latest Version
               </li></ul>
           </li><li>
               Double check Vault’s version
               <ul><li>
                Click the ‘Search’ tab at the bottom of the Vault client
               </li><li>
                    Set ‘Search by: Any Status’ and ‘Recursive’
               </li><li>
                    The Search pane should be empty – all files are current
               </li><li>
                </li></ul>
           </li><li>
               Synchronize the Vault directory with the original directory
               <ul><li>
                      In Explorer, right-click on the original directory and select Select Left Side to Compare.  If you do not have this choices, select ‘Include BeyondCompare in Explorer context menu’ in Beyond Compare->Tools->Options->General.
               </li><li>
                     In Explorer, right-click on Vault’s directory and select Compare to 
               </li><li>
                      Set Session->Comparison Control to ignore timestamps and Compare Size and CRC
               </li><li>
                     Set View->Display Filters->Only Mismatches
               </li><li>
                      Set Session->File Filters->Exclude files to “_sgvault” [if you use ‘In Working Folders’ for the Vault cache]
               </li><li>
                        Review the list of differences.  Some files are changed, some are new, and some are deleted.
               </li><li>
                      Make a list of the directories that contain new files.  You will need it below (12)
               </li><li>
                      Select the changed and new files from the original directory.
               </li><li>
                        Copy the files to the Vault directory with Right-click->Copy->OK
               </li><li>
                        Select the deleted files from the Vault directory
               </li><li>
                      Delete the files from the Vault directory with Right-click->Delete
               </li></ul>
           </li><li>
                Check in the modified files
               <ul><li>
                      In Vault, look at the Search pane.  It reports the differences between the repository and your disk.
               </li><li>
                      Select the files marked ‘Renegade’
               </li><li>
                      Right-click and select ‘Check-out’
               </li><li>
                      Check in the modified files
               </li></ul>
           </li><li>
               Check in the deleted files
               <ul><li>
                     In Vault, look at the Search pane.
               </li><li>
                     Select the files marked ‘Missing’
               </li><li>
                     Right-click and select ‘Delete’
               </li><li>
                     Commit the deleted files
               </li></ul>
           </li><li>
               Check in the new files
               <ul><li>
                     For each sub-directory that contains new files (Step 8.g)
               </li><li>
                      Right click the directory in Vault, select Add files and select all of the new files and directories
               </li><li>
                     Commit the added files
               </li></ul>
           </li><li>
               Double-check your work
               <ul><li>
                     Delete the vault directory from your disk
               </li><li>
                     In Vault, Get Latest Version
               </li><li>
                     Using Beyond Compare, compare the vault directory with the original directory.  They should be identical.
               </li></ul>
           </li></ul>
       </rf:item>
       <rf:item id="vault-history" title="Extracting shared files and folders from Vault" date="Nov
           2007" author="bbarber">
        Vault does not have a command to list file shares.  You can list the history of share
        events, these combined with delete and branch events give the current shares.           
        <ul><li>
            List share events -- <pre>
               vault HISTORY -user xyz -password xyz -host xyz -rowlimit 100000  -repository QA \
               -excludeactions "add, branch, checkin, create, delete, label, move, obliterate,  pin,propertychange, rename, rollback, snapshot, undelete" $ \
               | tr -c -d [:print:][:space:] >shared.xml
               
               logparser -q -i:xml "select user,actionString from shared.xml order by user, actionString" | sed 's/ as /\n                  /' >share.txt
               grep -v "Shared " qa-share.txt | sed 's/.*\$/$QA/' >qa-b.txt
               grep "Shared " qa-share.txt | sed 's/.*\$/$QA/' >qa-a.txt
               grep -v "Shared " share-dev.txt | sed 's/.*\$/\$Mathcad/' >dev-b.txt
               grep "Shared " share-dev.txt | sed 's/.*\$/\$Mathcad/' >dev-a.txt
               sort -u dev-a.txt dev-b.txt qa-a.txt qa-b.txt >dirs.txt
            </pre>
        </li><li>
            Count duplicated files -- <pre>
                find . -type f | grep -v "'" | xargs -i md5sum "{}" >mathcad_classic.md5um
                cat *.md5sum | sort | uniq -d -w 33 | more
                cat *.md5sum | sort | uniq -D -w 33 | more
                cat *.md5sum | sort | uniq -d -w 33 | wc
                cat *.md5sum | sort | uniq -D -w 33 | wc
            </pre>
        </li><li>
            Separate files from directories -- <pre>
                cat filedirs.txt | grep -E '\..{1,10}$' >file.txt
                cat filedirs.txt | grep -v -E '\..{1,10}$' >dirs.txt
            </pre>
        </li><li>
        </li><li>
        </li><li>
        </li><li>
        </li><li>
        </li><li>
            
        </li></ul>
       </rf:item>
   </rf:section>
<rf:section id="dev-studio" title="Microsoft Developer Studio">
    <rf:item id="setup-devstudio" title="Setup Developer Studio" date="Feb 2006" author="bbarber">
        <ul><li>
            Help->Index->Help Favorities -- Add the following topics, "Debugger Roadmap", "Hierarchy
            Chart", "String
            Manipulation (CRT)"
         </li><li>
             Tools->Options->Environment->Import and Export projects --  Define <i>Automatically
             save my settings</i> as a file in your config directory (e.g.,
             <code>/cbb/config/CurrentSettings.vssettings</code>)
        </li><li>
             Tools -> Options->Environoment->Keyboard->Use new shortcut in: Text Editor.    Map Edit.SelectCurrentWord for 
             Text Editor to ctrl+Left Arrow
         </li><li>
             Tools->Options->Environment->Startup -- Set <code>At Startup</code> to <i>Load last loaded solution</i>
         </li><li>
             Tools->Options->Environment->Project and Solutions->General -- Set the <code>Visual Studio projects location</code> to a "vcproj" directory (e.g., 'c:\bash\local\vcproj').
         </li><li>
             Tools->Options->Projects and Solutions->General  -- Set <i>Visual Studio projects
                 location</i> to your projects directory.
         </li><li>
             Tools->Options->Projects and Solutions->General  -- Set <code>Show Output window when
                 build starts</code>
         </li><li>
             Tools->Options->Text Editor->General -- Uncheck <code>Drag and drop text editing</code>
         </li><li>
            Tools->Options->Text Editor->All Languages->Tabs -- Set Tab size, Indent size, and
            Insert spaces according to your style guidelines.   Unfortunately, DevStudio
            does not separate the effect of the Tab key from spacing characters.   Avoid this issue
            by setting <code>Insert spaces</code>.   
         </li><li>
             Tools->Options->Text Editor->File Extension -- Map extensionless files to 'Visual C++'
        </li><li>
            Tab size  --  DevStudio's default tab setting is <code>Tab size 4, Indent size 4, Keep
                tabs</code>.   Most text processing programs assume a physical tab size of 8,
            causing formating problems.   Either set <code>Insert
                spaces</code> or <code>Tab size 8</code>.
         </li><li>
            Tools->Options->Font -- Set the plain text font to Lucinda Console.  It has better
            braces and a cleaner font than the default Courier font.  Some people like Microsoft's
            ClearType Font, <a href="http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3"
                >Consolas</a>
        </li><li>
            Tools->Customize -- With <code>Customize</code> dialog visible, you can rearrange the
            buttons on the toolbars, or drag buttons from the dialog box to the toolbar.   The
            Customize dialog box is also visible from the toolbar pull-down menus.
        </li><li>
            Tools->Customize->Toolbars -- Add <code>Build</code>
        </li><li>
            Tools->Customize->Commands -- Drag and drop <code>Build->Compile</code> to the
            <code>Build</code> toolbar.    Check that you already have <code>Build->Build
                Selection</code> (allowing you to rebuild a dll without rebuilding the whole
            solution [OK ?]).
        </li><li>
            Build toolbar -- Change the order of the buttons to <code>Build Solution</code>,
            <code>Build Selection</code>, <code>Compile</code> [FIXUP]
        </li><li>
            OLE/COM Object Viewer -- Add <code>Common7\Tools\Bin\OleView.Exe</code>
            to <code>Tools->External Tools->Add</code>.
        </li><li>
            <a href="http://www.aisto.com/roeder/dotnet/">Reflector</a> -- Add Roeder's disassembler
            to  <code>Tools->External Tools->Add</code>.
        </li><li>
            E_NOINTERFACE error (This operation failed because the QueryInterface call on the COM
            component) -- This error has multiple causes.   The COM component was not properly
            registered, the COM object must run under single threading ([STAThread]), or an obsolete
            COM object conflicts with the desired object. 
        </li></ul>
  </rf:item>
    <rf:item id="setup-visual-assist" title="Setup Visual Assist X" date="Dec 2007" author="bbarber">
        <p>
            Visual Assist X  from <a href="http://www.wholetomato.com/">Whole Tomato</a> adds many editing, navigation, and refactoring enhancements to Visual
        Studio.</p>
        <ul><li>
            Turn off navigation bar -- Visual Assist X includes a much improved navigation bar. 
            Turn off Visual Studio's bar from <code>Tools->Options->Text
                Editor->C/C++/C#->General->Display->Navigation Bar</code>
        </li><li>
            Switch .h and .cpp [Alt O] -- Quickly switch between header and program files.
        </li><li>
            Expand nearby text -- VA Options -> Advanced -> Suggestions -> Include bits of code from surrounding lines
        </li><li>
            User defined sections -- Use '#//...' to mark sections.  They stay on the left
            margin and appear in VA Outline.
        </li><li>
            User-defined configuration -- Create the registry key
            <code>HKCU./Software/Whole Tomato/UserDataDir = "C:\new_path\"</code>.
            
        </li><li>
            Turn off repair case -- The repair case feature makes T lowercase in 'count(const T
            &amp;t) const'.  If this is a problem, turn off the feature with <code>VA Options -> Advanced -> Correction -> Repair case</code>
        </li></ul>
    </rf:item>
    <rf:item id="debugging-devstudio" title="Debugging with Developer Studio" date="Mar 2006" author="bbarber">
<ul><li>
    If the Debug menu is missing Exceptions -- Drag the <code>Exception</code> command from 
    Tools->Customize->Commands->Debug to the <code>Debug</code> window.
</li><li>
    dumpbin /all -- List contents of .lib, .dll, .obj, and .exe files.  Use depends for .obj and
    .exe files (C:\Program Files\Microsoft Visual Studio 8\VC\bin\dumpbin.exe and ..\..\Common7\IDE)
</li><li>
    runtime library -- All programs link with a runtime library.  There are variations of each
    runtime library for debugging, static vs. dynamic linkage, multi-threaded vs. single-threaded,
    and 32-bit vs. 64-bit.  For example, if the linker reports duplicate symbols for msvcp80d.dll and 
    libcpmtd (e.g. for ios.o), the program was linked with different runtime libraries.  msvcp90d.dll is the debug, multi-threaded dynamic link library for STL while libcpmtd is the multithreaded, static link.library.
</li><li>
    How to kill a process -- Microsoft's <a
        href="http://support.microsoft.com/kb/178893">How To Terminate an Application "Cleanly" in
        Win32</a> (July04)
</li></ul>
    </rf:item>
         <rf:item id="remote-debug" title="Remote debug with Visual Studio 2005" date="Mar 2006" author="bbarber">
            <p>Remote debugging allows you to investigate problems on another machine.</p>
            <ul><li>
                <a
                    href="http://msdn.microsoft.com/netframework/programming/64bit/remotedebugging/">Visual
                    Studio 2005 Remote Debugging</a> -- Microsoft's documentation
            </li><li>
                On the remote machine
                <ol><li>
                    Log into the local machine as yourself and use Windows authentication, or log in as
                    an administrator and use No Authentication (see following).  To log in as
                    yourself, you may need to add yourself as a user.
                </li><li>
                    If running as an administrator, Control Panels->Administrative Tools->Local Security
                    Policy->Local Policies->Security Options -- Change <code>Network access:
                        Sharing and security model ...</code>from <code>Guest only</code> to
                    <code>Classic ...</code>.
                </li><li>
                    On the remote machine, Install Visual Studio 2005 Remote Debugging Components.  
                </li><li>
                    On the remote machine, Start->Programs->Microsoft Visual Studio->Visual Studio
                    Tools->Remote Debugging Monitor
                </li><li>
                    Tools->Options -- Set up authentication.  If running as an administrator, use
                    <code>No Authentication</code> and select <code>Allow any user to debug</code>
                </li><li>
                    Copy the symbol files, *.pdb,  from a build directory.
                </li><li>
                    Launch the program for debugging.
                </li></ol>
            </li><li>
                Launch DevStudio.  
            </li><li>
                Debug->Attach to Process->Remote debugging -- Enter name of machine.  If permissions
                are OK, the machine's processes will appear.   If not, read the error messages
                <i>carefully</i>.  They can help you solve the problem.
            </li><li>
                
            </li></ul>
        </rf:item>
       <rf:item id="devstudio-build" title="Developer Studio builds and projects" date="Mar 2008" author="bbarber">
        <ul><li>
            Edit vcproj and sln files -- Use a text editor to edit vcproj and sln files.  DevStudio
            automatically picks up your changes.    Likewise, the 'Save All' command saves changes
            made by DevStudio.
        </li><li>
            Place vcproj files in source control -- Place project files (.vcproj) in your source
            tree.   Move output to a tmp folder outside of your source tree.  
            Add an 'Other Files'  filter for supplementary  files.
        </li><li>
            Place sln files in a build directory -- Place solution files (.sln) in a build
            directory.  Intellisense builds a substantial file (.ncb) in the same directory. 
        </li><li>
            Unexpected build errors -- Review the output log.  Make sure that all copies succeeded. 
            If not, use TaskManager to verify that the application has terminated.  You may need to
            restart DevStudio.
        </li><li>
        </li><li>
        </li></ul>
    </rf:item>
</rf:section>
    <rf:section id="sql-server" title="SQL Server">
      <rf:item id="sql-server-setup" title="Setup SQL Server" date="Dec 2005" author="bbarber">
         <p>Upgrade to SQL Server 2005.  It has many improvements including better support for XML (e.g., clicking an XML field
            shows the XML).  </p>
         <ul><li>
            Create a project in Microsoft SQL Server Management Studio -- otherwise bookmarks are
            not saved.
         </li><li>
             <a href="http://www.carlprothman.net/Default.aspx?tabid=90">ODBC DSN-Less</a> --
             Connection strings for ODBC access without configuring a data source name 
             (<a
                 href="http://www.carlprothman.net/Technology/ConnectionStrings/ODBCDSN/tabid/89/Default.aspx">ODBC
                 DSN</a>, <a href="http://support.microsoft.com/kb/q165866/">How to use</a>)
         </li><li>
             <rf:iref item="sql-server-backup"/>
         </li><li>
             File DSN -- A File DSN is a portable definition of an ODBC data source.  
             Create it with <code>Control Panels->Administrative Tools->Data Sources->File
             DSN</code>.   The default location is <code>C:/Program Files/Common/ODBC/Data
             Sources</code>.  The connection string is
             <code>FILEDSN=file-name;uid=user-name;pwd=password</code>.  Use a fully qualified path
             name if the file DSN is not in <code>Data
             Sources</code>.
         </li><li>
             Excel as ODBC source -- Use a FILEDSN or connect directly using JET
             <a
                 href="http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForMicrosoftJetExcel">DSN-less</a>.
             See Microsoft's <a
                 href="http://support.microsoft.com/default.aspx?scid=kb;en-us;278973">How To</a>.  
              By default the first row is a header row, define extended properties with Hdr=NO.   If the spreadsheet defines names for table
              ranges, they may be used as the table.  Otherwise use Excel syntax within square
              brackets (e.g., [Sheet1$] for a sheet, or [Sheet1$A1:D20] for a cell range within a
              sheet..  For example, using Outwit's odbc
              <pre>
odbc "FILEDSN=product-map.dsn" 'select top 2 * from [Product-Module$]'               
odbc 'Driver=Microsoft Excel Driver (*.xls);Dbq=d:/cbb/mydocs/Cards/product-mapping.xls' 'select top 2 * from [Product-Module$]'
              </pre>
         </li><li>
             Cannot update.  Database or object is read-only. -- Check the filename.  This error is
             reported by the Excel driver if the source file can be located.
         </li><li>
             Linked servers -- See Microsoft's SQL documentation for <code>Accessing External
                 data</code>, <a
                 href="http://www.databasejournal.com/features/mssql/article.php/10894_3085211_2">tutorial</a>
             from the Database Journal,
             <a href="http://support.microsoft.com/kb/270119">Update, Insert, Delete OPENQUERY</a>
             Microsoft KB.  Create using sp_addlinkedserver and test with
             sp_testlinkedserver.   Retry with sp_dropserver.   View with <code>Server Management
             Studio->Object Explorer->Server Objects->Linked Servers</code>.  Execute selects
             with OpenQuery or four part naming.
             With four part naming, use three dots to indicated an empty database name and owner.  
             For example,
<pre>
    exec sp_dropserver @server='product-map'
    exec sp_addlinkedserver @server='product-map', 
    @srvproduct='Excel', @provider='Microsoft.Jet.OLEDB.4.0', 
    @datasrc='Q:\QA\Personal folders\Brad\cards\Product-mapping.xls',
    @provstr='Excel 8.0;Hdr=Yes'
    exec sp_testlinkedserver "product-map"
    select top 3 * from "product-map"...product_module$
</pre>            
             For text fields, <code>NULL</code> is the string 'NULL' instead of a database NULL.
         </li><li>
             Solution Explorer -- to add query files from different directories, you need to
             edit the corresponding .ssmssqlproj file.   Otherwise the file is stored in the 
             same directory as the project file.
         </li><li>
             Quick launch -- To launch SQL Server Management Studio with a project file, create a
             link to Management Studio and change its Target to launch the file.  For example
             <pre>
                 "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWb.exe"  D:\road\web\RoadDB\sql\RoadDB-scripts.ssmssln -S localhost -d road -E -nosplash
             </pre>
         </li></ul>
      </rf:item>
        <rf:item id="sql-server-backup" title="Backup SQL Server" date="Sept 2007" author="bbarber">
            <p>Regular backups must be scheduled.</p>  
            
            <p>For non-transactional databases, a
            full-backup is sufficient.  Set up a bi-weekly and daily schedule.</p>
            <ul><li>
               Maintenance Plans -- SQL Server includes a Maintenance Plan wizard as part of SQL
               Server Agent, see <code>Microsoft SQL Server Management Studio->Object Explorer->Management->Maintenance
                    Plans</code>.       
            </li><li>
                Use drag-and-drop to build up a plan.  
            </li><li>
                All scripts should first check the integrity of the system and user databases, one database
                at a time.  
            </li><li>
                Success (Green)  -- Right-click each blue link.  The plan should only proceed on success.
            </li><li>
                Failure (Red) -- Add a failure link to a <code>Notify Operator Task</code>
            </li><li>
               The bi-weekly script should  check integrity, shrink large databases, rebuild
               indices, update statistics, clean up history, and backup the system databases/              
            </li><li>
                The daily script should check integrity, and backup the master and user databases.
            </li><li>
                Backups and logs should go into a user-level directory.  Make sure that backups move
                off-site on a regular basis.
            </li><li>
                Double-check backups periodically by loading them into a new database.
            </li><li>
                Schedule the tasks by clicking the calendar icon, upper-right of the maintenance
                plan.
            </li></ul>

            <p>If an integrity check fails, restore the database from a backup.  Alternatively, use
           <code>DBCC CHECKDB</code></p>
            <ul><li>
                Help -- First understand the simple recovery model, "Performing a Complete Database
                Restore (Simple Recovery Model)" 
            </li><li>
                Help create -- To create a new database from a backup see "How to: Create a New
                Database From an Existing Full Backup (SQL Server Management Studio) ".  In brief,
                right-click the DB.  Select <code>Restore->Database</code>.  Give a new name for the
                <code>To</code> database.  Identify the backup set for the from database.  Select
            </li><li>
                Restore a database as a new database -- 
                <ul><li>
                    right-click any database, and select <code>Tasks->Restore->Database</code>  
                </li><li>
                    Give a new name for the
                    <code>To</code> database.  
                </li><li>
                    <code>From device</code> -- navigate to the full-backup file
                </li><li>
                    Select the backup sets to restore -- Check the <code>restore</code> box.
                </li><li>
                    Click OK to restore.
                </li></ul>
            </li><li>
                DBCC CHECKDB -- If the database continues to fail despite a reload, you can attempt
                to rebuild the database.  This attempt was not successful for integrity errors
                against sys.sysmultiobjrefs and sys.syssingleobjrefs.  We ended up ignoring the
                problem.
                <ul><li>
                    Single User Mode -- Change database to Single User via <code>right-click
                        DB->Properties->Options->State->Restrict Access->SINGLE_USER</code>
                </li><li>
                    DBCC CHECKDB ('road') -- Check for consistency errors.  
                    
                </li><li>
                    DBCC CHECKDB ('road', REPAIR_REBUILD) -- Rebuilds the tables, correcting errors
                    that can not cause dataloss.  Must be in Single User Mode.
                    
                </li><li>
                    DBCC CHECKDB ('road', REPAIR_ALLOW_DATA_LOSS)  -- Data may be lost.  Have a 
                    Must be in Single User Mode.
                </li></ul>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
                
            </li></ul>
        </rf:item>
     <rf:item id="sql-server-help" title="Help for SQL Server" date="Dec 2005" author="bbarber">
         <ul><li>
            <code>Help->Index</code> -- Use Microsoft's documentation supplied with SQL Server.   Configure <code>Filtered by</code> to "SQL Server 2005".    Add help to
             the Quick Launch toolbar by dragging from Start->Programs->SQL Server
             2005->Documentation.
         </li><li>
            <code>Help Favorites</code> -- Right-click any page to add to Help Favorites.  For
            example:  <code>Accessing and Changing Database
                Data</code>, <code>CAST and CONVERT</code>, <code>Changing Data in a Database</code>,
             <code>constants (Transact-SQL)</code>, 
             <code>CREATE FUNCTION</code>,
            <code>Creating Stored
                  Procedures (Database Engine)</code>, <code>Designing and Creating
                     Databases</code>, <code>Data Type Conversion (Database Engine)</code>, <code>Data Types (Transact-SQL)</code>, <code>Elements of Transact-SQL</code>, 
            <code>EXECUTE (Transact-SQL)</code>, <code>Expressions (Transact-SQL)</code>, <code>Functions (Transact-SQL)</code>, <code>Importing and Exporting Bulk Data</code>, <code>SELECT
               (Transact-SQL)</code> <code>SET @local_variable</code> <code>SET
                  (Transact-SQL)</code>, <code>SQL Injection</code>, <code>String Functions (Transact-SQL)</code>,
             <code>sys.objects (Transact-SQL)</code>. <code>Table-valued User-defined
                 Functions</code> and in-line table functions, <code>Using RAISERROR (Transact-SQL)</code>,
             <code>Viewing Database Metadata </code>,
             <code>XML Best Practices</code>
         </li><li>
             Tutorials -- <a href="http://www.databasejournal.com/article.php/3085181">Don
                 Schlichting</a> has many good tutorials on Sql Server in <i>Database Journal</i>
         </li><li>
             Useful books include <rf:iref item="gennJ_2004"/>, <rf:iref item="hendK_2000"/>,
             <rf:iref item="spetA_2002"/>
         </li><li>
             MSDN -- For acticles and recent updates, visit MSDN Library->Servers and
                 Enterprise Development-><a
                     href="http://msdn2.microsoft.com/en-us/library/ms950403.aspx">SQL Server</a>
         </li></ul>
      </rf:item>
        <rf:item id="sql-server-advice" title="SQL Advice" date="Mar 2006" author="bbarber">
            <ul><li>
                Pivot table -- A pivot table contains one column with numbers in sequence.  Use pivot tables to number
                intermediate results for later selection and to identify missing rows <rf:iref
                item="spetA_2002" page="1, 34-37"/>.  For an introduction, see "Using a Table of
                Numbers" in Sommarskog's <a
                    href="http://www.sommarskog.se/arrays-in-sql.html">Arrays and Lists in SQL
                        Server</a>
            </li><li>
                WHERE EXISTS -- Use EXISTS and NOT EXISTS to test membership in a set.  It replaces a join  <rf:iref
                    item="spetA_2002" page="9, 14"/>.
            </li><li>
                CASE WHEN -- The CASE function combines data from many sources.  It can be used
                anywhere.  For example, use CASE in a GROUP BY  <rf:iref item="spetA_2002"
                    page="24-25"/>.
            </li><li>
                GROUP BY ... WITH CUBE -- WITH CUBE adds crosstab rows to the result set.  See
                Microsoft's documentation.  For example, to add a Total row, use
                <pre>
                    SELECT
                    case when GROUPING(status_old) = 1 then 'Total' else status_old end as rowname,
                    sum(case when result=1 and status='CriticalAccepted' then 1 else 0 end) as Accepted,
                    sum(case when result=0 and status='CriticalAccepted' then 1 else 0 end) as Accepted_fail,
                    sum(result) as Total,
                    count(*)-sum(result) as Total_fail
                    from #tests_rn
                    where result_old=1
                    GROUP BY status_old WITH CUBE
                    order by GROUPING(status_old), status_old
                </pre>
            </li><li>
                Rule-driven query -- For dynamic classification, create a rule table with each row
                describing one rule  <rf:iref item="spetA_2002" page="40-44"/>.
             </li><li>
                 Runs -- A <i>run</i> is a sequence of increasing or decreasing values.   Determine
                 runs by multiple self-joins that verify increasing values  <rf:iref
                     item="spetA_2002" page="60-61"/>.
             </li><li>
                 Cumulative total -- To compute the comulative total, self-join and group by ID 
                 <rf:iref item="spetA_2002" page="62"/>.
             </li><li>
                 Hierarchical data -- If performance is a problem, create a project paths table
                 giving NodeId, Depth, and Path to each node (e.g., .1.17.18).   With a project
                 paths table, the following query aggregates over each node and its descendants
                 <rf:iref item="spetA_2002" page="107"/>.
                 <code>
                     ... JOIN ProjectPaths pp On ... = pp.NodeID WHERE Path LIKE (SELECT Path from
                     ProjectPaths WHERE NodeID=1)+'%'
                 </code>.  
             </li><li>
                 DateTime -- ISO 8601 format is YYYY-MM-DD HH:MM:SS.    Use SMALLDATETIME for minute
                 granularity.  Be careful of using UTC time -- it is easy to get wrong.  <rf:iref
                     item="spetA_2002" page="110-149"/>.
             </li><li>
                 DateTime to Date -- Convert to string format to convert datetimes into dates.  For example,
                 <code>convert(varchar(20), convert(datetime, @datetime, 101), 101)</code>
             </li><li>
                 Audit Logging -- Log row-level updates or activity  level updates.  Divide the log
                 into two identical tables for recent activity and archives. <rf:iref
                     item="spetA_2002" page="150-188"/>.
               </li><li>
                   Median -- Compute the media by a self-join <rf:iref item="spetA_2002"
                       page="255-259"/>.
                   <code>
                       GROUP BY x.Hours HAVING SUM(CASE WHEN  y.hours =&lt; x.hours THEN 1 ELSE 0
                       END)>=(COUNT(*)+1)/2 AND
                       SUM(CASE WHEN  y.hours >= x.hours THEN 1 ELSE 0
                       END)>=(COUNT(*)/2)+1 
                   </code>
               </li><li>
                   identity column -- Identity columns automatically assign a new ID on insert. 
                   This is particularly useful for assigning numeric IDs to multi-column indices. 
                   They do not work well for backup and recovery since the IDs are, by default,
                   autmoatically reassigned, thus breaking any foreign key links.  
                   
                  <p>To insert identity values into a table, <code>SET IDENTITY_INSERT tablename ON</code>, 
                      Only one table may be configured at a time.</p>
                   
                   <p>Use <code>ALTER table</code> to remove or restore the IDENTITY property.  On
                       restore you need to reset the seed to the next available value.  
                       Alternatively, use <code>DBCC CHECKIDENT</code> to automatically reset the
                       seed.</p>
                   
                   <p>Use <code>bcp ... -E</code> to preserve identity columns during bulk load.   
                       See <rf:iref item="sql-server-bulk"/></p>
                </li><li>
                    split/join -- It is difficult in SQL Server to split and join values into/from
                    rows.  Walk the string to split values and use a recursive CTE to join values.  See "Creating a Delimited List" <rf:iref item="moliA_2005" page="121"/>
                </li><li>
                    Recursive CTE -- A recursive CTE use two or more common table expressions.  One
                    expression is the base and the other defines the recursive step.  Be sure to use
                    an indexed table for the recursive step.  Use <code>option (MAXRECURSION
                    nnn)</code> to catch infinite loops.  For example, 
                    <pre>
                        ;with 
                        state_history_cnt# as
                        (
                            select ID,
                                count(*) as cnt
                            from lotus_state_history
                            group by ID
                        )
                        insert into #state_history (ID, rn, cnt, State, StateSet, SetBy)
                        select cast(e.ID as varchar(20)) as ID,
                            row_number() over (partition by e.ID order by StateSet desc) as rn, 
                            c.cnt,
                            cast(e.State as varchar(30)) as State,
                            e.StateSet,
                            cast(e.SetBy as varchar(30)) as SetBy
                        from lotus_state_history as e
                        join state_history_cnt# as c on e.ID=c.ID
                        
                        ;with
                        x# (ID, len, cnt, list) as
                        (
                            -- Anchor member definition
                            select ID,
                                rn as len,
                                cnt,
                                cast(cast(StateSet as varchar(20)) + ' ' + State + ' ' + SetBy as varchar(1000)) as list
                            from #state_history 
                                where rn = 1
                        UNION ALL
                             -- Recursive member definition defining x_len+1 from x_len
                             -- must use an indexed table for #state_history
                            select e.ID, 
                                e.rn as len,
                                e.cnt,
                                cast(x.list + '\n' + cast(StateSet as varchar(20)) + ' ' + State + ' ' + SetBy as varchar(1000)) as list
                            from x# as x 
                            join #state_history as e on e.ID = x.ID
                                where e.rn = x.len+1
                        )
                        select ID, list from x# where len=cnt option (maxrecursion 100)
                    </pre>
                </li><li>
                    \t and \r\n -- To insert a literal new line use char(13)+char(10).  To insert a literal
                    tab use char(9)
                </li><li>
                    Integration Services (SSIS, DTS) -- See SQL Server Business Intelligence
                    Development Studio from the Start Menu.
                </li><li>
                    dynamic SQL -- You may execute a string that represents an SQL query.   For an
                    introduction and long list of precautions, see "Dynamic SQL"  in Sommarskog's <a
                        href="http://www.sommarskog.se/arrays-in-sql.html">Arrays and Lists in SQL
                        Server</a>
                </li><li>
                    case-sensitive equality -- By default, SQL Server performs case-insensitive
                    equality tests.  For a case-sensitive comparison, either use a varbinary comparison with an equality test or redefine
                    the column with a collation.  For details, see Kondreddi's
                    <a
                        href="http://vyaskn.tripod.com/case_sensitive_search_in_sql_server.htm">discussion.</a>.
                    If you change the collation, you can not combine different collations
                    with an operator.    Unless every field is case-sensitive, use case-sensitve
                    equality testing as needed (e..g., <code> where myval = testval COLLATE
                        SQL_Latin1_General_CP1_CS_AS</code>).
                </li><li>
                </li><li>
                </li><li>
                    
                </li></ul>
        </rf:item>
        <rf:item id="sql-server-log" title="Shrinking the Transaction Log for SQL Server" date="July
            2007" author="bbarber">
            <p>SQL Server stores a database as a database file (e.g., data/road.mdf) and a
                transaction log file (e.g., data/road_log.ldf).   The transaction log records every
                operation that modifies the database.  The transaction log will grow
                indefinitely until it consumes all of the disk space.</p>
            <p>To shrink the transaction log</p>
            <ul><li>
                Review SQL Server topics under 'Transaction log backups -- managing, recovery
                models'. and 'Transaction logs -- about transaction logs, shrinking, truncating'.
            </li><li>
                The default recover model is the Simple recovery model.  Use the Simple recovery model if you can lose recent activity when restoring a
                database from backup.   You need the Enterprise edition to use the Full recovery and
                Bulk-logged recovery models.
            </li><li>
                In the full recovery model, the transaction log is truncated after each backup.
            </li><li>
                In the simple recovery model, you need to shrink database.   First, perform a full
                backup of the database.  Then, right-click the
                database and go to <code>Tasks->Shrink->Database</code>.   Unless your database is
                immense, select 'Reorganize files
                before releasing unused space' and set the 'Maximum free space' to 0%. 
            </li><li>
                If your database is well backed up, turn on 'Auto Shrink' to periodically run 'Shrink'.
            </li></ul>
        </rf:item>

        <rf:item id="sql-server-performance" title="Performance optimization for SQL Server" date="Aug 2006" author="bbarber">
            <p>Query optimizer --  Stored procedures, inline table functions, sql statements, and union
                queries may have radically different performance characteristics.  For example,
                individual SQL statements may be fast, but their combination as a UNION or procedure
            is much slower than the sum of the parts.  </p>
            <ul><li>
                Estimated query plan -- Look for table scans.  They can be slow for large tables,
                especially when multiple table scans participate in a join.
            </li><li>
                Actual query plan -- The relative timings appear to be an estimate.    The actual bottleneck may be
                elsewhere.
            </li><li>
                Clustered index -- A clustered index can make an immense difference, especially for
                a heavily used table.
            </li><li>
                Query analysis -- The recommendations have been too detailed to be helpful.
            </li></ul>
            <p>Suggestions</p>
            <ul><li>
                Tuning plan -- Given a slow query, add and remove indices while checking
                performance.   Consider clustered indices or included columns.
            </li><li>
                Disabling Indexes -- Documentation on temporarily disabling an index.  Use it for
                bulk load.  Disabling a view index physically deletes the index.
            </li><li>
                Index on temporary table -- Creating an index on a temporary table can double the
                cost of a stored procedure.    It appears to change the query optimizer since
                running the stored procedure piecewise is faster than running the
                stored procedure as a whole.
            </li><li>
                Left join of a left join -- Always tie left joins to existing tables, otherwise
                the query optimzer can produce a bad plan for a stored procedure.                  
            </li><li>
                
            </li><li>
            </li><li>
            </li></ul>
        </rf:item>
        <rf:item id="sql-server-stored" title="Using stored procedures and functions with SQL Server" date="Dec 2005"
            author="bbarber">
            Use stored procedures and user-defined functions for all source-controlled SQL.  
            If you embed SQL in code, it is difficult to change the database schema.
            <ul><li>
                Standard prefix -- Use the following standard prefix.   <code>ANSI_NULLS</code> and
                <code>QUOTED_IDENTIFIER</code> conforms with SQL-92.  Double quotes can not be used for
                string literals.  <code>NOCOUNT</code> turns off row count reporting.  Use @@ROWCOUNT
                instead.  See <code>SQL Server Help</code> for documentation.
                <pre>
                    SET ANSI_NULLS ON
                    SET QUOTED_IDENTIFIER ON
                    IF OBJECT_ID ( 'rd_TestcaseReport', 'P' ) IS NOT NULL 
                    DROP PROCEDURE rd_TestcaseReport;
                    GO
                    CREATE PROCEDURE rd_TestcaseReport
                    @testcase_id varchar(255)
                    AS
                    BEGIN
                    SET NOCOUNT ON;
                    
                    select * from table
                    END
                    GO
                    -- GRANT EXECUTE ON OBJECT::dbo.rd_TestcaseReport
                    -- TO qa;
                    GO
                </pre>
            </li><li>
                Naming standards -- Use a classification prefix followed by the primary entity, e.g.,
                <code>rd_TestcaseReport</code>.   This convention uses alphabetical order for each
                entity.
            </li><li>
                Default parameters -- Default parameters may be defined using '= value'.    Missing
                parameters are not assigned default values.  Use
                <code>DEFAULT</code>  instead.
            </li><li>
                Tutorials -- See Sommarskog's <a
                    href="http://www.sommarskog.se/share_data.html">How to share data between stored
                    procedures</a>
            </li><li>
                Query optimizer -- The query optimizer is brittle.  For example an equi-join between
                large data sets is efficient, but the same join on constants is inefficient.  The query
                optimizer works across all views, in-line
                table-valued functions, and common table expressions (CTE, with ...).   
            </li><li>
                Non-inlined, table-valued functions -- Simplify the source and split up query plans by defining
                table-valued functions.   Collect a reduced row set into the function's table-valued variable,
                then manipulate this table.  Use table-valued functions instead of temporary tables.
            </li><li>
                Inline table-valued functions -- An inline table-valued function is a
                parameterized view.  It consists of one select statement.
            </li><li>
                table variable -- A table variable is a temporary table for table-valued functions
                and stored procedures.  In a stored procedure, table variables cause fewer
                recompilations than temporary tables.  Use a temporary table if you need a parallel query execution
                plan.
            </li><li>
                table parameters -- Use a temporary tables as table parameters for stored
                procedures and user-defined functions [?].    Use a 'select' or table variable to
                return a table from a stored procedure.    A table variable may not be used as a 
                parameter for a stored procedure.
            </li><li>
                insert of an EXEC -- Capture the results of an EXECUTE with an INSERT.  The target
                table must have the same columns as generated by all SELECTS in the stored
                procedure.  The stored procedure can not use common table expressions [?].
            </li><li>
                CLR table functions -- A function may use Microsoft's C# or Visual Basic instead of
                SQL.  Both languages are compiled to CLR byte codes and converted to executable code
                on demand.   They work well for computation-intensive functions.  Tabular results are
                streamed to SQL Server as needed.  For an introduction, see "Using the CLR" in Sommarskog's <a
                    href="http://www.sommarskog.se/arrays-in-sql.html">Arrays and Lists in SQL
                    Server</a>
                        
            </li></ul>
        </rf:item>
        <rf:item id="sql-server-error-handling" title="Error handling in SQL Server" date="May 2007"
            author="bbarber">
            <ul><li>
            </li><li>
                Tutorials -- See Sommarskog's <a
                        href="http://www.sommarskog.se/error-handling-II.html">Implementing error
                        handling  with stored procedures</a>
                
            </li><li>
                Try...Catch... -- SQL 2005 adds BEGIN TRY...BEGIN CATCH statements.  Any errors in
                the try block or stored procedures called by the try block transfer to the catch
                block.  The catch block can display information about the error.  See SQL 2005
                documentation for <code>Try...Catch...</code>
            </li><li>
                Open transactions -- Be cautious of open transactions due to error recovery.  Most
                errors should perform a ROLLBACK.  See Sommarskog's tutorial on error handling. 
            </li><li>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
                
            </li></ul>
        </rf:item>
        <rf:item id="sql-server-view" title="Views in SQL Server" date="Jun 2006" author="bbarber">
            <p>Use a view to simplify standard queries. </p>
            <ul><li>
                CREATE VIEW -- Creates a view.  A view is the same as a macro.  A query expands all
                views into base tables.  Use indexed views (see following) to materialize a view. 
                
            </li><li>
                Views (Database Engine)  -- Top-level documentation
            </li><li>
            </li><li>
            </li></ul>
            <p>Use an indexed view for automatic maintenance of derived data tables.  The view must
                contain at least one unique clustered index.  The query optimize may use a view index in
                queries that do not reference the view</p>
            <ul><li>
                Designing Indexed Views -- Top level documentation on indexed views.
            </li><li>
                Creating Indexed Views -- Detailied documentation on indexed views.
            </li><li>
                Resolving Indexes on Views -- How SQL Server uses indexed views for
              performance tuning.
            </li><li>
            </li></ul>
        </rf:item>
        <rf:item id="sql-server-fulltext" title="Full-text indexing in SQL Server" date="Jan 2008"
            author="bbarber">
            <p>SQL Server 2005 includes full-text indexing.  For an introduction see the help topic
                <i>Full-Text Search</i>.
            </p>
            <p>Set up full text search [Help: <i>Creating Full-Text Indexes</i>]</p>
            <ul><li>
                Define index ID column -- Full-text search requires an ID column in each table.  The
                ID must be unique and non-null.  It should be numeric and clustered.
            </li><li>
                Enable indexing -- Execute <code>CREATE FULLTEXT CATALOG RoadIndex</code>.   
                If it reports an errors, execute <code>sp_fulltext_database 'enable'</code> as
                instructed.
            </li><li>
                Build index -- Use <i>Create FULLTEXT INDEX</i> on one or more columns.  Binary
                columns (varbinary(max) or image) require a <code>TYPE COLUMN</code> annotation.
                For a simple example,
<pre>
    delete from index_item
    sp_fulltext_database 'enable'
    CREATE FULLTEXT CATALOG RoadIndex
    CREATE FULLTEXT INDEX ON index_item (item_url, topic, filename)
    KEY INDEX primary_index ON RoadIndex WITH CHANGE_TRACKING AUTO
</pre>          
            </li><li>
                CONTAINSTABLE  -- CONTAINSTABLE is faster than CONTAINS since it retrieves a table
                of matches.   The 'KEY' column must be quoted.  For example
<pre>  select * from index_text as t join
  containstable(index_text, text, '"Adam*"') as c on t.text_id = c.[key]
  order by rank desc</pre>
            </li><li>
                Performance -- For more performance tips, see 
                Microsoft's <a href="http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/ftslesld.mspx"
                    >SQL Server 2005 Full-Text Queries on Large Catalogs</a> and
                <a href="http://msdn2.microsoft.com/en-us/library/aa175787(sql.80).aspx"
                    >10 ways to Optimize SQL Server Full-Text Indexing</a>.
            </li><li>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
                
            </li></ul>
        </rf:item>
        <rf:item id="sql-server-dns" title="Data source name for SQL Server" date="Apr
            2007" author="bbarber">
            <p>To set up a data source name (DSN) for SQL Server</p>
            <ul><li>
                Control Panels->Administrative Tools->Data Sources (ODBC) -- Open one of the DSN
                tabs (User for user-specific, System for system-wide, File for file configures)
            </li><li>
                Add->SQL Server -- Add a new DSN and select SQL Server as the driver.
            </li><li>
                Configure the connection -- enter the server and credentials
            </li><li>
                Test the connection
            </li><li>
                Test the DSN with odbc -- [Warning: the driver is chatty]
                <pre>
                    odbc "DSN=road;uid=qa;pwd=qauser" "select * from cards_map_build"
                </pre>
            </li></ul>
        </rf:item>
        <rf:item id="sql-server-oracle" title="Migrating data from SQL Server to Oracle" date="Apr
            2007" author="bbarber">
            <p>To migrate data from SQL Server to Oracle, you first need to install client software
            for Oracle. </p> 
            <ul><li>
                <rf:iref item="setup-oracle-client"/> -- A good approach is Oracle instant client
               accessed via MSSQL linked servers.
                </li><li>
                        MDAC -- Download and install a recent version of Microsoft's <a
                            href="http://msdn2.microsoft.com/en-us/data/aa937730.aspx">MDAC</a> --
                        Install the release before any service packs even though both installers
                        have the same name.
                    </li><li>
                        Control Panels->Admnistrative Tools-> Data Sources (ODBC) -- Configure a
                        data source name (DSN) using the Oracle ODBC driver.  Test your connection.
                    </li><li>
                        Read and Execute permissions to ORACLE_HOME -- The ORACLE_HOME directory
                        (e.g., oracle\ora92) needs Read and Execute permissions.   Right-click on
                        the directory, select <code>Properties->Security</code>.   If necessary, add
                        the group <code>Authenticated Users</code>.   Give this group read and
                        execute permission to the directory.  In the Advanced tab, propagate these
                        permissions to all sub-folders.  Then <b>reboot</b>.
                    </li><li>
                        Linked server using MSDAORA -- In SQL Server, create a linked server.    You may be able
                        to use OraOLEDB in place of  MSDAORA, but the later is more likely to
                        succeed.
                        <pre>
                            exec sp_addlinkedserver @server='myserver.host.com',  @srvproduct='Oracle', @provider='MSDAORA',@datasrc='my_DNS_NAME'
                            exec sp_addlinkedsrvlogin @rmtsrvname = 'myserver.host.com', @useself = 'false', @locallogin = 'my_login_name', @rmtuser='remote_login_name',   @rmtpassword='remote_password'
                        </pre>

                    <p>Test the server (using double quotes!) -- exec sp_testlinkedserver
                        "myserver.host.com"</p>

                    <p>If you make a mistake, delete the link with</p>
                        <pre>
                            exec sp_droplinkedsrvlogin @rmtsrvname = 'testdb.xyz.com', @locallogin = 'TEST\testdb_user'
                        exec sp_dropserver @server='testdb.xyz.com'
                        </pre>
                    </li><li>
                        OPENQUERY -- Use OPENQUERY for selects, inserts, etc.  Insert, update, and
                        delete syntax is odd.  For insert, you select a non-existent row.  Updates
                        and deletes require a unique index for the destination.  
                        Use double quotes for the linked server name.
                        <pre>
                        select * from OPENQUERY("myserver.host.com", 'select created_by from cards_call_interface')
                        insert OPENQUERY("myserver.host.com", 'select created_by from cards_call_interface where 0=1') values ('Fred')
                        </pre>
                    </li><li>
                        char(1) -- SQL Server does not support char(1) columns in Oracle.  It
                        reports "ORA-01401: inserted value too large for column".    Replace char(1)
                        columns in Oracle with <code>char(1 byte)</code>. 
                    </li></ul>
            
            Other approaches for Oracle-SQL interoperability.
            <ul><li>
                Data Direct -- Database links from Oracle to SQL Server are not
                well-supported by Oracle.  Apparently you need to purchase an ODBC driver
                configured for Oracle.   Oracle recommends Data Direct running on a Unix server.
            </li><li>
            </li><li>
                Oracle database link -- Another approach is to use Oracle's database link.
                A database link connects Oracle to remote databases
                using Oracle's heterogenous services.
                 See Oracle's 
                    <a
                        href="http://download-east.oracle.com/docs/cd/A95432_01/a82868/ch2.htm">documentation</a>,
                    does not include setup instructions.
                </li><li>
                    SQL. server step-by-step -- A step-by-step is
                    <a
                        href="http://www.dba-oracle.com/t_database_link_sql_server_oracle.htm">here</a>.
                    These instructions are incomplete.
                </li><li>
                    Sybase step-by-step -- From the same source, another step-by-step is
                    <a
                        href="http://www.dba-oracle.com/t_heterogeneous_database_connections_sql_server.htm">here</a>.
                    These instructions are also incomplete.
                </li><li>
                    <a href="http://jtds.sourceforge.net/">jTDS JDBC Driver</a> -- SQL Developer
                    needs a JDBC driver for SQL Server.  Download a JDBC
                    driver for SQL Server and Sybase.  To install, drop the .jar file into <code>sqldeveloper\jdk\jre\lib\ext</code>
                    </li><li>
                    OraOLEDB -- Download and install Oracle's <a
                        href="http://www.oracle.com/technology/software/tech/windows/ole_db/htdocs/utilsoft.htm">Oracle
                        Provider for Ole DB</a>.  
                        <ul><li>
                            Install all of the components or experiment
                    and figure out which components are actually needed.  
                    The installer creates a directory, ora92, and
                    configuration files in <code>network\ADMIN</code>.  These files may need
                    additional work.  See the notes on tnsnames.ora above.  As mentioned, it may help to
                    create a TNS_ADMIN environment variable.
                        </li><li>
                            
                            Install Microsoft MDAC -- <a
                                href="http://msdn2.microsoft.com/en-us/data/aa937730.aspx">Download</a> the
                            latest Data Access Components from Microsoft.   Service
                            packs must be installed after the main installer, even though they may have the
                            same name.
                        </li><li>
                            Oracle Provider for OLE DB -- Oracle's universal installer provides everything
                            else that you need.
                        </li><li>
                            The ODBC installer will walk you through tnsnames.ora configuration.  By default
                            it uses fully qualified names with a default domain.    If  defines
                            NAMES.DEFAULT_DOMAIN it must be used.
                        </li><li>
                            Test the configuration with odbc
                            <pre>
                                odbc "DSN=testdb;uid=test;pwd=db" "select * from  test_table"
                            </pre>
                        </li><li>
                        </li><li>
                        </li><li>
                        </li><li>
                            
                        </li></ul>
                    </li><li>
                </li><li>
                Database Link -- Create a database link to the remote server (admin priveleges).   For SQL Server, it
                needs Oracle Heterogeneous Services.
            </li><li>
                </li><li>
            </li><li>
            </li><li>
            </li><li>
                Migration Workbench -- The Migration workbench is an extension to SQL Developer.  It needs admin priveleges on the
                database.  It creates a lot of tables, etc.
            </li></ul>

        </rf:item>
 
        <rf:item id="sql-server-bulk" title="Bulk load in SQL Server" date="Jan 2006" author="bbarber">
         <p>Use bcp, BULK Insert, or OpenRowSet Bulk to load large data files into SQL Server</p>
         <ul><li>
             Security -- bcp and sqlcmd use <rf:iref item="sql-server-security"/>.  You may override the
             defaults with command line options or environment variables (<rf:iref
                 item="sql-server-help"/>).
             </li><li>
            bcp -- Bulk load from the command line, e.g., <code> bcp mugs_log in 'mugs-pass.txt' -F2 -c -Sdoyle -T
               -h"TABLOCK" -f format.mugs_log.txt -e error-rows.txt</code> where -F2 = skip header line, -c =
            character data, -S = server, -T = trusted connection, -h = hints, TABLOCK = table
            locking, -f = format file, -e = error-log.  Always define an error-log, otherwise
                 erroneous data is not identified.
             </li><li>
                 bcp with sed -- 'sed' does not produce CRLF line terminators for the 'i' and 'a'
                 command.  Append a '\r'.
             </li><li>
                 bcp with tsv -- For tab-separated fields, you do not need a format file.   Do not
                 use Unix line-endings (LF, \n).
                 <br/>bcp road.dbo.lotus_items in items.tsv  -T -c -e error.x
             </li><li>
                 backup tables -- Use bcp to backup database tables as TSV files, 
                 e.g., <pre>bcp road.dbo.lotus_attachments out Backup/Lotus/lotus_attachments-070620.tsv -T -c</pre>
             </li><li>
                 database recovery -- Use bcp to recover a database by copying each of its tables.  
                 After duplicating the table schemas, run the following pair of bcp commands for
                 each table [pnie@microsoft]
<pre>    bcp pubs.dbo.authors out "C:\authors_bcp_out.data" -w -S"MS-SHA-WEINIE\SQL2005NO2" -U"sa" -P"YourPassword"
    bcp pubs_new.dbo.authors  in "C:\authors_bcp_out.data" -w -S"MS-SHA-WEINIE\SQL2005NO2" -U"sa" -P"YourPassword"
</pre>                    
        </li><li>
            Fast BCP -- no replication, table locking (<code>-h"TABLOCK"</code>), either no index or
            empty table and no batches.
        </li><li>
            Format file, non-XML -- 
            Use a non-XML format file to change the order and selection of columns.  They are easily
            generated with
            <pre>
                bcp mugs_log format nul -f format.mugs_log.fmt  -T -c  #  (-T = trusted connection, -c = character input)
            </pre> 
            Bulk load the data with
            <pre>
                bcp mugs_log format nul -f format.mugs_log.fmt  -T -c  #  (-T = trusted connection, -c = character input)
            </pre> 
            It is easy to rearrange
            and skip columns.  See the SQL help topic, <code>Using a Format File to Map Fields to
                Columns During Bulk Import </code> .  Here is a sample
<pre>
    9.0
    7
    1       SQLCHAR       0       100     "@new_lotus_customers@ @1@ @"     0     row_prefix                                 SQL_Latin1_General_CP1_CI_AS
    2       SQLCHAR       0       100     "@ @"     1     ID                                   SQL_Latin1_General_CP1_CI_AS
    3       SQLCHAR       0       100     "@ @"     2     ID_date                              SQL_Latin1_General_CP1_CI_AS
    4       SQLCHAR       0       0       "@ @"     3     Customer                             SQL_Latin1_General_CP1_CI_AS
    5       SQLCHAR       0       0       "@ @"     4     CustomerName                         SQL_Latin1_General_CP1_CI_AS
    6       SQLCHAR       0       0       "@ @"     5     CustomerEmail                        SQL_Latin1_General_CP1_CI_AS
    7       SQLCHAR       0       100     "@ @pv@\r\n"   6     CustomerNotified                     SQL_Latin1_General_CP1_CI_AS
</pre>
        </li><li>
            Format files, XML -- Although Microsoft encourages the use of XML format files, they do
            not work as well as non-format files.  They do not allow you to skip columns.  Bcp
            ignores the 'COLUMN' elements except for their order and their ID.    Also, the
            generated format files do not work well for textual input.  You need to edit them.
             Here is a sample
<pre>
   &lt;?xml version="1.0"?>
   &lt;BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       &lt;RECORD>
           &lt;FIELD ID="1" xsi:type="CharTerm" TERMINATOR="\t" MAX_LENGTH="255" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
           &lt;FIELD ID="2" xsi:type="CharTerm" TERMINATOR="\t"  MAX_LENGTH="255" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
           &lt;FIELD ID="3" xsi:type="CharTerm" TERMINATOR="\t"  MAX_LENGTH="255" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
           &lt;FIELD ID="4" xsi:type="CharTerm" TERMINATOR="\t"  MAX_LENGTH="255" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
           &lt;FIELD ID="5" xsi:type="CharTerm" TERMINATOR="\t"  MAX_LENGTH="12"/>
           &lt;FIELD ID="6" xsi:type="CharTerm" TERMINATOR="\t"  MAX_LENGTH="255" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
           &lt;FIELD ID="7" xsi:type="CharTerm" TERMINATOR="\r\n"  MAX_LENGTH="255" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
       &lt;/RECORD>
       &lt;ROW>
           &lt;COLUMN SOURCE="1" NAME="codeline" xsi:type="SQLVARYCHAR"/>
           &lt;COLUMN SOURCE="2" NAME="machine" xsi:type="SQLVARYCHAR"/>
           &lt;COLUMN SOURCE="3" NAME="testsuite" xsi:type="SQLVARYCHAR"/>
           &lt;COLUMN SOURCE="4" NAME="build" xsi:type="SQLVARYCHAR"/>
           &lt;COLUMN SOURCE="5" NAME="run" xsi:type="SQLINT"/>
           &lt;COLUMN SOURCE="6" NAME="testfile" xsi:type="SQLVARYCHAR"/>
           &lt;COLUMN SOURCE="7" NAME="testcase" xsi:type="SQLVARYCHAR"/>
       &lt;/ROW>
   &lt;/BCPFORMAT>               
</pre>
        </li><li>
            Data type errors from bcp 
            <ul><li>
                If adding or modifying data table columns, bcp can mis-report
                data typing errors.   To fix, delete and recreate the data table. 
                
            </li><li>
                Tutorials -- Sommarskog's <a
                    href="http://www.sommarskog.se/arrays-in-sql.html">Arrays and lists in SQL
                    Server</a>
            </li><li>
                Invalid character value for cast specification -- Compare the column type in the
                format file (e.g., SQLVARCHAR) with the data type in the database (e.g., int). 
            </li><li>
                SQL Server errors -- bcp writes errors from SQL Server to stdout.
            </li><li>
            </li><li>
            </li><li>
            </li><li>
            </li><li>
                
            </li></ul>
        </li><li>
            XML Bulk Load -- <code>SQLXML Bulk Load</code> is nearly as fast as <code>bcp</code>. 
            An annotated XSD file maps the XML Schema to relational data tables.   
            See  <rf:iref item="sql-xml"/>.
        </li><li>
            Delete all rows -- Use <code>TRUNCATE TABLE</code>.  For three million rows it is
            instanteous versus a minute for <code>delete from</code>.  
         </li><li>
             Deleting many rows -- For long tables, sqlcmd DELETE FROM may fail to delete all of the matching
             rows [bbarber 3/07].  It does not report a timeout, nor does it set ERRORLEVEL.    You could test for
             missing output, but better to avoid massive deletes anyway, using TRUNCATE TABLE
             instead.
         </li></ul>
      </rf:item>
      <rf:item id="sql-server-security" title="Managing security from SQL Server" date="Dec 2005"
         author="bbarber">
         <p>To add a new user</p>
         <ul><li>
            To add a user -- A user needs an SQL Server identity as well as a Windows identity.  
            In the <code>Object Explorer</code> window of <code>Microsoft SQL Server Management
                Studio</code>  Select 'Add a new user' from <code>hostname->Security->Logins</code>.  
         </li><li>
             SQL authentication -- If practical, use Windows authentication.  If not, you
             need to allow SQL authentication by visiting <code>Server->Properties->Security</code>,
             selecting
             <code>SQL Server and Windows authentication mode</code>, and restarting the server.
         </li><li>
             Owned schemas -- Leave unselected.  A schema is owned by only one user.
         </li><li>
             Enable databases -- Right-click the user and select the desired databases in <code>User Mappings</code>
         </li><li>
             Default database -- Set the default database for the user.  It is used by <code>Management Studio</code>, <code>sqlcmd</code>, and <code>bcp</code>.  
             See Object Explorer->SQL Server->Security->Logins->Properties->Default
             database.
         </li><li>
            Grant permissions -- Right-click the database->Properties->Permissions->select user -- Grant
            <code>Execute</code> and <code>Select</code> permission.  The <code>With Grant</code>
             option allows the user to grant that permission to others.  For additional help, see 
             <code>granting permissions [SQL Server]</code>.
         </li><li>
             Verify permissions -- On the Permissions page (above), click the button <code>Effective
                 Permissions</code>.
          </li><li>
              Permission not granted -- If the requested permission is not granted, verify the
              problem with <code>Effective Permissions</code>.   If verified, visit
              <code>Server->Properties->Permissions</code>.    Was the grantor of <code>Connect
                  SQL</code> permission enable to grant other permissions?   If not, try changing the
              grantor.  [bbarber 9/06] Got this to work after repeated visits between this page and
              the user's Grant Permissions page.
          </li><li>
              Execute permission -- To grant execute permission to a stored procedure, add the user
              to the stored procedure, 
              <code>Object Explorer->Programmability->Stored Procedures-> Procedure
                  XYQ->Properties->Permissions->Add </code>.  Then select the <code>Execute</code>
              permission.
          </li><li>
              ODBC drivers -- 
              <ul><li>
                  Configuration -- See <code>Control Panel->Adminstrative Tools->Data
                      Sources (ODBC)</code>
              </li><li>
                  <rf:iref item="sql-server-setup"/>
              </li><li>
                  For testing, use Outwit's <a
                      href="http://www.dmst.aueb.gr/dds/sw/outwit/odbc.html">odbc</a>.  For example,
                  <pre>    odbc "Driver={SQL Server};Server=road;Database=road;uid=qa;pwd=qauser" "select * from testcase_bug"</pre>
              </li><li>
                  Microsoft's SQLDriverConnect --   with KnowledgeBase
              </li><li>
                  Microsoft KnowledgeBase -- Search for <a
                      href="http://support.microsoft.com/search/default.aspx?catalog=LCID%3D1033&amp;spid=1044&amp;query=SQL+Server+ODBC+Driver">SQL
                      Server ODBC Driver</a>
              </li><li>
                  <a href="http://support.microsoft.com/kb/140895/en-us">Q140895</a> -- INF: Diagnostic Tips for the Microsoft SQL Server ODBC Driver
              </li><li>
                  SQL Server 2005 Connectivity Issue Troubleshoot -- <a
                      href="http://blogs.msdn.com/sql_protocols/archive/2005/09/28/474698.aspx">Error
                  Messages</a>, <a
                      href="http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx">Part
                      1</a>, <a
                          href="http://blogs.msdn.com/sql_protocols/archive/2005/10/29/486861.aspx">Part
                          2</a>, <a
                              href="http://blogs.msdn.com/sql_protocols/archive/2005/12/22/506607.aspx">Part
                          3</a>
                  
              </li><li>
                  SQL Server Logs -- SQL Server keeps detailed logs, see <code>SQL Server Management
                  Studio->Your server->Management->SQL Server Logs</code>
              </li><li>
                  Kerberos authentication -- Windows Server 2003 uses Kerberos for authentication. 
                  See <a
                      href="http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/security/tkerberr.mspx">Troubleshooting
                  Kerberos Errors</a>
                  
              </li></ul>.   For setup, see .  . 
          </li><li>
          </li><li>
              
          </li></ul>
      </rf:item>
      <rf:item id="sql-server-xml" title="Using XML with SQL Server" date="Dec 2005"
         author="bbarber">
         <p>Use SQL Server 2005 or later.  XML processing barely works in Server 2000</p>
         <ul><li>
            sqlcmd -- SQL command line (replaces <code>esql?</code>).  See <code>SQL Server 2005 Help</code> for
            documentation.  
         </li><li>
            Scripting xml output -- Use the following syntax for scripting sqlcmd (Do not use
            <code>sqlcmd ... &lt;&lt;EOF</code> since it invokes interactive mode).   Most clients do not support <code>FOR XML
               ...</code> since it returns a stream object.   
 <pre>
    cat &lt;&lt;EOF | sqlcmd -v BUILD_ID="2005_11_01-095320"
:XML ON
select * from testcase_builds where build_id='$(BUILD_ID)' 
    and broke_prev is not null and fixed_prev is null
    order by testcase_id, machine for xml auto
 GO
 :QUIT
 </pre>
           </li><li>
               sqlcmd errors -- On an error, sqlcmd writes to stderr and appends '&lt;?MSSQLError ...
               >' to the xml file. 
           </li><li>
               No description provided -- Returned by sqlcmd if  table output is included in the XML
           </li><li>
           </li><li>
           </li><li>
               
           </li><li>
            XML stored procedures -- FIXUP -- How do you define a stored procedure that can return
            either xml or rowset data?    Sqlxml supports <code>exec ... for xml</code> on the
            client side, but it is not supported on the server side nor sqlcmd.   There doesn't
            appear to be a conditional <code>for xml</code> in a stored procedure.  For now, using
            an 'xml' argument to select one of two identical select statements.
         </li><li>
             'No description provided' -- This error occurs when a select returns a dataset instead
             of XML.  Add 'for xml raw ...' to the select statement.
         </li></ul>
      </rf:item>
        
        <rf:item id="sql-server-debug" title="Debugging SQL Server" date="July 2006" author="bbarber">
            <ul><li>
                Edit and execute -- Use a split window for quick edits in SQL Server Management
                Studio.  In one pane, select the region to execute.  In the other pane, edit the
                region.   Re-execute by right clicking the selected region.
            </li><li>
                Log File Viewer -- SQL Server combines its logs with Windows event logs, SQL Agent 
                logs, and Database Mail logs.   It does not include all Windows event logs.  Go to <code>Management Studio->Object
                    Explorer->YourServer->Management->SQL Server Logs</code>
            </li><li>
            </li><li>
            </li></ul>
        </rf:item>
     
        <rf:item id="sql-server-error" title="Errors from SQL Server" date="June 2006" author="bbarber">
            <ul><li>
                Msg 547 ... The UPDATE statement conflicted -- The reported line number is from one
                line before the corresponding <code>ALTER/CREATE Procedure</code>.  This is +4 if you Modify the
                stored procedure in the GUI.  It names the constraint and the name+column of the
                referenced table.
            </li><li>
                Named Pipes Provider, error: 40 - Could not open a connection to SQL Server --
                SQL Server is not responding.  There are many possible causes.  
                <ul><li>
                    <i>SQL Server 2005 Connectivity Issue
                        Troubleshoot</i> <a
                            href="http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx">Part I</a>
                    and <a href="http://blogs.msdn.com/sql_protocols/archive/2005/10/29/486861.aspx">Part
                        II</a>
                </li><li>
                    No description provided -- MSXML4.0 is improperly registered
                    [<a href="http://support.microsoft.com/kb/922546">KB922546</a>].
                    For SQL Server 2005, reregister using <code>Regsvr32 "C:\WINDOWS\system32\msxml4.dll"</code>
                </li><li>
                    The service was turned off -- Restart SQL Server with
                    <code>Control Panels->Administrative Tools->Services->SQL
                        Server->right-click->Start</code>
                </li><li>
                    The protocol was not configured -- Enable TCP/IP or named pipes protocol for <code>SQL Server Configuration Manager->SQL Server
                        2005 Network Configuration->Protocols for MSSQLSERVER</code>.  
                </li><li>
                    Invalid length parameter passed to the SUBSTRING function -- A negative length
                    was passed to the <code>substring</code> function <i>or</i> the
                    <code>LEFT</code> function, for example
                    <pre>select @dir= left(@symlink, len(@last_slash) - @last_slash) </pre>
                </li><li>
                </li><li>
                </li><li>
                </li><li>
                </li><li>
                    
                </li></ul>
            </li><li>
                No description provided -- Non-XML table encountered during XML output.   Run the query in
                SQL Server Management Studio.
            </li><li>
                Unable to open BCP host data-file --- Check the format file specified after bcp's -f
                argument.  
            </li><li>
                Unexpected EOF encountered in BCP data-file -- Either UNIX formated file or Number of input fields does not match
                number of columns in the table.   Check that tabs are not actually spaces.   If they
                differ, use a format file to rearrange.         
            </li><li>
            </li></ul>
        </rf:item>
   </rf:section>
    <rf:section id="oracle" title="Oracle">
        <rf:item id="setup-oracle-client" title="Setup Oracle client" date="Jan 2008"
            author="bbarber">
            <p>There are several choices for an Oracle Client under Windows.  
            Schlichting has a good
            <a href="http://www.databasejournal.com/features/mssql/article.php/3290801">tutorial</a></p>
            <ul><li>
            </li><li>
                <a href="http://www.oracle.com/technology/tech/oci/instantclient/index.html">Oracle
                    Instant Client</a> 
                [<a
                    href="http://www.oracle.com/technology/software/tech/oci/instantclient/index.html">download</a>](freeware)
                -- Installs clients and drivers for access to Oracle
                databases.  Optional packages include ODBC drivers.  
                <a
                    href="http://www.oracle.com/technology/tech/oci/instantclient/releasenotes/ODBC_IC_ReleaseNotes.html">ODBC
                    Release Notes</a> -- includes install directions
                <ul><li>
                </li><li>
                    Download the Basic client.   The Basic Lite client does not work with ODBC.
                </li><li>
                    Unzip the Basic Instant Client into a directory such as <code>/Program
                        Files/Oracle</code>. 
                </li><li>
                    Unzip the ODBC driver into the same directory.
                </li><li>
                    Double-click <code>odbc_install.exe</code> -- It installs the ODBC driver (as show by
                    <code>Control Panes->Administrative Tools->Data Sources->Drivers</code>)
                </li><li>
                    Set environment variable, TNS_ADMIN, to the client directory.   <code>Control
                        Panels->System->Advanced->Environment Variables->System
                        Variables->NEW</code>.  If TNS_ADMIN is not set, the ODBC interface does not
                    work.
                </li><li>
                    Add the client directory to your PATH variable  -- [This step may not be
                    necessary]  Add the client directory to <code>Control
                        Panels->System->Advanced->Environment Variables->System
                        Variables->PATH->Edit</code>.  .
                </li><li>
                    Add your workstation to the network   -- [This step may not be
                    necessary]  Check the network assignment with
                    <code>Control Panel->System->Computer Name</code>  .
                </li><li>
                    Create a file called <code>tnsnames.ora</code> in the client directory.  The
                    string depends on the Oracle server.  Ask the Oracle admin for the exact string.
                    For example,
<pre>
    TESTDB = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = TCP.world) (PROTOCOL = TCP) (Host = testdb.xyz.com) (Port = 1526))) (CONNECT_DATA =
    (SID = testdb) (GLOBAL_NAME = testdb.world)))
</pre>
                    For this example, there is no space before <code>TESTDB</code> and one space before 
                    <code>(SID = testdb)</code>
                </li><li>
                    Check tnsnames.ora -- Be extra careful of spaces, tabs, and newlines.  They are
                    allowed in some places and not allowed others.  There is no error reporting if you
                    get it wrong.  One symptom is Data Sources (ODBC) listing garbage for your TNS
                    NAMES.  Another symptom is <code>Test Connection</code> not asking for password
                    immediately.  Another symptom is a delay between clicking OK on <code>Test Connection</code> 
                    and getting the pass/fail response.
                </li><li>
                    Test with Data Sources (ODBC) -- Go to <code>Control Panels->Administrative
                        Tools->Data Sources (ODBC)->Drivers</code>.  Check that the Oracle driver is
                    listed.  Goto to <code>System DSN</code>, and set up a
                    Data Source.  A DSN (Data Source Name) is Microsoft's equivalent to Oracle's
                    tnsnames.ora).   If the TNS names in tnsnames.ora is not listed, TNS_ADMIN was
                    set up incorrectly.  Click on 'Test'.    Use <code>User DSN</code> to define a DSN for the current user only.
                </li><li>
                    ORA-12154: TNS:could not resolve the connect identifier specified -- ODBC found
                    the tnsnames.ora file but something was wrong with the connect descriptor. 
                    Check it for newlines within values.   You may need to use a qualified name
                    (e.g., <code>DCARDS7.XYZ.COM = (DESCRIPTION...</code>  Look on the Web for examples.  Look at
                    Oracle's <a
                        href="http://download-east.oracle.com/docs/cd/B14117_01/network.101/b10776/tnsnames.htm">Local
                        Naming Parameters (tnsnames.ora)</a>
                </li><li>
                </li><li>
                    Test with Outwit's <a
                        href="http://www.dmst.aueb.gr/dds/sw/outwit/odbc.html">odbc</a>.  For example,
                    <pre>    odbc "Driver={Oracle in instantclient10_2};Dbq=testdb;Uid=test;Pwd=..." "select * from test_table"</pre>
                </li></ul>
            </li><li>
                Configure TNS_NAMES and ODBC
                <ul><li>
                    Set TNS_NAMES and ORACLE_HOME to the same directory.   With Instant Client,
                    ORACLE_HOME may be unnecessary.  Toad for Oracle needs TNS_NAMES to identify 
                    Oracle servers.  If TNS_NAMES is not defined, ODBC clients will search every
                    directory in PATH, plus some other locations.
                </li><li>
                    In the client directory, create a file <code>tnsnames.ora</code>.  The basic
                    syntax is a_tns_name = (DESCRIPTION = ... ).   Ask your DBA for the
                    connect descriptor.  Be careful of newlines -- they can occur in some locations,
                    but not everywhere.
                </li><li>
                    Control Panels->Administrative Tools->Data Sources (ODBC)->Drivers -- Locate the
                    name for the ODBC driver, typically "Oracle in installclient10_2".
                </li><li>
                    ODBC connection string -- 
                    
                    "Driver={Oracle in instantclient10_2};Dbq=a_tns_name;Uid=a_user_ID;Pwd=a_password"
                </li></ul></li></ul>

        Oracle clients
        <ul><li>
        </li><li>
    <a href="http://www.toadsoft.com">TOAD</a> -- Oracle client. TOAD is really great. It's much
    more powerful than Oracle's own clients.  There's a freeware version [ashish]. 
    It requires an ODBC driver or ORACLE_HOME.  Toad does not allow multiple result
    sets.  Save result sets in Excel format by right-clicking the book icon.    Write
    scripts as <code>begin ...; ...; end; exit</code>
        </li><li>
            <a
                href="http://www.dbvis.com/products/dbvis/info.html">DBVisualizer</a>
    </li><li>
    <a href="http://www.oracle.com/technology/products/database/sql_developer">Oracle
    SQL Developer</a> -- Download Oracle's free client.
    </li></ul>
    
            Errors from Oracle
            <ul><li>                    
                </li><li>
                    ora-12638 credential retrieval failed -- Oracle server has lost the
                    connection to the Oracle authentication service.  You may need to restart
                    the computer.  Alternatively, turn off authentication services by setting
                    <code>SQLNET.AUTHENTICATION_SERVICES= (NONE)</code> in
                    <code>ORA_ROOT/network/server/sqlnet.ora</code>.  You do not need to restart
                    the Oracle service.
                </li></ul>
            
            Oracle hints
            <ul><li>
            </li><li>
                Insert Append -- The Append hint will speed up inserts, especially if the table has
                NOLOGGING and indices disabled 
                [<a href="http://www.dbspecialists.com/presentations/load_faster.html"
                    >Load Your Data Faster</a>]
<pre>
    INSERT /*+ Append */ INTO calls
    (
    call_id, call_date, emp_id, call_type, details
    )
    SELECT call_id, call_date, emp_id, call_type, details
    FROM   calls_external;
</pre>
            </li></ul>
        </rf:item>
    
    </rf:section>
   <rf:section id="win-error" title="Window Error Messages" order="sorted">
       <rf:item id="bad-assoc" title="Error: Bad file association, Explorer launches the wrong program"
           date="Oct 2006" author="bbarber">
           <p>Symptoms:  when you double-click a file, the wrong application launches, yet the file
               association looked OK.</p>
           <ul><li>
               regedit --
               <code>HKCU/Software/Microsoft/Windows/CurrentVersion/Explorer/FileExts/tcl/Application</code>
              (substitute your extension for <code>tcl</code>).   This key takes precedence over the normal file 
               association key in OpenWithList.   It is set by the "Unknown extension" dialog box.  
               Find this kind of bug with regmon from Setup SysInternals.
           </li><li>
           </li><li>
           </li><li>
           </li></ul>
           <p>
           </p>
       </rf:item>
       <rf:item id="net-svchost" title="Error: Logon Failure: The target account name is incorrect [System
           error 1396]"
           date="July 2006" author="bbarber">
           <p>Symptoms:  <code>net use</code> works when run as a user but produces "Logon Failure"
               when run as a scheduled task.   Username and password are identical.  The same script
               runs <code>net use</code> correctly for other resources.  Executing the
               same commands and scripts in a test bat file works OK, even if scheduled as a run-once.</p>
           <ul><li>
               A scheduled task runs under SVCHOST as the given user.    This error message means
               that the SPN [Service Principle Name] for the domain is incorrect.  It appears to be
               a DNS configuration error.  Rebooting may help.
           </li><li>
               From <a href="http://www.experts-exchange.com/Networking/Q_21700034.html">Experts-Exchange</a> -- I'm posting my own answer - we finally bit the bullet and called for Microsoft support.  It took them two hours of poking around, but they did solve the problem.
               
               <p>In a nutshell - the machine had some incorrect and, apparently conflicting settings for its IP protocol.  In the DNS settings, the "Append these DNS suffixes" radio was selected and two domains were listed, one being our companies domain name and the other that domain name with the internal domain name listed. (Example: mycomany.com and office.mycompany.com.)</p>
               
               <p>Additionally, the "Use this connection's DNS suffix in DNS registration" box was checked.</p>
               
               <p>Changing the radio button to "Append Primary and connection specific DNS suffixes" and unchecking the "Use this connection's..." box solved the problem.</p>
           </li><li>
               <a href="http://www.chicagotech.net/systemerrors.htm">ChicagoTech</a> -- Additional
               notes on System Error 1396
           </li><li>
               
           </li><li>
           </li></ul>
       </rf:item>
       <rf:item id="err-c0000005" title="Error: 0xC0000005, error 2755 -- ACCESS_VIOLATION" date="Aug 2006" author="bbarber">
             <p>An ACCESS_VIOLATION is reported when the hardware traps a write-access or
                 execute-access error </p>
           <ul><li>
               <a href="http://www.microsoft.com/msj/1097/hood1097.aspx">Pietrek on hardware
                   exceptions</a> -- 1997 article on details of hardware exception handling
               in win32.  Includes a C program to generate most of the exceptions
           </li><li>
           </li><li>
           </li><li>
           </li></ul>
       </rf:item>
       <rf:item id="blue-screen" title="Error: blue screen" date="Aug 2007" author="bbarber">
           A blue screen error may indicate hardware memory errors.  For example, 
           DMA access may fail for a chip.   
           <ul><li>
            Try taking out one chip at a time, and seeing if the
             problem persists.           
           </li><li>
               <a href="http://oca.microsoft.com/en/windiag.asp">Windows Memory Diagnostic</a>
               from Microsoft (free)
           </li><li>
           </li><li>
           </li><li>
           </li><li>
           </li></ul>
       </rf:item>
       <rf:item id="reg-err" title="Error: Can not register a dll" date="Aug 2006" author="bbarber">
           <p>If the installer reports a registration error, with
            </p>
           <ul><li>
               regsvr32 --  try registering the file directly [<rf:iref item="cmd-useful"/>] .  
           </li><li>
               <rf:iref item="setup-depends"/> -- check the file's dependencies
           </li><li>
               <a href="http://support.microsoft.com/kb/140346/">Reasons for OLE
                   registration failures</a>.  Includes debugging instructions under Visual C++
           </li><li>
               LoadLibrary,  access to memory location -- May be a Data-Execute-Protect (DEP) error.
               The error code is ERROR_NOACESS (998).   See <a
                   href="http://support.microsoft.com/default.aspx?scid=kb;en-us;196069">Q196069</a>,
               LoadLibrary API fails with 998 (ERROR_NOACESS).      The system loader trapped an
               "access violation (exception c0000005) while mapping the DLL file image or executing
               the startup code" <rf:iref item="err-c0000005"/>     
           </li></ul>
       </rf:item>
       <rf:item id="blank-desktop" title="Error: Blank desktop after log in" date="Mar 2006" author="bbarber">
          <p> When I log on to an account in Windows XP, all I see is a blank desktop with no start menu, taskbar or icons. How can I fix this? 
             </p>
          
          <p>It sounds like the shell isn't loading. You could try CTRL-SHIFT-ESC and File>run>explorer.exe [enter]
              [<a href="http://www.answerbag.com/c_view.php/417#q_31024">AnswerBag</a>]</p>
      </rf:item>
       <rf:item id="blue-dep"  title="Error: IRQL_NOT_LESS_OR_EQUAL 000A (9CE66240, 0002, 000, 80522C18)" date="Oct 2005" author="bbarber">
         <p><b>Data Execution Protect</b> -- Only occurs on modern processors when booted in /noexecute=optin mode.</p>
         <ul><li>
            Use trial and error to identify the bad program (there must a better way).
         </li><li>
            Control Panels->System->Advanced->Performance->Settings->Data Execution Protection->Turn
            on DEP except -- add the bad program to the list.
         </li><li>
            Workaround -- restrict DEP to windows OS files.  If that doesn't work, turn off
            "/noexecute=optin" in Control Panels->System->Advanced->Startup and Recovery.  
         </li></ul>
       </rf:item>
       <rf:item id="locked-out"  title="Error: The referenced account is currently locked out and may
           not be logged on to" date="July 2007" author="bbarber">
           <p>A networked server may refuse connections with this error.  For example "\\library is not
           accessible.  You might not have permission to use this network resource. ..."
           </p>
           <ul><li>
               Retry lock status -- Windows apparently caches the lock status, preventing resets
               after temporary lockouts.   Retry as another user with "Connect using a different user name" in  
               <code>Explorer->Tools->Map Network Drive</code>
           </li><li>
               Review account lockout policy.  Unlock network accounts, Restart the server and
               clients.  Determine the authenticating server [e.g., 'set l' returns LOGONSERVER]
               [www.errorforum.com, Mar 2007]
         </li></ul>
       </rf:item>
       <rf:item id="rlls-virus"  title="Error: Slow system due to Relevant Knowledge (rlls.dll) and
           WinAntiVirusPro (VirtuMundo, geeby.dll)" date="August 2007" author="bbarber">
           <p>A computer system was slow due to Relevant Knowledge (rlls.dll) and WinAntiVirusPro.
               Both programs automatically reinstalled.  The following procedure worked in this
               case.</p>
               <ul><li>
                   Check processes -- Use Task Manager (ctrl-alt-esc) to check for geeby.dll and
                   rlls.dll.  These dll's are run by WinAntiVirusPro and Relevant Knowledge.
               </li><li>
                   Take a snapshot -- Take a system snapshot with <code>Control
                   Panels->System->System Restore</code> or <code>Start->run->msconfig->System Restore</code>.  
                   A restore later will also restore the
                   viruses, but it may keep the system from being totally hosed.
               </li><li>
                    AVG Anit-virus -- Installed   <a href="http://free.grisoft.com">AVG Anti-Virus
                        Free Edition</a>.  A deep scan found and fixed numerous problems.                 
               </li><li>
                   SpyCatcher -- Installed <a href="http://www.tenebril.com">SpyCatcher Express</a>.
                   A deep scan found and fixed numerous problems.  [2009] SpyCatcher does not work well with AVG.
               </li><li>
                  VirtumundoBeGone
                   -- McAfee provided a program which quickly removes VirtuMondo (it is no longer 
                   on their newsgroups)..
               </li><li>
                   <a href="http://www.cexx.org/lspfix.htm">LSP Fix</a> -- Removing rlls.dll may also undo the Layered Service Provider stack. 
                   This utility will fix it, restoring connectivity to the net.
               </li><li>
                   Reboot and check processes -- Verify that geeby.dll and rlls.dll are gone.
               </li><li>
                   Reset System Restore  -- You need to clear out old restores, otherwise restoring
                   the snapshot will reinfect the computer.    Turn off <code>Control
                   Panels->System->System Restore</code> or <code>Start->run->msconfig->System Restore</code>.  
                   Reboot the machine.  Turn on System
                   Restore, and take a snapshot.
               </li></ul>
       </rf:item>
       <rf:item id="full-log"  title="Error: The security log on this system is full" date="Jan 2006" author="bbarber">
           <p>By default, the security log for Windows XP and Windows Server 2003 automatically
               deletes log entries more than 7 days old.  If many security events occur, they may
               fill up the log in fewer than 7 days</p>
           <ul><li>
               Log in as an Adminstrator
           </li><li>
               Control Panels->Administrative Tools->Event Viewers -- Load the Event Viewers dialog
               box.  An alternative path is <code>My Computer->Manage->Event Viewers</code>
           </li><li>
               View the Security events.  Look for events that occur frequently.             
           </li><li>
               Fix the problem that is causing multiple events
           </li><li>
               Is the event OK?  -- If the problem is expected to occur (e.g., lsass.exe listening to
               incoming traffic), disable the
               event.  Disable an event by right-clicking <code>system->properties->filter</code>
               and entering the event ID (e.g., "861" for lasass.exe).
           </li><li>
           </li><li>
           </li><li>
           </li><li>
               
           </li></ul>
       </rf:item>
       <rf:item id="detect-spyware" title="Detecting spyware" date="August 2004" author="PMrowczynski">
           To quickly diagnose spyware/adware type situations...
          <ul><li>
              System Information -- Start -> Run -> Winmsd -> OK
          </li><li>
              Components -> Network -> Protocol
          </li><li>
              The top two should be 
              MSAFD Tcpip [TCP/IP] and MSAFD Tcpip [UDP/IP]
          </li><li>
          </li><li>
          </li><li>
          </li><li>
          </li><li>
          </li><li>
              
          </li></ul> 
       </rf:item>
   </rf:section>
   <rf:section id="Files" title="Files and Directories" order="sorted">
      
      <rf:item id="file-security" title="Security problems with files" date="Jan 2006"
         author="bbarber">
         <p>To debug security problems</p>
         <ul><li>
            Identify the full User ID.  For example IIS uses IUSER_host to execute.  Execute
            <code>set</code> in either cmd or cygwin.    In cmd, look at USERNAME and USERDOMAIN.  In Cygwin, look
            at EUID, UID, and HOME. 
         </li><li>
            Use AccessEnum in <rf:iref item="setup-sysinternals"/> to list the security permissions
            for a directory and its sub-directories.    Use Tokenmon for detailed monitoring.
         </li><li>
            Use Explorer to create new directories instead of Cygwin's <code>mkdir</code>.   Cygwin
            does not use the same security model as Explorer, particularly for inherited
            permissions.   The same problem happens with files.
         </li><li>
         </li></ul>
         
      </rf:item>
      <rf:item id="FileSystemWatcher" title="FileSystemWatcher" date="Sept 2005" author="bbarber">
         <p><b>System.IO.FileSystemWatcher</b> reports events when a file or directory gets changed.   For an example, see XMLHotDocument <rf:iref item="espoD_2003" page="236"/></p>
         
      </rf:item>
   </rf:section>
    <rf:section id="net-ref" title=".NET References" order="sorted">
      <rf:item id="richJ_2002" title="[richJ_2002] Applied Microsoft .NET Framework Programming" date="Sept 2005" author="bbarber">
         <p>Richter, Microsoft Press, 2002</p>
         <p>Best book on the loading process of managed executables.  <rf:iref item="espoD_2003" page="560"/></p>
      </rf:item>
      <rf:item id="espoD_2002" title="[espoD_2002] Building web solutions with ASP.NET and ADO.NET" date="Sept 2005" author="bbarber">
         <p>Esposito, Microsoft Press, 2002</p>
      </rf:item>
        <rf:item id="sestP_2004" title="[sestP_2004] C# Precisely" date="Oct 2007" author="bbarber">
            <p>Sestoft and Hansen, MIT Press, 2004</p>
            <p>Thorough, concise coverage of C# 2.0, including generics, excluding .NET Framework
                classes.  Every other page contains examples.</p>
      </rf:item>
   </rf:section>
   <rf:section id="win-ref" title="Windows References" order="sorted">
      <rf:item id="hassJ_2004" title="[hassJ_2004] Hardening Windows" date="Sept 2005" author="bbarber">
        <p>Hassel, Apress, 2004</p>
        <p>Lots of concrete suggestions on improving windows security.  For example, using pwdump to identify weak passwords.hfnetchk for scanning a network for patch updates, 
        managing security policies, Microsoft's Baseline Security Analyzer, managing group policies, managing patch updates, NAQC (Network Access Quarantine Control), 
        IIS security, Exchange security,  security auditing.</p>
     </rf:item>  
    <rf:item id="russME_2005" title="[russME_2005] Microsoft Windows Internals" date="Sept 2005" author="bbarber">
         <p>Russinovich, Solomon, Microsoft Press, 2005, ISBN 0-7356-1917-4</p>
         <p>Thorough coverage of Windows internals with data structures and utilities.  See their
            website <a href="http://www.sysinternals.com">www.sysinternals.com</a> and <rf:iref
               item="setup-sysinternals"/></p>
      </rf:item>
       <rf:item id="stanWR_2003" title="[stanWR_2004] Microsoft Windows Server 2003" date="Sept 2005" author="bbarber">
           <p>Stanek, Microsoft, 2004</p>
           <p>Stanek's administrator's pocket consultant for Windows Server 2003.   Thorough coverage of adminstrator control panels, security, remote access, active directory, 
               user and group administration, file systems, shared folders, network drives, backup and recovery, networking, print services, DHCP, and DNS.</p>
       </rf:item>
   </rf:section>
    <rf:section id="dev-ref" title="Developer and Tester References" order="sorted">
        <rf:item id="gennJ_2004" title="[gennJ_2004] SQL Pocket Guide" date="Jan 2006"
            author="bbarber">
            <p>Gennick, O'Reilly, 2004, ISBN 0-596-00512-1</p>
            <p>Everything you should know about SQL, but easily forget.  Concise, detailed advice for Oracle,
                DB2, SQL Server, and MySQL.</p>
        </rf:item>
        <rf:item id="hendK_2000" title="[hendK_2000] The guru's guide to Transact-SQL" date="Sept 2005" author="bbarber">
            <p>Henderson, Addison Wesley, 2000</p>
            <p>Recommended by Esposito <rf:iref item="espoD_2003" page="397"/></p>
        </rf:item>
        <rf:item id="kaneC_2002" title="[kaneC_2002] Lessons Learned in Software Testing" date="June 2006" author="bbarber">
            <p>Kaner, Bach, Pettichord, John Wiley, 2002, ISBN 0-417-08112-4</p>
            <p>Good advice about all aspects of testing. </p>
        </rf:item>
        <rf:item id="moliA_2005" title="SQL Cookbook" date="Dec  2006" author="bbarber">
            <p>Molinaro, O'Reilly 2005, ISBN 0-596-00976-3</p>
            <p>SQL advice by example.</p>
        </rf:item>
        <rf:item id="spetA_2002" title="Transact-SQL Cookbook" date="Mar 2006" author="bbarber">
            <p>Spetic, Gennick, O'Reilly 2002, ISBN 1-56592-756-7</p>
            <p>SQL advice from a set-oriented viewpoint.  They emphasize the use of pviot tables,
                inner selects, and  sets.  It includes detailed examples for computing cumulative
                aggregations,
                comparing regions, detecting runs, and identifying sequences</p>
        </rf:item>
    </rf:section>
</rf:topic>
