IT

 

 

How to uninstall/reinstall Wordpad

A neat trick to reveal hidden Windows components

  1. Start
  2. Run
  3. %SystemRoot%\Inf\sysoc.inf, and press OK
  4. In the Notepad that opens up, remove HIDE from:
    MSWordPad=ocgen.dll,OcEntry,wordpad.inf,HIDE,7
    so that it looks like this:
    MSWordPad=ocgen.dll,OcEntry,wordpad.inf,,7
  5. Save
  6. Close Notepad
  7. Start
  8. Control Panel
  9. Add Remove Programs
  10. Add Remove Windows Components (on the left side)
  11. Highlight Accessories and Utilities, click Details
  12. Highlight Accessories, click Details
  13. Scroll down to Wordpad and uncheck it
  14. Click OK

When done, do steps 10-14 again, but this time check it so that it installs. Have your windows disk handy.

HP Sucks

but then again nowadays, who doesn't?

I bought my main home desktop PC from HP as a refurbished unit 4 years ago for $800. It's got 3 gigs (now), SATA drives, a hyper-threaded CPU, lots of "us-bee" ports on 'de outside - it's still a pretty good box I think, certainly no longer great, but good enough for me definitely. It came with XP Home and I just left that there.

Recently, I upgraded it to Windows 7 and one of the first things I got was a message saying that my onboard video didn't have enough guts to run the cool new "Aero" interface. Well, Patti's got Aero-something-or-other on her Vista laptop and it's pretty neat and I'm sure I would like like it, so I thought "No problem. I've got a nice video card lying around that I never bothered to put in. I'll just stick that in now." I remove the side panel on the box and...there is no slot for video...meaning no AGP, no PCI-Express - NOTHING. The whole board has only got 3 PCI slots with two spots taken! I can even see the solder points on the board where the AGP port would be if it had one, but there is nothing there! What kind of fiddle-faddle PC company makes a PC that you can't even upgrade the onboard video?! What HP has done, by skipping this 25 cent part is they've planned and designed obsolescence right into the box.

I have to laugh at how scummy and transparent their strategy is, as well as the fact that it took me 4 years to notice!

I'm no longer a java n00b

I just built my first .jar using ant!

C:\hsqldb\build>ant hsqldb

Buildfile: build.xml
init:
javaversion6:
javaversion4:
javaversion2:
-prepare:

... and so on resulted in ....

hsqldb:
[jar] Building jar: C:\hsqldb\lib\hsqldb.jar
BUILD SUCCESSFUL
Total time: 21 seconds

Retrieving records from MSSQL with PHP

This is the result of two solid days of work

<?php

$myServer = "WorkServer";

$myUser = "Administrator";

$myPass = "123456";

$myDB = "ImportantFinancialDatabase";

//est. a connection to the database

$conn = new COM ("ADODB.Connection") or die("Cannot start ADO"); //create an instance of the ADO connection object

$connStr = "PROVIDER=SQLOLEDB;SERVER=".$myServer.";UID=".$myUser.";PWD=".$myPass.";DATABASE=".$myDB; //define connection string, specify database driver

$conn->open($connStr); //Open the connection to the database

   ...read more...

//1. Pull a single value

unset($single_value);

$rs = $conn->execute("SELECT ItemNo FROM Tbl_ItemMaster WHERE ItemNo='100061'");

$single_value = $rs->Fields(0);

echo "Single Value: $single_value<br />";

//2. Pull multiple values

$rs = $conn->execute("SELECT ItemNo,Description FROM (SELECT * FROM Tbl_ItemMaster WHERE (ItemType='MFG') OR (ItemType='PUR') OR (ItemType='CAMO')) DERIVEDTBL WHERE (ComodityGroup<>'PCKG') AND (ComodityGroup<>'PRNT') AND (ComodityGroup<>'SERV') AND (ComodityGroup<>'METF');");

$num_rows = $rs->Fields->Count();

while (!$rs->EOF) //carry on looping through and writing while there are records

{

$cm_itemno[] = trim($rs->Fields(0)->value);

$cm_desc[] = trim($rs->Fields(1)->value);

$rs->MoveNext(); //move on to the next record

} /* END looping through while there are records */

