My htmlspecialchars() functions for Javascript

December 22nd, 2007 3 comments

I thought I'd post my htmlspecialchars() functions for Javascript.  This should mimic the PHP version of htmlspecialchars().  I also include rhtmlspecialchars() in case you need to do the reverse.


Words of Wisdom from Bobsentme

November 2nd, 2007 No comments

In case anyone is wondering, to open the services.msc console for a remote server from a command line is:

runas /user:(administrator account) cmd.exe&&services.msc /a /computer=(computername)

Apparently, according to Google, I'm the only person in the world that's ever figured that out.

My horoscope for today

June 19th, 2007 No comments

"Your interest in a wide variety of unusual subjects can earn you friendship or admiration."

That's not only accurate, that's spooky-accurate!

More signs you're a geek...

May 8th, 2007 No comments

- A female friend tells you she wants you to see her rack and so emails you a picture.
- You open it up expecting to see a picture of a metal frame commonly used to hold servers.
- It actually IS a picture of a metal frame commonly used to hold servers.

Happy birthday!

May 5th, 2007 No comments

Happy birthday to!  "The Fruits of my Labour" is one year old today.

Name that tune!

April 30th, 2007 3 comments

Does anyone recognize this music?  I heard it years and years ago and never actually found out the title or its artist.  This version here is me on the piano, but I'd love to one day hear an original recording or find some lyrics, if it has any.

Unknown Song.mp3

USB Printers and Terminal Services

December 26th, 2006 No comments

This one day at the previous job, we were trying to map this USB printer via Terminal Services.

Emphasis on 'trying' as it wouldn't automatically map. It had to be manually mapped at every logon, which was problematic, as I was the only one with that kind of access.

I noticed the LPT printers mapped without a problem, so I shared the printer, mapped it to LPT2, and installed a printer to LPT2. Then, I connected to the Terminal Server. It mapped beautifully.  I tricked it!!

This was a solution that the tech before me, the point-of-sale company's techs, and apparently five Microsoft phone support techs couldn't figure out.  I should have been somewhat happy about this.  However, the tech before me, along with the point-of-sale company's techs had proven themselves less than competent on several occasions.  And Microsoft is, well, Microsoft.  Out-teching them was not an accomplishment to celebrate over.

But I digress.  Back to Terminal Services and its eccentricities.

This does not entirely make sense to me.  A good analogy for this solution would be getting lost and going to a gas station for directions, only the directions they give you are "put on a disguise, drive 'round the block, and come back." So you put on one of those fake moustache and glasses things, drive 'round the block and back to the gas station, (where now nobody recognizes you) and THEN they give you directions to where you want to go.


On behalf of

December 25th, 2006 No comments

...Merry Chrismas!  Here is a Christmas song:

Christmas In My Heart

AJAX Communicate Function

November 14th, 2006 No comments

I've had a few requests to post my AJAX Communicate Function, so here it is. As you can see, you may pass four arguments to it. The first is 'method', which may be either GET or POST (defaults to GET), 'url' and 'querystring', which are self-explanatory, and 'failure'. The 'failure' argument may contain code to be evaluated in case of failure. This can be triggered due to anything from the server giving a 404 error to the user suddenly losing their network connection. This is optional, but useful.


Some more music

November 11th, 2006 No comments

Today, Tekkie asked when I would have time to record some more piano music for her.  I think she was kidding, but I took her seriously and came up with this:

Tekkie.mp3 (3.71MB)

Finally, an affordable CD label printer!

August 14th, 2006 No comments

Update: The Signature Z1 is now no longer available.  We are told it is due to the overseas factory that formerly produced them closing down.  Our supplier has been given no information about how long the ribbons will be available.  Unfortunately, a motor from our unit stopped working, making it impossible to change print areas, so we have switched to the (also now discontinued) Casio CW-100.  Annoyingly, there is apparently little market for affordable disc label printers.

Thermal CD Label PrinterWell, I've tried CD Stomper, LightScribe, and now this.  My only regret is that I wish I had tried this first!

CD Stomper was...well, paper labels.  'Nuff said.

LightScribe worked relatively well, but it was slow, the media was expensive, and the finished product only looked satisfactory.

The Signature Z1 works like a hot damn!

