Tools
Subversion Undeleting
by Frank Kim on Sep.22, 2010, under Subversion
I am always forgetting how to undelete. I wish subversion made it easier but the only way to do it is to do an svn copy of the last version. For example:
svn cp url/to/removed/foo.txt@4 .
You can find the URL by looking in .svn/entries.
For more info please see What’s a simple way to undelete a file in subversion?
Debugging WebSphere Applications with IBM Rational Application Developer
by Frank Kim on Apr.26, 2010, under Eclipse
IBM Rational Application Developer (RAD) is basically a typically IBM heavy version of Eclipse. WebSphere is a typically IBM heavy version of a J2EE server. Therefore you would think you could debug web applications using RAD fairly easily like you can on JBoss or ATG DAS using Eclipse.
However I could not find anyone on my latest project who knew how to do this. Fortunately after much Googling I found this PDF document, Debugging Applications in IBM Rational Application Developer, and on page 12 are instructions on how to do this.
The instructions seem to be a little out of date so here are my instructions.
- Log into your Integrated Solutions Console. The default URL is http://localhost:9060/ibm/console/login.do.
- Navigate using the left side column to Servers –> Application Servers.
- Select the Application server you want to debug from the list of Application servers.
- Under the Configuration tab select the Debugging Service link which is near the bottom right in the Additional Properties section.
- Select the “Enable service at server startup” checkbox. Note the JVM debug port.
- Press the Apply button.
- In the Messages box, which appeared at the top after pressing the Apply button, click on the Save link.
- Stop and start your Application Server. It should now be running in Debug mode.
- In RAD go to the project for the web application you want to debug.
- From the menu select Run –> Debug Configurations.
- Select Remote Java Application and press the New button (it’s the top left button). For the port set it to the JVM debug port (default is 7777).
- Press Apply. Then press Debug. It should connect to WebSphere’s JVM.
Now you can set breakpoints and even change small amounts of code which will be deployed automatically to WebSphere. No more waiting 15 minutes to test every change you make because builds are so brutally long.
Ignore Files and Directories in Subversion
by Frank Kim on Mar.01, 2010, under Subversion
In the course of a project there are always files and directories that you don’t want to check in but which Subversion complains it doesn’t know anything about them. So it makes sense to tell Subversion to ignore them, in other words, keep quiet.
The mechanism for doing this works okay but I wouldn’t say it’s perfect.
This is how I do it.
- Go to the directory where want to ignore a file or subdirectory.
- Issue the command
svn propedit svn:ignore .
- Your editor then will be launched and you can enter one line at a time those files and/or subdirectories you want to ignore.
some_file some_directory
- Commit your changes.
svn commit -–depth empty
Two things to notice.
-
--depth empty argument
only commit the propedit changes
- Committing your changes means everyone will end up ignoring these files and/or directories so make sure you are ignoring the right ones.
-
- If you don’t want to commit your changes you can revert them.
svn revert .
For further reading please see Pete Freitag’s blog post Ignore Files and Directories in Subversion.
Duplicating and Modifying Eclipse User Libraries
by Frank Kim on Aug.19, 2009, under Eclipse
Eclipse user libraries are wonderfully convenient ways of packaging together related JAR files. In my Eclipse I create user libraries for each ATG version I install. As a consultant I am always installing different versions and today I installed ATG 9.0.
Normally I use the GUI to create the user library for the latest ATG server. However I thought this is quite inefficient because I already have user libraries for previous versions of the ATG server. I just need to duplicate one of the other ATG user libraries and then tweak the duplicate to have the right path to the JAR files.
Unfortunately the Eclipse GUI does not provide a way to duplicate a library. So I searched in my workspace files and found in my .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs file the settings for all my user libraries.
I then edited that file and copied an entry for an older ATG library, org.eclipse.jdt.core.userLibrary.ATG\ 2007.1. I renamed it org.eclipse.jdt.core.userLibrary.ATG\ 9.0 and updated the paths to where ATG 9.0 is installed and I was done!
Perforce Review
by Frank Kim on Dec.30, 2008, under Perforce
You can have Perforce alert you about changes to sections of the depot.
To do this using the Perforce GUI.
- Go to User -> Edit <your name>…
- Add the branches in the Reviews section that you want to monitor. For example:
//depot/main/.../pom.xml //depot/main/com/betweengo/foo/... //depot/proj/.../bar/...
Thanks to fellow developer Bill Crook for the tip.
Update: Michael Delaney, Perforce guru, pointed out that this works only if a P4Review daemon is running which it is not by default.
Deconstructing software to find bugs
by Frank Kim on Oct.27, 2008, under Tools
In the September/October 2008 Technology Review I read a short article on Seth Hallem, one of the TR35. The subtitle of this article was “Deconstructing software to find bugs.”
As a graduate student at Stanford, Seth Hallem perfected an improved approach to finding bugs, called static analysis… Hallem developed algoritems to … examine only the most important combinations, allowing millions of lines of code to be examined quickly and efficiently. He cofounded Coverity in San Francisco.
Perforce Adding a Directory Tree
by Frank Kim on Oct.08, 2008, under Perforce
This article, Adding a Directory Tree, shows how to add a directory tree to your perforce repository.
- On UNIX, run:
find . -type f -print | p4 -x - addThe above
findcommand will find files, but will not find symlinks. Nevertheless, you can add symlinks to Perforce using a similar method. Be aware, however, that symlinks are read-only entites, and that editing a symlink is not the same as editing the file it references.To discover the symlinks that exist in your client workspace and assess whether or not you want to version them, run the following command from your client workspace root:
find . -type l -print (That's an "el" as in "l" for link)To add symlinks, run:
find . -type l -print | p4 -x - add -t symlink- On Windows, using the MS-DOS command shell, run:
dir /b /s /a-d | p4 -x - add
Perforce Branching
by Frank Kim on Sep.18, 2008, under Perforce
Perforce branching is pretty simple.
Say you want to create a branch called
//depot/fkim/foo
First you would add it to your client.
//depot/fkim/foo/... //fkim/foo/...
Next you would do an integration from where you wanted to cut the branch.
p4 integrate //depot/work/foo/... //depot/fkim/foo/...
Then you would submit the integration and the branch will be created and updated in your client work space.
p4 submit
Spaces, not Tabs
by Frank Kim on Aug.01, 2008, under Eclipse
The holy war about spaces or tabs continues and you can see all sorts of arguments for each side raging around the internet.
I prefer spaces because it’s a consistent format that remains the same no matter what you are using. With tabs things appear differently depending on how your editor or other program is configured. Plus the worst thing is when spaces and tabs get intermixed.
Arguments for tabs such as they take up less room or it’s easier to move around are in my mind weak. In this day of terabyte disk drive, file size differences between tabs and spaces are trivial and most of your disk space is taken up by images and binary files anyway. And being able to move around and format quickly is not an issue either with modern editors.
The two editors I use most are XEmacs and Eclipse. Below I describe how to use spaces for indents for each program.
In Emacs:
(setq-default indent-tabs-mode nil) ; Use spaces for indents except
; in buffers that already have
; their own local values for the
; variable.
In Eclipse:

Eclipse Ganymede
by Frank Kim on Jul.18, 2008, under Eclipse
I was about to write a post about how much I was starting to dislike Eclipse. Two years ago I was singing the praises of Eclipse but Eclipse Europa (version 3.3) in my opinion has been a disaster. It is incredibly slow, crashes often, runs out of memory, etc. I found myself at times using XEmacs instead because it was faster.
But today I installed Eclipse Ganymede (version 3.4) and so far life has been much better. It is much more responsive, it is not crashing, things are running smoothly. You can read about what is New and Noteworthy in Ganymede. The most exciting new feature to me is the Retain case of match when replacing, just like XEmacs.
Also I noticed that in my JBoss project, hot swapping of code is again working. I am not sure if this is because I upgraded to Ganymede or because I turned on “Build Automatically”. I suspect it might be the latter.


