Wednesday, December 17, 2008

The Coming Salivation

Brought to you through AnswerBag, a site where goofy Q&A is just a click away...

Friday, October 10, 2008

John McCain Gets Personal... with a Libertarian?!

I'm SOOO excited!!!!1

I received a letter in the mail recently from John McCain! It had his name at the top and EVERYthing!!!

"Dear Friend,"
Why, hello, friend John McCain!

In the past you have served as a valued and trusted member of our Party."

Uhhh, wait a minute now...
I'm a Libertarian!
I've been one for over 15 years...!

"...the RNC's records indicate that you still remain on the sidelines and have yet to respond to appeals to stand with us in our fight to prevail over the Obama Democrats."
Well... duh! C'mon John boy, I've NEVER supported your party!

"I am asking you to please get involved NOW."
Uhhh... NO??

"I would not ask for your help
if the circumstances were not so dire."

Owning 7 houses and 13 cars... sure, that's dire...

"But the alarming truth is, if the Obama Democrats win the White House and retain control of Congress, they will have total control of the federal government."
ZOMG, srsly???!

The little faux-handwriting blurb reads...

"By using your own first class stamp to return this envelope,
you will be helping us save much needed funds. -- Thank you."


Sunday, October 5, 2008

Health Scare

So my significant other had a medical procedure recently and the hospital wanted payment for the part of their services our deductible didn't cover.

I sense my payment experience may be an interesting time, in the Chinese sense...

Thursday, October 2, 2008

Running an Ancient dBASE IV Database from Removable Media

I needed to run a particular DOS application from CD, USB, or other removable drive.

This particular application is a database of local community service agencies built in dBASE IV, allowing the user to search among service providers or do keyword searches of available services.

It's nice because the contact and services information for hundreds of agencies could fit neatly on a 3.5" diskette, but not so nice because it's a DOS-based app. The app for my purposes needed to be able to run from CD or USB flash drive, the goal being to be able allow the user
to easily assess and play around with its features, and have a functional replica to use in refactoring its functionality into a more up-to-date database and user interface platform. That, and the fact that the computer to use for testing has no 3.5" diskette drive installed.

In the interests of time, I decided to create a batch file to execute the app. One twist, however, is that the app must run from the C: drive, because it's hard-coded to reference the primary hard drive in a PC.

I decided to create a batch file which would perform the following steps:
  1. Create a new folder on the temporary file area of the C: drive.
  2. Copy all files from the removable media to the new folder.
  3. Execute the DOS app.
  4. Upon exit, delete the folder from the C: drive.
The app would be running from within a DOS command prompt under Windows XP. One quirk, as CPU clock speeds have increased over the years, dBASE IV has issues which prevent it from executing normally on its own. Specifically, dBASE attempts to perform some temporary file housekeeping based on the system clock, and on any system faster than oh, 133 MHz or so (at least in my testing), dBASE would fail to launch.

Thankfully the utility IDXFIX proved to be the magic bullet for this little problem, my thanks to Gary White, creator of this, wherever he may be. This utility just needs to be run prior to dBASE to set up shop for it and presumably intercept and handle requests dBASE makes when trying to interface with the clock.

Here's the batch file, an explanation follows.

md %temp%\myProg
xcopy *.* %temp%\
myProg /s /e /v /y
cd %temp%\
idxfix /I
dbase.exe %temp%\
idxfix /U
cd %temp%\
del %temp%\
myProg\ /s /q
rd %temp%\
myProg\ /s /q

Now on to the explanation.



  • Just tells the command prompt to not echo commands, and to clear the screen. In a way redundant, but this is habit from when I had to write batch files more frequently, and it does make testing a little cleaner.

md %temp%\myProg
  • This simply looks at the %temp% environment variable, which in Windows XP references the folder on the Windows install drive where temporary files are stored. By default this references a folder under C:\Documents and Settings\<userName>\Local Settings\Temp. I just changed this on the target system to a folder I created named C:\TEMP, for simplicity and to avoid any potential issues with long file names with this old DOS application.

xcopy *.* %temp%\myProg /s /e /v /y
  • This uses the command-line xcopy program to copy the entire file and folder structure from the removable media to the temporary file area on the C: drive. The parameters tell it to copy subdirectories, include empty subdirectories, verify the results, and automatically overwrite any existing files.

