Archive

Archive for June, 2009

SyntaxHighlighter: Prevent #{var} in a Ruby String from Being Parsed as a Comment

June 27th, 2009

WordPressWordPress is a seriously popular blogging platform, primarily because it simply rocks. In fact, this here blog uses WordPress.

Since I generally write posts about programming issues, I needed a good plugin for automagically highlighting code segments. I ended up choosing SyntaxHighlighter by Viper007Bond.

While it generally kicks butt, there is one little bug that is particularly annoying for those of us who post snippets of Ruby code: including a variable in a string like 'this is a #{color} string' causes SyntaxHighlighter to make everything after the “#” into a comment, which it wraps down to the following line.

That simply won’t do…

Read more…

Programming , ,

Calling a 32-bit System Command from a Script in x64 Windows

June 20th, 2009

64-bit ScriptingLet’s say you’ve written a little 32-bit script that calls a Windows command such as nbtstat. When you try to run the script in x64 Windows, you get an annoying “File not found” error – even though you can see the command sitting in the \Windows\system32 folder.

What’s going on here?

x64 version of Windows have two system folders: \Windows\system32 and \Windows\SysWOW64.

The 32-bit commands are in the SysWOW64 folder, and the 64-bit commands are stored in the system32 directory. x64 Windows looks in system32 by default when you call a command line function, since it tries to call the 64-bit goodies (no, that’s not backwards!).

So, you might think that you can simply change your script to explicitly call, for example, \Windows\system32\nbtstat instead of just nbtstat, and you’ll be off and running, right? Wrong.

Fortunately, there is an easy way to solve this little problem…

Read more…

Programming , ,

The Truth About Windows Licensing, Activation, and the EULA

June 13th, 2009
©2009 Microsoft Corp.

©2009 Microsoft Corp.

Okay, I’ve just about had it. Once again, I have just read some comments on a blog post about the restrictions on OEM vs Retail copies of Windows. And once again, people are obviously just regurgitating what they have read somewhere else.

I, on the other hand, base my comments on my own experience installing various versions of Windows (XP, Vista, OEM, Retail, etc.) on a whole boatload of computers over a period of many, many years.

So, can you move a copy of Vista OEM to another computer? Can you move an upgrade copy of XP to a different computer? Can you do a clean install with an upgrade copy of Vista?

The short answer is this: you can do anything you damn well please with any legal copy of Windows.

Read more…

Computers ,

Windows x64: How to Print to Any Printer Even Without a 64-bit Driver

June 6th, 2009

Say goodbye to 64-bit printing problems!So, let’s say you’ve taken the plunge and installed 64-bit Windows XP, Vista, or Windows 7. All is going well, until you try to install your printers.

It’s at that point that you discover that Windows doesn’t have a 64-bit driver for your printer. Worse yet, the manufacturer may not provide one, either!

What the heck are you supposed to do now?

Fortunately, there IS a way. And, strangely enough, you have Mac OS X to thank for this solution!

Read more…

Computers , ,