//print_r($cm_itemno);

//3. ATTEMPT to pull a value (value may not even exist)

//unset($single_value);

//$rs = $conn->execute("SELECT MatCst FROM Tbl_StndCostTable WHERE ItemNo='900061'");

//$single_value = $rs->Fields(0);

//echo "Single Value: $single_value<br />";

/* Results in: Catchable fatal error: Object of class variant could not be converted to string in C:\Documents and Settings\shoppe\Desktop\retrieving records from MSSQL.php on line 35 */

/*

The above is not detectable by:

!== ''

is_null

isset

empty

etc. etc. etc.

*/

//4. How to pull non-existent values from a MSSQL database. The query was successful but the value don't exist...

unset($single_value);

$rs = $conn->execute("SELECT MatCst FROM Tbl_StndCostTable WHERE ItemNo = '900061';");

if ($rs->EOF or $rs->BOF) {

echo "Single Value: 0<br />";

} else {

$single_value = $rs->Fields(0);

echo "Single Value: $single_value<br />";

}

//close the connection and recordset objects freeing up resources

$rs->Close();

$conn->Close();

$rs = null;

$conn = null;

?>

That was sobering

For the first time in my experience, Linux totally blows away Windows.

the one on the left is linux...

The Task:

I had an ISO image that I wanted to inject a file into, and then burn to CD.

In Windows:

I tried to figure out how to inject into an ISO with Nero, WinImage, and ImgBurn. The process, even if it was possible, was hardly intuitive. I couldn't figure out how to do it short of unpacking the ISO, adding the new file into the unpacked directory, and then repackaging up the unpacked files as a new ISO. Even that didn't work though because this ISO happens to contain a directory tree that has folders that are more than 9 levels deep, which violates ISO9660 standards, and therefore none of the softwares would let me create the new ISO. (I have no idea how the original author got around this, but I suspect the answer lies further down this page...)

Finally I gave up on injecting the new file and decided to simply burn the ISO to disk "as is." Nero 7 kept giving me a "Power Calibration Error." I've had this problem before and I tried the various fixes available on the Internet for this issue, like disabling the IMAPI service and setting my burn speed down to 4X/8X, yet I couldn't get a good burn. Trying to burn with InfraRecorder was similarly unsuccessful.

In Linux:

A Google search revealed that ISO Master is the tool of choice for what I want, so I used Synaptic Package Manager to install it. (~45 seconds). Then I ran ISO Master and opened the ISO. I then selected the file to inject and clicked on "Add". Then I did a "Save As" and saved the ISO to a new name (~60 seconds). Then in Nautilus, I right-clicked on the new ISO file and selected "Burn to Disc."

In Conclusion:

As I said before, for the first time, I was completely amazed at how much better the Linux user experience was than with Windows. What was effortless with Ubuntu on my older and slower lab machine, was impossible with my dual-core Windows box. I am definitely not a linux fan-boy by any means and I'm not enough of a n00b to believe that this represents a forward leap for linux as a whole, but the experience certainly gives me something to think about.

Say ello to my liddle fren...

A USB Key Theft-Prevention Device

A while ago, I bought a USB thumb drive for my company for corporate use, but I think the term "corporate use" was misinterpreted to mean: "steal me." So I bought another thumb drive and then developed a PHP registration application that interfaced with a MySQL database to keep track of who had the key and when and for how long...but I'll admit it might have been overly complicated creation - I guess it didn't really need the captchas and the blowfish encryption... because the second key somehow still managed to vanish into thin air during one of the regularly scheduled application and database maintenance backups...

and it is every bit as unsanitary as a real gas station key...

So, taking a page from the local gas bar I toiled away for the better part of a week of evenings in my home workshop and finally finished crafting the "Gas Station (USB) Key anti-theft device." (or g-SUK) I took great pains to make it authentic - right down to the urine splatters on the board.

It's been 48 hours and while nobody has exactly borrowed it yet, at least it hasn't been stolen.

(The title of this article was a line from Scarface, btw...)