cd %temp%\myProg\dbase
  • Change directory to the dbase subfolder copied from the removable media. This is the folder where the dBASE executable, dbase.exe, lives.

idxfix /I
  • This loads the IDXFIX utility into memory as a TSR, short for Terminate and Stay Resident. The utility's execution doesn't stop any further actions in this particular instance of the command prompt, but still hangs out in memory to serve whatever purpose, in this case ensuring dBASE can execute properly.

dbase.exe %temp%\myProg\db\myDB.prg
  • This executes the dbase.exe executable and tells it to load the file myDB.prg, which represents the database application.

idxfix /U
  • When the batch file gets to this point, the user has quit dBASE. Thus, we unload the IDXFIX utility from memory.

cd %temp%\

  • Ensure we've changed to the temporary folder, so that our focus is NOT inside the folder or any subfolders of our copy of the database application. If this were the case, the next steps to remove the application files and folders from the target computer's hard drive would fail.

del %temp%\
myProg\ /s /q
  • Deletes files contained in the database application folder. The /s parameter ensures all files in all subfolders are deleted, while /q tells the delete operation to not ask for confirmation. We know what we're doing!

rd %temp%\
myProg\ /s /q
  • Removes the folder and all subfolders. Another option would've been to utilize the DELTREE executable, but DEL serves the purpose just fine as it's integrated into the XP command prompt, whereas DELTREE is a separate executable we'd need to store on the removable media.

In summary, this batch file has enabled us to run this ancient DOS-based database application comfortably from within a Windows XP command prompt. It sets up shop for itself on the C: drive, executes and enables the user to use the full functionality of the database, then wipes traces of itself from the hard drive upon exit.

This is a task which in a way seems rather pointless. However, these steps have enabled us to take an old DOS database application which previously could only run from a 3.5" diskette, and essentially make it portable so that it can now be run from any removable media.

If during some natural disaster or other crisis, someone needed this particular database to view on a laptop with no wifi handy, these steps would enable this accessibility.

Thursday, September 11, 2008

A Problem Sharing Files via Remote Desktop

While on vacation, I'd left a PDF on my home computer which I wanted to browse on my laptop on vacation. It's about 75 MB, not exactly feasible to email.

Both machines run Windows XP, however, and I figured I could use its ability to bring the resources of my laptop, including its hard drive, to the remote session on my desktop at home. I opened Remote Desktop, expanded Options, then clicked on Local Resources, and checked so that sharing all available drives was enabled.

No such luck, at first. Although I could see the laptop's CD-ROM drive present as \\TSCLIENT\D its hard drive, which should've been there as \\TSCLIENT\C was nowhere to be found! My laptop is a machine I normally use at work, and is part of their Active Directory and various group policies. I'm not privy to what the group policies specifically secure, but my guess was that some policy setting might be responsible for making my drive inaccessible via the remote session.

After some thought I remembered an old friend from the DOS days, the SUBST utility.

When diskettes were popular, some developers hard-coded their software specifically to look for the A: drive, with no option to select another. This was fine if you had a newer PC with a 3.5" drive as A:, but what if you'd upgraded some old clunker which had an older 5.25" drive as A:, and a newly installed 3.5" as B: instead? You'd be stuck having to crack open the case and swap around the drives... if not for SUBST.

I decided to try SUBST here to see if I could bring my laptop's hard drive to the remote session, masquerading as a different drive letter on \\TSCLIENT. Thus, I opened a command prompt and entered the following from my laptop:


This basically tells your computer to use a given substitute drive letter Z: to represent drive C: which is somewhat similar to using symbolic links in the *nix world. I opened My Computer, and now I could see a Z: drive, and clicking it brings up an Explorer window with the exact contents of my C: drive.

Now, I open Remote Desktop, and open a session to my home computer. Lo and behold, drive Z: appears in the remote session as well! I could then Paste my PDF file from my home machine to my laptop and browse it happily. Of course, this copy process takes a LOT longer than it might over a normal, unencrypted connection, but it gets the job done, and sometimes that's all that matters.

Thursday, July 10, 2008

Filthiest Coffee Mug... EVER.

I'm taking a break from my irregular, unscheduled programming to share something horrendous.

