Peter's Blog

Redefining the Impossible

Posts made during March 2006


Was moved to try indexing the company Intranet using Google Desktop Search. I downloaded the kongulo plugin which offers to do this.

It turns out that this is a command-line python program that scrapes a web site for links and submits each one to the google desktop indexing engine.

Well it was broken, kept coming up with the error:

pywintypes.com_error: (-2147352567, 'Exception occurred.',
(0, 'GoogleDesktopSearch.EventFactory.1', 'Component not registered',
None, 0, -2147221502), None)

Going through the developer sdk, this appears to be because the API's have changed and no-one has bothered to update kongulo.

I changed the registration code at the end of kongulo.py as follows to fix this:

   1    try:
   2      # Register with GDS.  This is a one-time operation and will return an
   3      # error if already registered.  We cheat and just catch the error and
   4      # do nothing.
   5  #    obj.RegisterComponent(_GUID,
   6      hr = obj.StartComponentRegistration( _GUID,
   7               ['Title', 'Kongulo', 'Description', 'A simple web spider that '
   8                'lets you keep copies of web sites in your Google Desktop Search '
   9                'index.', 'Icon', '%SystemRoot%\system32\SHELL32.dll,134'])
  10  
  11      oInt = obj.GetRegistrationInterface( "GoogleDesktop.EventRegistration")
  12      hr = oInt.RegisterPlugin( _GUID)
  13  
  14      oInt = obj.GetRegistrationInterface( "GoogleDesktop.IndexingRegistration")
  15      hr = oInt.RegisterIndexingPlugin( _GUID)
  16  
  17      oErr = obj.FinishComponentRegistration() # pcw
  18      # TODO Provide an unregistration mechanism.
  19    except pywintypes.com_error:
  20      # TODO narrow to only the error that GDS returns when component
  21      # already registered
  22      pass

I find it odd that Google Desktop Search doesn't natively index intranets (or specified web sites): having to hack command-line python scripts to do it is hardly user friendly. It might be that they want people to buy Google Mini boxes for £2000 a pop rather than hand out free tools.

Maybe they are evil after all?

Incidently, this:

obj.UnregisterComponent( _GUID)

is how to unregister kongulo, as mentioned in the TODO (TODO is a programming term that means 'this needs doing but I can I can only summon the strength to press four keys').


Filed under: google python

2 Comments

WingIde 2.1 beta is out and... it has vi keystrokes! python ide, vi keystrokes, it just doesn't get any better.

Since I have been using Wing IDE I have not looked back. Annoyances:

  • Even on a >1Ghz processor it feels sluggish
  • It has an indentation analysis thing that examines the indentation in a file. You copy some dubiously indented code from somewhere and paste it into your beautifully crafted code and it decides to reindent your code with tabstop of 8 or something daft.
  • ugly gtk user interface
  • when editing anything other than python the tab key does nothing and I have to press ctrl-shift-dot to indent. Still, with vi keystrokes >> seems to work.

But for python development, even django and turbogears I wouldn't be without it.


Filed under: python vim wingide

Add a comment

Signed up for sky by Broadband which, as I am a sky movies subscriber, allows me to download said movies and watch them on my computer. The selection of movies is similar to the current selection on sky so it's kinda ok, not so bad that I ever get around to unsubscribing.

Sky By Broadband itself is heavily Microsoft DRMed but I don't really care. The files are circa 500M and they can be backed up to cd/dvd but you can only play them back on the pc you record them on. The licences to watch the films are time limited but the time limits are in the order of months. You have to download the whole film before you can watch it so it's not quite video on demand.

You are only allowed to register one pc in a household: I don't know if it's using my mac address to enforce this or what happens if the pc breaks and I want to use another one.

Still, it's costing me no extra and I can watch the films anywhere in the house and, in fact, anywhere as I can watch them while disconnected from the internet, such as when on holiday.

Oh, it covers Sky Sports as well but I guess from the themes on this site you can guess I'm not a big sports fan.


Filed under: sky+

3 Comments

I was passing a shop selling watches and spotted a 'closing down, everything half price' sign. Needless to say, I have a new watch.

I haven't worn a watch regularly for years and the last one I had was a basic analogue hands plus day-of-month thing that served me well until I got out of the habit of wearing it. Since then I have been content to get the time from my mobile phone.

New watch has:

  • continuous display of date, including month, year and weekday, should I need reminding.
  • world time
  • stopwatch with lap times and graphic of a little man running
  • three alarms
  • countdown timer
  • backlight (indiglo but not timex)
  • can go beep on every hour.

The beeper is very quiet: while the hourly chime won't get me thrown out of cinema's, the alarm is unlikely to wake me up.

