I recently upgraded out Hudson instance after not touching it for quite a while. This quickly broke the set up we have in which Hudson stops and starts our Tomcat servers after a successful build to deploy the new code. The problem seems a change in the Hudson code that kills any background processes that a Hudson job leaves around. There's documentation about this issue at:
We use the following shell script to stop and start Tomcat servers. The key part of the script is the setting of the environmental variable BUILD_ID=dontKillMe which overrides the default environmental variable setting Hudson gave the variable and thus prevents it from killing the background processes.
#!/bin/bash #.Name # startTomcat.sh #.What # Starts a tomcat container. This script handles some nuances of Hudson # in which it kills background processes that you want to have stay alive # after a build job (e.g. Restart Tomcat) finishes. # #.See # http://issues.hudson-ci.org/browse/HUDSON-2729 # http://hudson.gotdns.com/wiki/display/HUDSON/Spawning+processes+from+build
exec 2>&1;
BUILD_ID=dontKillMe; export BUILD_ID;
if [ $# -ne 1 ] then echo "Usage: $0 full_path_to_tomcat_directory" exit 1 fi
if [ ! -d ${1} ] then echo "Not a directory: ${1}" exit 2 fi
echo $0 starting $(date) set -x
pwd
cd $1
if [ $? -ne 0 ] then echo "Directory not found or has wrong permissions: $1" exit 3 fi
In the SQL Editor in Oracle's excellent SQL Developer tool, if you are running queries using an Oracle Text Index, you will run into issues when using the CONTAINS operator and searching for terms such as ${MySearchTerm}. The dollar-bracket syntax is used to do stemmng, but the SQL editor interprets them as bind variables and prompts you for their value. To turn off the bind variable interpretation you can precede the SQL statement with the following command:
set define off;
You only need to do this once and it will remain in effect for the rest of your usage of that SQL worksheet.
I just ran across http://x-bc.sourceforge.net/index.html. If you've ever used the Unix bc calculator utility, this project provides two excellent extensions to the built in capabilities of the calculator. In particular:
I've been looking at some performance issues with our Tomcat servers (we have many) and have seen some real inconsistency in the DBCP options that are specified. In general the basic ones you'd expect to see are there: a validation query, minIdle, maxActive. However, other ones are missing. This page http://commons.apache.org/dbcp/configuration.html lists the options and gives a good explanation of each. Everyone using Tomcat and DBCP should review this list and understand them.
A couple of interesting options to point out are those dealing with the validity of idle connections in the pool:
testWhileIdle (default false)
The indication of whether objects will be validated by the idle object evictor (if any). If an object fails to validate, it will be dropped from the pool. NOTE - for a true value to have any effect, the validationQuery parameter must be set to a non-null string.
timeBetweenEvictionRunsMillis (default -1)
The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run.
numTestsPerEvictionRun (default 3)
The number of objects to examine during each run of the idle object evictor thread (if any).
I recently imported a CSV file I was given into Excel. The file had two columns (with many rows of data) that contained URLs in the format http://foo.com/bar?phuid=1023, etc. I wanted to make these links clickable. Excel provides a straight forward, but manual way to do this. I asked around for an automated way to do this and was quickly given this macro:
Sub URL_List() For Each cell In Selection If cell.Value <> "" Then If Left(cell.Value, 7) = "http://" Then URL = cell.Value Else URL = "http://" + cell.Value End If ActiveSheet.Hyperlinks.Add Anchor:=cell, _ Address:=URL, TextToDisplay:=cell.Value End If Next cell End Sub
I don't know the source of this macro it proved useful today. I hope you can make some use of it.
The directions on creating a macro in Excel can be found in Excel's help which I'll repeat here:
Create a macro using Microsoft Visual Basic
On the Tools menu in Microsoft Excel, point to Macro, and then click Visual Basic Editor.
On the Insert menu, click Module.
Type or copy your code into the code window of the module.
If you want to run the macro (macro: An action or a set of actions that you can use to automate tasks. Macros are recorded in the Visual Basic for Applications programming language.) from the module window, press F5.
When you're finished writing your macro, click Close and Return to Microsoft Excel on the File menu.