Category Archives: Tips

XSLT Example: Add a new node to elements

How to add a new element to every child element of a certain parent? For example, consider you want to add <type> element to the element under <library>. The <type> element should have the name of the element as the … Continue reading

Posted in Tips | Tagged | 2 Comments

Debug Windows Service through Remote Desktop

Debugging Windows NT Service is headache. Doing so through remote desktop is even more difficult. But the remote debugging makes the story easier. Let’s review the background. Debugging a service is challenging because the service process starts before you log-in … Continue reading

Posted in Advanced Debugging, Tips | Leave a comment

How many tests shall we run?

As many as possible, of course. However, as I discussed in the previous post, we don’t have to run all the test to estimate the overall success rate. It’s useful especially for release scheduling. You can get the automation test … Continue reading

Posted in Algorithm, Tips | Tagged , , , | Leave a comment

Statistics of partial test cases run

In software development, the number of test cases is increased dramatically especially when you generate the test cases automatically. It becomes a problem when the execution time of the test suites is the bottle neck of the development. For example, assume … Continue reading

Posted in Algorithm, Tips | Tagged , , | 1 Comment

XPath evaluator in MSXML

MSXML comes with full XPath support. When XPath is used to select a node (or node list), you can just use IXMLDOMNode::selectSingleNode method. It’s quite easy. However, when XPath doesn’t return node(s), IXMLDOMNode::selectSingleNode doesn’t work because it must return the … Continue reading

Posted in Tips | Leave a comment

Boost Spirit V2: Parse C/C++ enum syntax with auto value generation

In C/C++, the following syntax automatically assign 0 to apple and 1 to orange. How to do this in Spirit? enum foo { apple, orange, }; You can use local variable and argument to make an incrementing counter. To parse … Continue reading

Posted in Tips | Leave a comment

Boost Spirit V2: identifier separated by a space

The following boost spirit grammar tries to parse the text like “int foo;”. template <typename Iterator> struct test_grammar : boost::spirit::qi::grammar<Iterator, boost::spirit::qi::space_type> { test_grammar() : test_grammar::base_type(start){ using boost::spirit::qi::alpha; using boost::spirit::qi::lexeme; identifier = +alpha; start = identifier >> identifier >> ‘;’; } … Continue reading

Posted in Tips | Leave a comment