Archive for August, 2006

Is Your Blog Showing Incoming Trackbacks? An Easy Way to Check

Tuesday, August 8th, 2006

Believe it or not there is a WordPress blog set up for the explicit purpose of testing trackbacks.
To Test:
Simply go on over there.
The sidebar there has the login info.
Log in and make a quick post with the trackback info for your own post you want to test.

Read this guide to make sure you are setting up your test post right.

And then I believe you sit and wait umm, 4-12 hours*. If you don’t see a trackback, your trackback spam solution is blocking it or something else is wrong. This site will put you on the right path to fixing your problem at least for WordPress.

*I don’t know exactly how long a trackback should take to appear. Perhaps an experienced reader can fill us in?

An Effective Solution to Trackback Spam in WordPress Blogs

Monday, August 7th, 2006

You may not know it but a few months ago I had an embarrassing problem with trackback spam. I searched around in anguish and finally settled on this wonderful WordPress plugin as the solution:

The Trackback Validator Plugin

Here’s the description from the homepage. The logic makes sense to me:

The TrackBack Validator plugin for WordPress performs a simple but very effective test on all TrackBacks in order to stop spam.

Legitimate TrackBacks are sent by people commenting on your weblog, accompanied by a URL that points to that commentary. Spam TrackBacks are accompanied by a URL that points to a pay-per-click affiliate website or other irrelevant material. The Validator exploits this key difference:

1. When a TrackBack is received, the plugin retrieves the Web page located at the URL included in the TrackBack.
2. If the page contains a link to your weblog, the TrackBack is approved.
3. If the page does not link to your weblog, the TrackBack is flagged as spam and rejected.

Because TrackBack spammers do not set up custom Web pages linking to the weblogs they attack, this simple test will quickly reveal illegitimate Trackbacks.

We are actively developing additional heuristics to add to the plugin; if you observe TrackBack spam that makes it past this plugin, please let us know.

Note: I waited 3 months + after installing this plugin to post about it because I wanted to make sure it truly worked. And it has, I haven’t gotten a single trackback spam since.

[tags]Trackback, trackbacks, trackback spam, trackback spam prevention, wordpress, wordpress trackback[/tags]

Fixing Firefox Cannot Use the Profile …Error Messages

Monday, August 7th, 2006

This MozillaZine Profile-in-use article will tell you everything you need to know to solve this.

Note: In my case using Ubuntu Dapper I located these “locked” files in this directory:
/home/chiefinnovator/.mozilla/firefox/q5ocj63r.default
More generally that pattern is:
~/.mozilla/firefox/[some random looking letters.default]

Why Everyone Should Backup Google Calendar to Their Own Computer

Saturday, August 5th, 2006


The most compelling reason is that it’s easy. Just follow these steps:

  1. Log into your Google calendar
  2. Click on the Manage Calendars link (On the left side)
  3. Click on the calendar you want to backup
  4. Scroll down to the section that says Private Address
  5. There will be a link that says “ical”, There be your data!

At this point you have a few options:

  1. Right click the ical link, click save link as and save that ical data.
  2. Use that url in a custom backup program you write.
  3. Import the ical data into Outlook or some other calendar software.


What are the other reasons to backup your Google calendar?

  1. Google could turn evil someday (and delete everyones’ data?)
  2. Google coud lose or delete data by accident
  3. You could lose your internet connection for an extended period of time
  4. You may want to move to a different calendar software in the future and am not able to export from Google calendar at that time(see reason 1)

If you’re an avid user of Google Calendar you may also like this post:
How to automatically add birthdays to Google Calendar

[tags]Google, Google Calendar, Calendar, PIM, Backup, local data, schedule, backup software, web services[/tags]

Why Killing Processes may be Hurting You and What to Do About it

Wednesday, August 2nd, 2006

First the Background:
A while back I wrote an insane program to automate Omnipage 14 (an OCR program) mostly via GUI automation. The urge to do this was caused by Omnipage not handling more than 300 files on its own before dying, and the lack of a better solution in the market place.
So Omnipage was very tempermental and quit often for all kinds of unexplained reasons. So my solution was to feed Omnipage 3 files at once and when it finished OCR’ing the 3 files kill all of its processes. Then give it 3 new files and relaunch it and so on.

Once I had completed the programming I set it off on it’s own to work on a network drive full of ~30,000 files needing to be OCR’d.

1 month goes by …

I come back to check on it and here is what I see on the screen!
System Tray Chaos
Apparently killing the processes didn’t allow some Omnipage process to clear its system tray icon. So as the headline promised here is at least one way that killing a process is harmful (and humorous). I’m sure there are plenty of more serious reasons though. (Yes, moving the mouse over these icons caused them to dissapear, so I spent a challenging 30 minutes randomly moving my mouse around the system tray and exterminating these things … )

A Better Option Than Killing
After that experience, here is the method I switched to. After Omnipage finishes its 3 files, I kindly request that it close itself using Python’s Win32 extensions. Here is the code (mostly copied from their win32 examples):

import sys
import win32process, win32api, win32pdhutil, win32con, win32security
import win32event, msvcrt, win32gui

def get_all_windows():
    """Returns dict with window desc and hwnd"""
    def _MyCallback( hwnd, extra ):
        """Helper function"""
        hwnds, classes = extra
        hwnds.append(hwnd)
        classn = win32gui.GetClassName(hwnd)
        if not classn in classes:
            classes[classn] = []
        classes[classn].append( hwnd )
    windows = []
    classes = {}
    win32gui.EnumWindows(_MyCallback, (windows, classes))
    return classes

def request_windows_to_close(list_window_descs_to_close):
    """Send me a list of stuff to close such as:stuff_to_close=['OP15_OmniPage_Agent_Class']
    run get_all_windows() to see what's available"""
    classes=get_all_windows()
    for windesc_to_close in list_window_descs_to_close:
        if windesc_to_close in classes:
            for hwnd in classes[windesc_to_close]:
                win32gui.PostMessage( hwnd, win32con.WM_CLOSE, 0, 0 )
                print 'requested closure with', windesc_to_close
        else:
            print 'Did not find a window desc. as',windesc_to_close

Life is good now I think :-)

Points of discussion:

  1. Did I miss an OCR product that I can just give it a directory with up to 60K files and have it OCR them into PDF’s?
  2. Is there a programmatic way to ask Windows to refresh the system tray (Don’t say moving the mouse programmatically over the system, that’s cheating.)
  3. I considered using the Omnipage SDK instead of GUI automation but it looked too expensive and hard to learn. Has anyone had experience with that method?

[tags]Python, win32, python win32, Python for Windows, Omnipage, GUI Automation, Automation, WTF, Windows 2000, System tray, icon, WM_CLOSE, win32gui, OCR, Autoit[/tags]