Nuts and bolts about programming applications, databases and spreadsheets. Note: Comments are moderated to filter comment spam. Mobile version
2005-09-29
Software: Winzip In-place Editing Annoyance
2005-09-28
Software: WinCVS Locate File Feature
2005-09-22
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.).
2005-09-19
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.
2005-09-16
Misc: High Petrol Prices Starting to Bite?
2005-09-15
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.
2005-09-12
Misc: Tidied Hobby Web site
2005-09-07
Software: VNC Viewer Handy Shortcuts
- F8 to show the menu.
- Shift-Ctrl-Alt-Del to send Ctrl-Alt-Del signal to remote Windows desktop.
2005-09-02
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 } runApps()
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
- There is no way to view the history of a group chat in Skype (my version 1.1.0.79). 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.