The Signature Z1 is a thermal printer for CD and DVD labels.  Instead of ink like an inkjet printer would use, it uses a ribbon and heat-transfer technology to transfer your designs to a disc.  And it's FAST!  An entire disc will take less than a minute to print.  There's no worrying about getting a paper label on straight.  And the best thing is, inexpensive, generic, unbranded discs not only work, they're in fact recommended.


Dynamically Add a CSS Class using Javascript

August 10th, 2006 No comments

I was writing a module for a webapp today and was thinking how cool it would be if I could dynamically add CSS classes using Javascript.  At that particular moment, I had all the classes for all the modules grouped together in one big file, but since sometimes I didn't load all the modules, it was inefficient.

It took me a while to find some examples on doing this, so figured I would post the function I wrote in case anyone else has this same problem.
function addCSSclass(className, classRule) {
 if (document.all) {
  document.styleSheets[0].addRule("." + className, classRule)
  } else if (document.getElementById) {
  document.styleSheets[0].insertRule("." + className + " { " + classRule + " }", 0);

600dpi on a website?  Yes, it's possible!

June 18th, 2006 No comments

Well, sort of.

With the rising popularity of webapps, more and more documents like receipts, invoices, form letters, and whatnot are printed using a web browser.  This is great, because you have all the advantages of a webapp.  But, when printed, your 72dpi logo looks just a touch muddy.  No problem!  Just print it at 600dpi and that logo will be as crisp and clear as the surrounding text.


CSS Media Types

June 18th, 2006 No comments

One thing that really frustrates me is when I try to print something off a website, and my printer prints three pages of headers, graphics, and menus, and ONE page of what I actually wanted to print.  Some designers have thought ahead and have a link to open their pages in a new window, unformatted, but this doesn't always work, especially if the page is, for example, dynamically generated by submitting a form, or the user has a pop-up blocker.  Fortunately, there's a really cool CSS technique for making this easier.  It lets you use one stylesheet for what your users see on the screen, and a completely different stylesheet for what you print!  And it works like a charm!


Some nice photos

May 6th, 2006 No comments

While out with Tirra, Donna, Juanita, and a few others for a lovely walk led by Martin, Mango took a few pictures.  We've been noticing that our wall is extremely bare lately so have decided to make our own artwork.

I used a Canon 50mm f/1.8 lens for all of these.  This is, as far as we know, the least expensive and also the lightest EF lens that Canon makes, but its optical quality is on par with 'L' lenses.  It, along with the 70-200mm f/2.8L lens, are our favourites.  The sun was shining quite happily, so we didn't need any special lighting.


WMP11 Installation Fix

May 5th, 2006 3 comments

I was helping a bloke set up his network. He had a Linksys WMP11 wireless network card.  There is a bug in some versions of the installer for the WMP11 that sets a registry value incorrectly. The registry value has the path to a particular file, only it's set to the install path. Result: When the driver CD is in the CD-ROM drive, the wireless card works. Eject, and it quits working. A quick solution is to copy the install files to the hard drive and do the install from there, but uninstalling doesn't remove registry settings, so that won't work unless you're installing the card for the first time.

The short version is, the last time I'd seen this was at least a year ago and had no clue what in the registry I had to fix. I couldn't find the original forum where I'd found the answer either.

For those of you who aren't interested in the story, are continually seeing the dreaded "WMP11 is not installed", and are not able to use your network, here's the solution: The registry key set by the installer reads as follows:

HKLM\SYSTEM\CurrentControlSet\Services\PCANDIS5\ImagePath: \??\D:\AutoRun\PCANDIS5.SYS

Just replace D:\AutoRun with C:\Windows\System32, reboot, and you should be on your way.

But if you're a technician on site and charging by the hour, feel free to read the rest of the story, which I shall now continue.  You will remember from two paragraphs ago that we couldn't remember how to fix the problem.  We did not have the benefit of this website.  With a heavy heart and trembling hand, we did what any good technicians would do. We prayed to Jesus.


The Fruits of my Labour!

May 5th, 2006 No comments

On my to-do list for a while now has been "Make a website for posting whatever random bits I feel like each day."

Here it is.

I can't think of anything else to say.

This may be a short website.