The first thing a programmer learns about exceptions is how to ignore them. Then a programmer learns that it is always best to throw them up the stack to the caller. And if you are the caller you can always print the stack trace to get a glimpse of what line of code [...]
Posted in Java, TechKnow |
Here is some Visual Basic script code which allows you to terminate a process given a process id number.
‘ Kills a program given its process id.
Function ProgKill(strProcessId)
‘ Declare used variables
Dim strWQL
Dim objProcess
Dim objResult
Dim intReturnCode
Dim wmi
[...]
I remember who excited I was when I found out that I could save a word document to HTML. Now after two years using Word 2003, I learn that Word 2003 can save a Word document as XML via Microsoft’s WordprocesingML. What this implies, but I haven’t test, is that if you can [...]
In an XML file you can use CDATA to tell the parser that anything inside the CDATA element is your text data and not XML formatting. In a sense, you can use CDATA to escape data that looks like XML. See Escape From XML. For example, you can escape the ampersand like this:
&
or [...]
Continuing with the Eclipse Tool Tip Series try this out. Inside a method type ‘ins’ and then hit the ctrl+space keys. You should see the instanceof template in the code assist popup box. Select it and you get the following bit of code generated for you:
if (name instanceof type) {
[...]
Posted in IDE, Java, TechKnow |
In a previous post, see Using Dom4J: Reading An XML, I went over how to read in an XML document using Dom4J. Here I’ll show how to write an XML document using Dom4J. The first part to writing out an XML document is to have an in memory representation of it. Here [...]