It's huge and heavy but I'm very happy with it. Online I have found it for $85, I got it for £19.


Filed under: gadgets

Add a comment

I finally got around to setting up my signature in Thunderbird. To set up the signature you have to:

  • Create a signature file. This is a straight text file containing your name, some interesting ascii art, a quote that makes you sound learned and a warning that for legal reasons, nobody should ever read your email.
  • Open Tools/Account Settings/Manage Identities../Edit../Settings and click the 'Attach this signature' box.
  • Click 'Choose' and navigate to your signature file.

When it comes to email I'm a top poster: life's too short to spend scrolling down email messages. If you top post you want your signature at the top of the message, not the bottom where nobody will read it. On the 'Composition & Addressing' tab there is a control to tell it to 'start my reply above the quote' and another to place my signature 'below my reply (above the quote)'. If you choose this option and save the settings and then reopen the settings again the signature is set to 'below the quote (recommended)': looks like a bug in Thunderbird 1.5.0 (or some evil microsoft loving, emacs using, big-endian favouring bottom poster has deliberately broken it).

To get top posting to work correctly you have to go into the file

C:\Documents and Settings\{windows username}\
   Application Data\Thunderbird\Profiles\
   {random letters}\prefs.js

and change the line that says:

user_pref("mail.identity.id1.sig_bottom", false);

to say

user_pref("mail.identity.id1.sig_bottom", true);

Filed under: thunderbird

5 Comments

My work pc has been randomly rebooting for a while. The reboot is pretty random, doing nothing in particular there is a brief BSOD, it reboots and I say some rude words.

This reboot became particulary bad while I was trying to copy some vmware virtual machine snapshots: 2G worth of files. It couldn't copy more than two without a reboot. I am about to start some serious vmware use so I needed to get this sorted.

The googling I did blamed the problem on cheap RAM which is a possibility as the PC is a generic beige box made from cheap parts. However, before spending money I decided to look for a BIOS upgrade and sure enough one was available so I flashed the motherboard from the B6 revision to CN.

I tried to reboot the PC and it wouldn't start up: no beeps, just dead. I didn't panic, while mentally going through possible emergency procedures I reset the CMOS memory and all was well.

I've done a total of six vmware copies now and it hasn't shown the problem. It could be that the ambient temperature is not right but still things are looking good. If it fails again I will update here, hopefully without the rude words.


Filed under: abit

Add a comment

This site wouldn't load. Looking in the status bar it was trying to contact Google Analytics to get a javascript file. This affected Firefox but not IE which loaded fine.

I commented Google Analytics out of the page and now it is working again.

I don't use Google Analytics a lot, I still prefer statcounter for my web statistics because of the detail it gives me. Google Analytics is more about pie charts for marketing people. Statcounter tells me what google searches people are using to find my site and that is much more interesting. Statcounter also gives graphs and averages and these tally pretty much with Google Analytics.

I'll leave just statcounter installed for now, I don't need both, it slows down page loading, google analytics is in the header and brings the whole site down if the server goes, statcounter is at the end of the html and most of the page still displays even if statcounter isn't responding.

Moral: don't link to unreliable servers in your page header.


Filed under: google statcounter

Add a comment

What's the single most tedious thing about blogging: having to press the 'Add Blog Item ' button. I think I've hit on why taking notes with EverNote is fast: there is a blank note at the bottom of the screen that you can just start typing in.

I've realised that this could be done in a web app, simply by having a box on every page ready to start typing in. Google mail does something like this already: there is a little text box at the bottom of each message that you can select and start typing a reply: when selected it resizes itself and formatting toolbars and stuff appear. It's all very AJAXy and slick. Most of the time you can ignore it because it's not too big, once you explicitly start using it all the associated tools appear.

Compare to posting in drupal where there's all kinds of stuff filling the page: Input format, date edit boxes, categories, tags, I have to scroll down two pages to find the 'preview' and 'submit' buttons.

Here's a rough outline of the quick blogging features:

  • Regular blog page appears with a textarea box ready for typing in
  • Title is first line (if preceeded with a - or something), then a list of tags line, each tag preceeded with a dot or something similarly lightweight.
  • Rest of post is in wilki format.
  • Big button that uses AJAX to generate a preview which appears under the text box
  • After preview a post button appears.

Everything goes in the one textarea box, no need to tab or click between controls. Now I know what I want, how to implement it?

I am growing disillusioned with EverNote, mainly because of the buggy handling of formatting: if you mark something bold, for example, it has an annoying habit of not turning the bold off, you have to fiddle around selecting a big block and turning it all off explicitly (very much like Microsoft Word). I'm happy to use markup to make things bold, it's simple and understandable.

