The superfluous is very necessaryVoltaire
1 | 2
6 - 7 [7]
Relates to Registry Hacks
This evening I found myself trawling through the registry on my Windows 98 OS to resolve a number of conflicts, and try and speed up my file system processes. I generally use the Directory Opus shell to drag and drop files onto applications, but I wanted to set up better context menus for file associations so I could right click and save that additional wrist movement.
Just as an idea, I decided to track down a few of the desktop icon ClsIDs to extend their group context menus, and reduce the amount of clutter on my Desktop and in my Start Menu and Quick Launch bar. Firstly I hunted down the ID for Microsoft Outlook, with the intention of placing an additional menu command to open Mail Washer and set this as the default. Since Mail Washer has a custom toolbar button to open Outlook, I could now just run the both from the same desktop icon, and remove supperflous additional shortcuts.
The leading values of ID for Outlook are 00020D75-0000 and to add the new option to the menu I simply added another Key with name OpenMailWasher to the Shell
key with Command to open Mail Washer, and set the default string value on the Shell key to OpenMailWasher. While I was about I changed the icon and text for
the icon. In RegEdit code this boils down to:
[HKEY_CLASSES_ROOTCLSID
{00020D75-0000-0000-C000-000000000046}]
"InfoTip"="Outlook mailbox for business mail and account testing"
@="Business Organisers"
[HKEY_CLASSES_ROOTCLSID
{00020D75-0000-0000-C000-000000000046}DefaultIcon]
@="C:\PROGRA~1\OUTLOO~1\MSIMN.EXE,1"
[HKEY_CLASSES_ROOTCLSID
{00020D75-0000-0000-C000-000000000046}Shell]
@="OpenMailWasher"
[HKEY_CLASSES_ROOTCLSID
{00020D75-0000-0000-C000-000000000046}ShellOpen]
@="View &Mail Boxes"
[HKEY_CLASSES_ROOTCLSID
{00020D75-0000-0000-C000-000000000046}ShellOpenCommand]
@=""C:\PROGRA~1\MICROS~1\OFFICE\OUTLOOK.EXE""
[HKEY_CLASSES_ROOTCLSID
{00020D75-0000-0000-C000-000000000046}ShellOpenMailWasher]
@="Run Mail &Washer"
[HKEY_CLASSES_ROOTCLSID
{00020D75-0000-0000-C000-000000000046}
ShellOpenMailWasherCommand]
@=""C:\Program Files\MailWasher\MailWasher.exe""
[HKEY_CLASSES_ROOTCLSID
{00020D75-0000-0000-C000-000000000046}
ShellOpenProjectList]
@="View &Project List"
[HKEY_CLASSES_ROOTCLSID
{00020D75-0000-0000-C000-000000000046}
ShellOpenProjectListCommand]
@=""C:\Program Files\MozillaFirebird\MozillaFirebird.exe"
-p tomwright "http://localhost/projects/index.php""
I also added an additional option to open up my PHP Projects Manager API in Firebird. Just recording some of the other CLSIDs of common desktop items (for my own reference - remember adjusting the registry can have grave consequences if you are not sure what you are doing!).
{00020D75-0000-0000-C000-000000000046}{20D04FE0-3AEA-1069-A2D8-08002B30309D}{645FF040-5081-101B-9F08-00AA002F954E}{871C5380-42A0-1069-A2EA-08002B30309D}{450D8FBA-AD25-11D0-98A8-0800361B1103}{208D2C60-3AEA-1069-A2D7-08002B30309D}Not forgetting that the last of these incongrous items can be removed from
the desktop by setting a DWORD value of 1 for NoNetHood
in HKEY_CURRENT_USERSoftwareMicrosoftWindowsPoliciesExplorer. While Win98 is
slowly falling off the market shelf, it still offers some fun!?
Posted on Nov 08, 2003 at 03:21:17. [Comments for Cleaning The Desktop- 0]
Relates to Web Standards and Java
Recently been testing the main XML parsing methods in Java a bit, giving me the chance to play around in Eclipse and broaden my Java and XML knowledge. Previously I have only really used the DOM parser in the Apache Xerces package, since this equates well to similar Javascript DOM coding for HTML documents.
While the DOM is an excellent choice for document manipulation, the event driven nature of SAX makes it an excellent choice for extracting particular information from a document.
This very simple code snippet shows the contents of a Class extending org.xml.sax.helpers.DefaultHandler to display the
level of nesting in an XML (or HTML) document, by utilising the Stack data structure.
private java.util.Stack stack = new java.util.Stack();
[.. snip ..]
public void startElement(
String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException {
if (stack.size() > 0)
{
short temp = (short)stack.size();
while (temp– > 0)
{
System.out.print("t");
}
}
System.out.println(localName);
stack.add(localName);
}
public void endElement(
String namespaceURI,
String localName,
String qName)
throws SAXException {
stack.pop();
}
JDOM also offers some interesting classes for XML
parsing with a more Java-centric approach. In particular the contributed
ResultSetBuilder Class in the org.jdom.contrib.input package offers a very concise API for
converting SQL data into an XML document.:
s = conn.createStatement();
rs = s.executeQuery(query);
ResultSetBuilder builder =
new ResultSetBuilder(rs,
"library", "book",
Namespace.getNamespace(namespace));
builder.setAsAttribute("isbn");
builder.setAsAttribute("format");
Document doc = builder.build();
XMLOutputter outp =
new XMLOutputter(" ", true);
outp.setTrimAllWhite(true);
outp.output(doc,
new FileOutputStream(fileID));
Posted on Nov 08, 2003 at 03:19:49. [Comments for XML Parsing Snippets- 0]