Monday, November 16, 2009

My favorite Regular Expression for deleting a line at a time

Ok, so you probably know the power of regular expressions or regex. One of the great things about regex is that with most modern text editors (and even some old classic ones) you can use them to do quick editing over a large file.

My favorite (and this will work in Visual Studio) is for removing lines at a time based on some match.

Let's say we want to select (most likely for removal) any line from a file that has the word Bart in it. Our regex would look like this:

^.*Bart.*$\n

The \n indicates new line. If you left off the \n the line would be selected without the new line character. If you are doing a replacement (such as with nothing to delete the line) and leave off the \n the line is selected but not the return character so for removing the text, a blank line would still exist in the file, whereas including the \n will delete the entire line from the file.

Monday, November 09, 2009

Snow Leopard Doesn't Support Some Epson Printers

UPDATED: See update below...

Well I wish I had known this before I upgraded to Mac OS X Snow Leopard.

Apparently Epson hasn't released drivers for some of its more expensive "pro" printers such as my Epson Stylus Photo 2200. It appears the same is true for the 1280 and 2100 and probably others as well.

Epson has stated they will release a new printer driver by the end of January 2010 that will be distributed by Apple as a software update.

The current version of Mac OS X Snow Leopard (10.6.2) includes the open source Gutenprint driver for these printers, however, most people report that either they don't work, or the colors are so off that they are useless.

For a list of Epson (and other) printers supported with native drivers in Snow Leopard you can go here. If the driver lists Gutenprint next to the printer name (i.e. Epson Stylus Photo 2200 - Gutenprint v5.2.3) you know that the manufacturer hasn't developed a native Snow Leopard printer driver yet and your printing results may vary.

BTW you may find the printer driver on Epson's website here that claims it is compatible with Mac OS X Snow Leopard 10.6. That file is identical to the older printer driver that worked under 10.5 and is not a new one that fixes color issues in 10.6. Epson has stated multiple times that the new version will be available through Apple's software update and not a download from their website.

UPDATED: January 3rd 2010

Well it appears they've released the update. Oddly it doesn't appear during the Apple Software Updates but through the new printer driver update facility that Apple added to Snow Leopard. Now you might be wondering how to get the update to appear? Well, mine showed up automatically when I plugged in the USB cable of the printer to the computer. Immediately I got a dialog saying updated drivers existed and asked if I wanted to download them. Note that I had already uninstalled the non-working Gutenprint drivers, so if you were using those, I have no idea if you would get the update notification. I hope you would.

After downloading it automatically added the printer, and I was able to print. I haven't done any detailed photo printing but printed a few color pages on plain paper the colors looked good. So good luck to you and thank you Epson for living up to your word. It would've been better if you had these drivers available when Snow Leopard shipped but better late then never. You can see several printers have been added here to the list here with a + which indicates the Vendor software was recently added via software update.


Friday, November 06, 2009

Clicking HTTP URL Links in Outlook 2003 on Windows opens two browser windows in Safari

I've seen this happen in both Safari and Firefox. This fix is specific to Safari although the Firefox fix is probably similar.
If you open explorer.exe (the Windows file manager, you can just double click "My Computer" or "My Documents" to get an explorer window) then go into
1) Tools->Folder Options...
2) Then click the File Types tab.
3) I scrolled down and found two entries for:
(NONE) Safari URL
As you can see from the picture, the Delete button was grayed out so I couldn't delete one of them.
4) I selected one of them and clicked Advanced.
In the Actions list was a single entry named "open"

5) I selected that action and clicked Remove.
After that I only get one window in Safari when I click links in Outlook 2003.
I've gotten some feedback from other users (including Firefox) that this isn't always the problem/solution so I'm adding another step here.
You may have to remove the DDE entry. Follow the steps above 1-4. Select "open" and click Edit...

If you see anything in the DDE Message area, just clear it out and click OK.