I want all my notes on a server where I can get to them from anywhere.


Filed under: blogging drupal evernote wilki

8 Comments

Wife wanted me to copy some DVD's, finally giving me an excuse to buy a DVD writer. After some contemplation in PC World decided on an OEM LG GSA-4167B 16x 'Super Multi Format' which was £35 with no software, manual or even screws, which didn't bother me as I have a copy of Nero 7 Premium. It is internal, to go in my desktop PC. I toyed with getting an external USB one at £60 to use with my laptop but decided I wouldn't burn DVD's that often and to save myself £25. I can always create images on the external hard disk and write them using the desktop.

This review calls the drive a 'safe buy', one of the worlds fastest writers but a little slow reading. Don't care so much about speed if it burns reliably (unless I wanted the worlds fasted coaster maker).

I put the drive in the desktop pc but kept the old DVD-ROM installed so it now has two drives. Nero gives a nice DVD copy option that simply copies from one drive to the other. There is a verify check box to turn on, insert two disks and press go. It takes about half an hour to burn and verify the disk but it is so nice not having to swap disks half way. The disks I am copying have no copy protection so no problems there.

I grabbed a spindle of 25 Philips DVD-R's, avoiding no-name brands for something hopefully more reliable. It was only when I got home I realised that they were 8x Single layer and can only hold a paltry 4.7G or a two hour film. Never mind, the disks I am copying are single layer. If I want to blow my four hour epic masterpiece baby videos to dvd I'll have to buy more disks.

Now I am running through the possible uses I might get around to one day:

  • blow home videos to DVD rather than VideoCD.
  • finally blow wedding video to DVD.
  • Rip all my CD's using my neat two-disk setup and copy mpeg library to DVD for backup. Can any ripping software handle two drives intelligently?
  • Backup 3000 photo's to half a DVD
  • Download knoppix DVD version and give it a spin.
  • blow TV shows recorded from hauppauge nova-t usb to DVD: actually I probably won't bother, I'd just wait for the repeats.
  • Figure out what dvd+/-W+R//-RAM means and whether it matters.

Filed under: nero

Add a comment

Based on comments left on this site I decided to look at TiddlyWiki, a personal Wiki system. I'm quite amazed by it as it is based on a single html file that does it all: it contains the code in javascript and also the CSS. It gives you a wiki editor plus storage for your wiki entries, all in the same file.

The entries in the Wiki are stored in 'Tiddlers', most of which are hidden when the html file is displayed. When you click on a Wikilink in the file the corresponding tiddler is displayed in the same page (not in a different page as is the case in a regular wiki). You can double-click on any open tiddler to open it in an editor. If you edit the file or add new tiddlers you can save it to your local hard disk, giving you a new version of the html file, complete with your edited tiddlers. The TiddlyWiki html file can be stored where you like, even on a USB flash key, giving you a pretty portable notebook with no software to install wherever you are using it. If you were so moved you could put the file on a web server, unmodifed, where folk could explore it wiki-fashion or download the thing to their own computer and edit it themselves. Cool. The TiddlyWiki site http://www.tiddlywiki.com, is itself a TiddlyWiki.

There are variations on the TiddlyWiki code that work with a server backend to store the tiddlers but the mainstream implementation is designed to work as a personal wiki system stored on your own computer (or flash key).

In a way the single file implementation bothers me because it means the wiki wouldn't scale very well: if I put 1000 entries in a wiki these are all embedded in one html file. This will take time to load into the computers memory where the browser will create a huge DOM model for it. FireFox is pretty memory hungry.

The ServerSide implementations that exist appear to load the tiddlers on demand so may not have this problem. However, in this case I am not sure how the search facility is implemented, whether it is delegated to a database engine. I have the code, I should look. There is a closed source Ruby-On-Rails version and in theory I could download the client side code and reverse engineer the server side code but that would be an objectionable way of doing things by my value system. I would only do that with an open-source system, maybe based on PHPTiddlyWiki creating PythonTiddlyWiki.

I think I could live with multiple TiddlyWiki files, one per subject, all bookmarked in FireFox: not such a big problem to context switch. In terms of Quick Blogging there is an ALT-J keypress that starts a new 'journal entry', leaving me to type what I want, press TAB, enter the tags, CTRL-Enter to finish. That's nice.

The way entries are stored in the html file is pretty clean: DIV's store the entries, with attributes holding the metadata: title/wikiname, modification date, modifier and tags. Easy to get the data out if need be.

I'll give it a try, see if I am still using it after a week.


Add a comment