An avid coffee drinker, I'll often have mugs pile up in my sink at home. If I haven't had a chance to let them soak in water, they'll have a greasy brown scum that clings hopefully to the glazed porcelain. That's just after one use, and if I don't happen to finish off the cup, there'll be a slurry of sugary, creamy coffee which eventually congeals into a mass of goo, or if there's too little it'll dry and form a rather crispy, clingy crust.

Now, at the office, I happened upon this specimen of mug. Not in the sink, mind you, but a mug someone was getting ready to use, here and now.

Boston, huh? Yeah, this looks like Boston Harbor on a sunny day, complete with some raw sewage and crusty fish poo. Let's take a closer look, shall we?

I don't think I could reproduce this level of filth on my worst day. I'm guessing the owner is hoping that the hot coffee will kill off whatever layer of encrusted, living filth inhabits their mug.

Quite frankly, this looks more like something you'd expect to see in Iraq or Vietnam; I vaguely remember a scene from Jarhead or Apocalypse Now, perhaps, where 50 gallon barrels used in the latrines have some kerosene poured in them and are then ignited, producing horrible smoke and leaving a baked-on brackish crust in its wake.

In closing, I animatedly express my feelings on this...

Monday, May 19, 2008

Choose "Don't Spam Me"? Check. Receive spam? Check. Wait...

A few years ago, I was registering for some site. I wish I remembered which, but obviously it must've been pretty forgettable. As a test of their commitment not to spam its users, I gave myself a colorful name, and made sure I checked the option to NOT bombard me with spam.

Apparently, they didn't send me spam, but they shared my information with Vonage and they diligently followed up.

Now I'm just hoping they don't leave me voicemail, that would really be awkward.

Wednesday, May 14, 2008

Vista Capable, (Not Quite) XP Ready


So my wife's office has a DELL OPTIPLEX 745 that's having issues. Every few hours its hard drive cooling fan sounds like it's a Pratt & Whitney™ turbojet engine prepping for launch off a convenient flight deck. I checked the BIOS under Maintenance -> Event Log. Saw some colorful error messages such as:

  • Previous shutdown due to thermal event
  • CPU0 fan out of range
  • Her office manager calls Dell. They send one tech, then another. They replace a fan, remove another. The problem recurs. Level 2 tech support engaged, and Dell nicely sends the office a warranty replacement, a DELL OPTIPLEX 755.


    Geeks, you know what I'm thinking. This is Dell, this is a 755, a close incremental revision up from the old model. Windows XP Repair Install, baby! Wait a minute, not even that, I could just clone the drive, boot into Safe Mode, a little Device Manager magic and driver download deliciousness and I'll be home free!

    Using the still accessible old PC, I'd attach my external USB hard drive, and use Acronis True Image Home to take a snapshot of the 745's hard drive, then restore it over the top of the 755's. Then, the XP Repair Install to get Windows reacquainted with the hardware, intimately.


    My initial efforts were thwarted. The symptoms of thwartage included a "quick" BSOD, despite having installed the Intel Matrix Storage Drivers from Dell's support site specific to the 755. These are the type of drivers which you would supply to Windows setup upon hitting the F6 function key when prompted for any third-party drivers to help Windows communicate with hardware that isn't currently supplied on the install disc.

    Immediately upon reboot, the system quickly yielded a BSOD and rebooted. I haven't got photographic memory, but after a few attempts with identical results I caught hint of a driver issue. Whether trying a Normal, Last Known Good, or Safe Mode boot, I got the same result.
    The answer hit me like a pound of bricks (for a ton would just leave a gooey mess for CSI to scratch their heads over).


    I entered the BIOS, discovered the Drives -> SATA Operation option, and noticed that Dell had set it by default to AHCI, which according to Wikipedia is Vista-specific. I switched this to plain old ATA which XP is quite fluent in.

    Upon reboot, Windows XP loaded successfully and began acclimating itself to the new hardware. A few additional driver installs for the audio, video, and network and the system was its old self in more time than I'd originally have liked.

    Lessons Learned

    Given the industry strife inspired by Vista, prompting even system builders like Dell to respond to customer demand and offer XP on some of their new desktops, expect that even if your PC, when new, was preloaded with XP, a warranty replacement might be outfitted with newer hardware for a newer world. Not necessarily better, just newer.

    "Why'd the Dell dude get busted? Because pot is a Gateway drug!" - Anonymous