When I need a new tool, I often code it in Python. Often, command line options are useful. Sometimes it is possible to have a fixed set of parameters, but this is not very flexible. Fortunately, Python has standard libraries to handle parsing command lines. There are three libraries providing varying capabilities. Some of the systems I run on have older versions like Jython 2.1 or Python 2.6. This limits which libraries I can use without backporting libraries
This document provides examples for four command line processing options. The examples are for a program that processes files and has an optional argument to report the execution time. Continue reading
There are many tools available that will allow a programmer to create log entries. I originally worked with log4j, but have recently been working with logback. I am also working with Jython and am looking at Python’s logging framework. Used well they can make log analysis simple and provide a rich tool for resolving issues. Used poorly they can generate a mass of relatively useless information.
While these loggers have a good hierarchy of levels, the documentation tends to be lacking in guidance on when to use which level. The following document contains the recommendations I have gathered over the years. Continue reading
I recently discovered logs filling up with log messages for classes being unloaded during garbage collection. After a little research, I found that the
TraceClassUnloading switch gets turned on by the
Xloggc switch. After a little testing I found, that this can be resolved by adding the argument
-XX:-TraceClassUnloading after the
-Xloggc argument. Continue reading
It is common for developers to worry about optimization while doing initial programming. Some write extremely complex code in the belief that it is optimized. Unfortunately, this code is often slower than it might otherwise be. Additionally, the compiler may be unable to optimize the code. I find optimization is rarely necessary and effective optimizations are difficult to predict.
This post present the my optimization rules. Future posts will present the techniques I use to avoid optimization, and perform optimization when needed. Continue reading