Jump to page content

Googler’s Haven
Totally Random Tidbits Page

Contents

Creating working File > New entries

There is already plenty of content on the Web describing how to add File > New entries to Windows Explorer, including references to using Microsoft’s free power toy TweakUI. Some of us are quite content to just do it using the Registry (especially as that gives you much better control than TweakUI as to what sort of new file you get). However, very frustratingly, sometimes it does not work. No matter what you try, and how perfect your new Registry entries are, you do not get a new entry under New.

There are at least two reasons for this. First and foremost, the file type must have an “Open” action. Some software uses a different name for the default action, such as “Open in some program”, “Play” or what not. Windows is happy to use such an action as the default for when you double-click a file, but in order to see an entry in the New menu, there must be an Open action for the file type. The correct way to give the Open action a custom name is to use the default value for the key. e.g.

[HKEY_CLASSES_ROOT\FirefoxHTML\shell\open]
@="&Open in Firefox"

The visible name will be set to the default value but Windows will still consider it to be the Open action. TweakUI will raise an error if you attempt to generate a New entry for a file type with no Open action, considering it to be unassociated. (For the curious: under Windows 2000 at least, using Folder Options to re-associate the Open action will remove any custom action name chosen, so you won’t be left with stray names.)

Secondly, the file type must have a name. It is possible with TweakUI under Windows 2000 to generate a New entry for an unnamed file type, but doing it by hand under Windows XP fails: no menu item shows up. The reason for needing a file type name is that this is what Windows uses for the New menu item and the filename for the newly-created file. If you omit the name under Windows 2000, you get a makeshift name like “JPEGFILE”.

My learning ground for this issue was Firefox. Earlier versions did indeed name the Open action something else, and after reporting this and having it fixed, they nevertheless failed to name the file type and so I still was not able to get it to work when I tried it on another machine. Developers, take note!

Labyrinth of Despair map

The Xargon Trilogy manual contains the solution to the Labyrinth of Despair at the back. And strangely enough (and unless I am really stupid) it is wrong! I don’t imagine that too many people now are Despairing in the Labyrinth but since Xargon is such a cool game, here is the correct labyrinth solution:

Labyrith of Despair solution map

I am not sure what solution 1 would have been?

PHP under Mac OS 9.1 and earlier

This is a question that comes up periodically: how do you run PHP on the MacHTTP Web server? The simple answer is that you cannot. To the best of anyone’s knowledge, the only PHP for classic Macintosh is Tenon IntersystemsWebTen package, which is a complete port of Apache, the UNIX networking stack, PHP, Squid and plenty more to the Macintosh. At the time of writing, this costs $99 in the closeout sale, as it is now considered obsolete.

I imagine that the only other alternative is to switch to a BSD UNIX flavour (NetBSD seems favoured for older Macs) and compile PHP for UNIX. This is if you specifically need PHP to use existing source code and knowledge. Failing that, the best match is probably TABASOFT’s Biferno, a PHP-like, Open Source, cross-platform Web application server that supports MacHTTP. I have never used it personally; I discovered MacASP first and found the developer to be open and pleasant. Other suggestions are Userland’s Manila (the latest incarnation of Frontier it seems, and supplies its own built-in Web server) and the Interaction Web application server. There might be more non-PHP options; I only learnt about Manila and Interaction just now after a quick Google search.

There are many server-side scripting and content management options for the Macintosh ranging from Open Source to high-priced, but just no PHP. PHP was finally made available to the Macintosh as of Mac OS X, by adapting UNIX PHP to run on Mac OS X’s UNIX layer. So if you can stand or afford Mac OS X, that might be your best option.

Aborting an endless stream of JavaScript dialogs

Every now and then, some delightful soul is going to send you to one of those prank Web pages that pop up endless JavaScript dialog boxes bearing stupid or taunting messages. The offending dialog boxes lock out the window or, on a Macintosh, the entire program, leaving you with possibly no option but to kill the program dead, along with all your open pages. If you have session saving enabled, the page will come back on reload leaving you in worse trouble! But here are some tips:

iCab for Macintosh:

Press Cmd-Shift-J and then close the current alert dialog. This signals iCab to terminate the offending JavaScript once the dialog closes. iCab may well be the only browser to offer this feature, and I stronly suggest that other browsers get in on the act.

Firefox:

Close the current alert dialog and immediately press ctrl-W (on a PC) or cmd-W (on a Macintosh) to close the offending tab. This seems to be the only way of getting a response from the interface; attempting to use the mouse to close the tab failed for me. One more dialog will likely appear but with the tab gone, it will be the last one you see.

For other browsers, I can only suggest you try using either keyboard or mouse instructions to close the tab or window immediately after closing one of the alert dialogs and before the next one opens.

How can I have gapless music playback in Winamp?

I have seen a few solutions to gapless playback in Winamp, including a plugin by “Crudsoft” that uses the lesser WaveOut output plugin, but Winamp itself has perfect support for gapless playback using the DirectSound plugin. You just have to realise how.

Set Winamp to use the (already superior) DirectSound output plugin, and then set these DirectSound options:

The mistake I made was to assume that the first setting is all you need, but it doesn’t quite work for MP3: it still introduces a slight amount of silence between tracks that is enough to be irritating. The reason being – I read recently – is that due to the lossy compression in the audio, there is a small amount of silence and then a small amount of error at the beginning of the file, and then the reverse at the end. There is a small amount of cross-fade performed against every pair of frames within a file to counteract compression artefacts, but not against the end of one file and the start of another. The silence removal cuts out this tiny amount of leading and trailing silence and leaves you with pretty reliable gapless playback.

Avoiding fuzzy gaim buddy icons

The gaim (now Pidgin) multi-protocol IM client had a nasty habit – long since resolved – of blurring your own buddy icons when you select them, in the Windows version at least. It was suggested by gaim developer Stu Tomlinson in response to gaim bug 1092532 (fuzzy MSN display icons) that it was something to do with converting images to PNG format as required by MSN. I found this guess to be correct, and the bug was unfortunately closed without resolution (as though image format conversion is supposed to leave images all blurred). The problem actually affected all gaim protocols supporting buddy icons; each protocol only accepts certain formats and using anything else caused gaim to blur the image during conversion.

The acceptable formats are:

Converting buddy icons to these formats first will ensure that they do not become blurred. Note that this bug has long since been solved.


Return to the random content page