29 September 2005

Software: Winzip In-place Editing Annoyance

Winzip allows a user to edit a file in an archive, edit that file, then save that file back into the archive after the user has closed his or her application. However, if you try to edit a file that is in a folder in an archive, Winzip does not place that file back in that folder. What is annoying is that you only find out about this limitation after you edited the file and tried to save it. Even more annoying is that there are now two copies of your file in the archive! Gritted teeth!

28 September 2005

Software: WinCVS Locate File Feature

When using WinCVS, sometimes I want to copy the path of a file so that I can tell a developer which file to change by e-mail. By accident, I found that WinCVS would print the location of a file in the Output pane if I drag and drop a file in the File Pane. In the illustration, the top right hand pane is the File Pane and the Output Pane is the bottom pane.

22 September 2005

Software: Simple Javascript Regular Expression Search and Replace

Here's a simple regular expression search and replace in Javascript (for JScript, replace alert with WScript.Echo). I wrote it as a test for another script to modify a configuration file.

var s1 = "Hello World"
var s2 = s1.replace(/Hello/, "Goodbye")
alert(s1 + "," + s2)
var s3 = s1.replace(/(Hello)/, "$1 Googly")
alert(s1 + "," + s3)

If you run this script in a Web page, you should see the first alert dialog containing "Hello World,Goodbye World" and a second alert dialog containing "Hello World,Hello Googly World".

In this example, the parentheses (()) enclose a match pattern and the dollar ($) symbol represents the matched string (i.e. $1 is the first matched string, $2 is the second matched string, etc.).

19 September 2005

Software: Oracle ORA-12638 Credential retrieval failed

Sometimes the Oracle server throws an ORA-12638 error after I drop tables from a database with active connections and subsequently try to run SqlPlus on the server computer. My previous solution was to reboot the Windows server computer. Hey, when in Windows, do what the locals do.

A better solution can be found here. Since Oracle administration is not my game, I'll just accept that Martti's solution works and not ask any more questions.

16 September 2005

Misc: High Petrol Prices Starting to Bite?

This week, it's taking me about 10% less time to drive to work. Are higher petrol prices starting to bite and forcing commuters to use alternatives? Are some schools starting their term break a week early?

15 September 2005

Nethack Death - Cleaved by Tsurugi Muramasa

It was going pretty darn well; I was a samurai with AC -26, strength 18/26, dexterity 18, blessed +2 Greyswandir, invisible, can see invisible, ring of slow digestion, amulet of reflection and a whole raft of intrinsics. I had finished the mines and Sokoban levels and cocky enough to take on my nemesis. There was no problem dealing with the ninjas and ronins in the donjon. Finally, I met Ashikaga Takauji. We fought for five rounds then his Tasurugi of Muramasa cleaved me in two. WAAAAAH!

After that traumatic event, I realised that I should have wielded my blessed +5 Snickersnee instead, since samurai can be expert in long sword but not saber.

Software: Winzip Letter Case Annoyance

I wanted to extract a specific file out of a WAR file, so I fired up Winzip, got file path in the archive (web-inf\web.xml), then tried to extract it with jar xf file.war web-inf/web.xml.

No go; jar could not find that file. After ten minutes of head-scratching, I got a list of files from the archive with jar tf file.war and saw that the path was really WEB-INF/web.xml!

Why extract that file using jar? I'm hacking a script to customize the hostname in the web.xml file for the daily build and installation of our WAR file.

12 September 2005

Misc: Tidied Hobby Web site

I spring cleaned my hobby Web site over the weekend; I ditched the idea of writing the source in DocBook and using XSL to produce the final HTML pages. The whole process was too cumbersome for the eight or so pages I had on my site and a pain to test. Instead, I just edit the XHTML directly using gvim, preview and validate the pages on Firefox then upload them.

07 September 2005

Software: VNC Viewer Handy Shortcuts

Handy keyboard shortcuts for Java VNCViewer:
  • F8 to show the menu.
  • Shift-Ctrl-Alt-Del to send Ctrl-Alt-Del signal to remote Windows desktop.

02 September 2005

JScript To Launch Applications

Here's a quickie JScript program to launch a set of applications in Windows. I wrote it because I didn't want to always start these applications when I logged in to my workstation (which is what happens to programs in the Windows Startup folder). Save the text in a *.js file in your desktop, edit the list of applications, then click on the icon to run it.

var apps = new Array()
apps[0] = '"C:\\Program Files\\Bozinis\\2xExplorer\\2xExplorer.exe"'
apps[1] = '"C:\\Program Files\\Mozilla Firefox\\firefox.exe"'
apps[2] = '"C:\\Program Files\\Microsoft Office\\Office\\EXCEL.EXE"'
apps[3] = '"C:\\Program Files\\Microsoft Office\\Office\\OUTLOOK.EXE"'

function runApps() {
  var wshell = WScript.CreateObject("WScript.shell")
  for (var i = 0; i < apps.length; ++i) {
    var appPath = apps[i]
    wshell.Run(appPath, 1, false) // Don't wait for command to finish
  wshell = null


JScript and Windows notes

If your application file paths have white spaces, you need to delimit them by double quotes so that the Windows shell can find them. The outer-most single quotes tell JScript the start and end of a string. Backslashes in Windows paths need to be escaped by another backslash.

Software: Skype quirks and gotchas

Some Skype quirks and gotchas.
  • There is no way to view the history of a group chat in Skype (my version The chat history files are stored in C:\Documents and Settings\username\Application Data\Skype\username but they are encoded in some proprietary format.
  • If you call someone and then close the call window before they answer, the call attempt continues. If the recepient answers the call, the caller does not see a call window but the line is established, so the receipient can eavesdrop.

01 September 2005

Software: Dumbed Down Tutorial - Weblogic Workshop

Weblogic Workshop has one of the most dumbed down tutorial instructions I've had the misfortune to read recently. If you follow the Windows steps, you end up with a Quickstart window and a Workshop window, when all that was required is for the developer to enter the path to the executable in a console. The Quickstart window is not used in the rest of the tutorial and consumes 25 Mbytes of RAM. Does BEA (the publisher of Weblogic) really believe that developers are sooo stupid that they can't launch an application from a command console? 2007-06-12: Removed URL to BEA workshop tutorial. Link is gone?