Tuesday, October 17, 2006

Bowling for FrontPage users

Not everyone in your department has a license for Dreamweaver, and there are FrontPage users who want to edit pages on your server. All fine and dandy, except for one dreaded command in Internet Explorer: "Edit this page in Microsoft Office FrontPage."

If your pages are 100% HTML with no server-side includes or dynamically generated content, you can stop reading here and go back to watching those funny hamsters dance up and down. If you use a CMS that keeps people with FP away from it, likewise.

The rest of us are already tearing our hair out at the notion of someone replacing a carefully constructed framework page with static HTML once they're done changing a paragraph. See, IE merely passes the page's URL to FrontPage's Open File dialog, and then FP retrieves the code as if it were a browser -- because it is. Tell FP to open someone's phpinfo.php file, and the user agent will be Mozilla/4.0 (compatible; MS FrontPage 6.0). There's a solution.

In your .htaccess, add the following lines:

# Set a trap for people trying to edit pages from IE
SetEnvIf User-Agent FrontPage fpnono
Order Allow,Deny
Allow from all
Deny from env=fpnono

Tuesday, July 25, 2006

Dynamically add/subtract upload fields to form: Chapter 2, the backend

In the previous chapter, we covered what it takes to build XHTML-compliant dynamic content inside a webpage. One of the things we did not do was use some kind of input element name iteration. We don't need to.

Let's reconsider the way the name attribute behaves in HTML forms. While it's true that XHTML deprecates name in favor of id in most situations, inside forms name still serves a critical function: defining a collection of noncounted elements.

Forms are all about collections: checkboxes and multiple selections inside a select box send collections to CGIs. When multiple checkboxes inside a form share the same name, they send their values as a collection. Checkboxes are input elements, and so are file uploads. In other words, an array.

Lincoln Stein's CGI Perl module is capable of handling these arrays, and has been since version 2.47. The mental block here is assuming that CGI's param method only returns scalars. Fortunately, it doesn't. The problem, however, is that Stein's own documentation says the following:
To be safe, use the upload() function (new in version 2.47). When called with the name of an upload field, upload() returns a filehandle, or undef if the parameter is not a valid filehandle. In an list context, upload() will return an array of filehandles. This makes it possible to create forms that use the same name for multiple upload fields. This is the recommended idiom.
This would be beautiful, if it were true. Unfortunately, it is not. param() returns lists, upload() only returns the first member of the list passed to it. I mention this here because forum posts indicate this has been a land mine for many since upload() was introduced a few years back. So, if all the potential upload inputs have a name attribute of 'mypix', the following neatly harvests them:
@mypictures = param('mypix');
The array sent to param() is merely the upload filenames as filehandles -- to which various methods return metadata for preprocessing. uploadInfo($file)->{'Content-Type'} returns the MIME-type, tmpFileName($file) returns the path to the actual file on the server, and there are others you'll see.

First, a bit of housecleaning. The array param() returns is obedient and dumb; it will contain blank elements for every unused input field or those filled with nonsense text instead of filepaths. We can neatly purge these with a single statement:
@mypictures = grep {$_} @mypictures;
The expression tells Perl to return the results of a regex search against non-null members in @mypictures. No second temporary array, no loops. $_ can be your friend. (FYI: your browser is the one purging the nonsense fields, not CGI.pm)

Dynamically add/subtract upload fields to form: Chapter 1, the frontend

The assignment: create a webpage which permits faculty to upload digital course reserves materials, using XHTML frontend and Perl backend, then attach those uploads to an email sent to a clearinghouse mailbox.

The complications:
  1. backend needs to be agnostic towards how many uploads are being sent, preferably no iteration over numbered input name attributes
  2. frontend is proper XHTML, therefore adding new input elements can't use document.write JavaScript methods

Let's deal with the frontend first. XHTML deprecates document.write because it breaks the idea of XHTML as a properly formed XML document: anything could be inserted into your webpage no matter how well or poorly formed it is. If I'm not mistaken XHTML served as its correct MIMEtype results in browsers throwing errors when they encounter document.write.

Fortunately, XHTML nominally being XML, it supports XML's methods for inserting, removing and changing internal content. Let's take a look at some sample JavaScript:

Thursday, July 06, 2006

Everything old is new again, or: the future of OS X.

An anonymous poster on Slashdot who claims to have friends in high places in the OS X world makes an interesting speculation on the future of Bootcamp and Windows on Macs. While his contact refuses to say specifically what Apple intends, it's not difficult to read between the lines:
Getting to the point, talking to the guy and asking him about the possibility of using my Windows skills to port applications using WINE but with a translated front end on the Mac side. [snip] His response was one of the most direct responses I've ever gotten about future plans without him saying anything. Claimed to have looked into WINE, had it running internally ... and he said that while it was a good product, they weren't going to use 'compromised' APIs to do this. When asked if they had any plans to license or develop any of their own non-compromised APIs, he responded that there was no plans to license anything. It was a pretty strongly worded statement, especially when looking into the point by point claims and what was missing from my original query.

On my G5, Classic runs inside the same partition and shares a similar filesystem to OS X -- by design. Nevertheless, it shares common elements with OS X: the menu bar, the Trash, and a common paradigm for the window GUI even if the chrome is different. X11 lives in what another /.er calls the "penalty box" -- its UI is too decentralized and unpredictable to translate all menus to the top of the screen, so its interface can't be Aqua-fied.

Enter Windows XP. A completely documented API per the 1997 agreement with Microsoft (which granted Apple total access to the Win32 API until 2002, the year after XP came out), and now Macs have dual Intel processors. It doesn't take much thinking to imagine the second core running XP inside the Windows partition: no hassle of translating Windows apps' expectations of a C:/-based filesystem to the Apple-flavored BSD filesystem, and more importantly, it sandboxes inept and malicious applications' behavior to that partition. If you need to share a file, OS X reads (and writes) NTFS. This last point isn't trivial: Linux is still battling the ogre of full read/write support for NTFS and its partitioning utilities won't grow an NTFS partition.

It isn't virtualization, at least not like we know it. Let's go back nine years to a column from 1997, the year of the Apple/Microsoft agreement:


Remarkably, Apple is running ahead of schedule developing Rhapsody and has already shipped its first developer release and blue box release. (Microsoft, take a hint.) Rhapsody will run on at least two hardware platforms: PowerPC and Intel. It's based on the Mach Unix kernel, either version 2.5 or 3.0. It will allow different levels of OS compatibility, allowing use of the Mac OS and Windows on a Rhapsody core. Remember that the Mach kernel is underneath everything. Symmetric multiprocessing is integral to the kernel, which means that Rhapsody applications will be able to take advantage of multiple processors.
  1. Rhapsody for PowerPC, a PPC-native OS with Blue Box support for Mac applications.
  2. Rhapsody for Intel, an Intel-native OS with Red Box support for Windows applications.
  3. Yellow Box for the Mac OS, an environment for running Rhapsody applications on a Power Mac.
  4. Yellow Box for Windows, an environment for running Rhapsody applications on a Windows-based computer.

Suddenly, Apple ditching Classic and their continuing support of Mach despite its recent performance speed comparisons makes a little more sense. Blue Box is what currently runs Classic apps on PPC Macs, and capably.

As you can see, this is not virtualization. It's Red Box: XP in place of Classic, running on the second core, APIs gently tweaked to put menus and system tray items at the top of the screen. I suspect this has been in the works for longer than The Switch: in the three years since Apple started selling dual G5s, the amount of Apple software actually exploiting the second processor is minimal at best. In retrospect, an x86 emulator seems like the most likely reason for the spare processor on those doomed PPC platforms, at least until IBM sucker punched Apple by removing the endian-switch register VirtualPC depended on.

Where pundits are right on the money is XP compatibility's impact on Vista: Apple extending the lifespan of XP dilutes Vista's urgency. In an amusing way, this is actually good for both Apple and Microsoft in the mid-term. It makes a Mac more attractive to people who might otherwise complain it doesn't run their favorite games or whatnot. It also buys Microsoft more time to revisit Vista and perhaps negotiate with Apple over how Vista could work as a client OS inside this environment (selling more Vista licenses in the bargain).

This raises an interesting question, however. If Apple's had Red Box in its back pocket all this time, why encourage Boot Camp?

Tuesday, June 27, 2006

More mythjunk part 3

Playback was starting to show skips I knew weren't in the recordings -- because those skips were also during live TV and DVD playback. IRC chatting with Myth experts indicated that it was probably interference from commercial flagging jobs on previous recordings. They suggested telling Myth not to run flagging jobs immediately after recordings, and to use mythtv-setup to set a specific time (e.g. 3 AM) to run those.

They were also kind enough to tell me that my two suggestions were already in development:
  • Frontend utility for selecting a DVD's worth of recordings and exporting a DVDstyler/DVDauthor XML project file
  • VLC-based streaming to web interface to make mythfrontend not 100% necessary

More mythjunk

Playback was starting to show skips I knew weren't in the recordings -- because those skips were also during live TV and DVD playback. IRC chatting with Myth experts indicated that it was probably interference from commercial flagging jobs on previous recordings. They suggested telling Myth not to run flagging jobs immediately after recordings, and to use mythtv-setup to set a specific time (e.g. 3 AM) to run those.

They were also kind enough to tell me that my two suggestions were already in development:
  • Frontend utility for selecting a DVD's worth of recordings and exporting a DVDstyler/DVDauthor XML project file
  • VLC-based streaming to web interface to make mythfrontend not 100% necessary

Tuesday, June 20, 2006

Even more mythjunk

This is threatening to turn into a MythTV blog. So be it. DVDstyler's a decent substitute for iDVD, and if you're running XP you can play with the windows port. It's not part of the Ubuntu repositories; QDVDauthor is, however.

Where I'm sucking terribly is simple video editing to nip out the commercials. Low-end utilities like avidemux2 can cut out the commercials, but take a long time to export back to DVD-friendly MPEG2. Cinelerra's awesome if you're looking for Final Cut level editing, which I'm not.

Also, I've noticed the screen resolution's been frozen to 640x480, a common problem with Ubuntu 6. Since xorg.conf has all the right video modes, I'm wondering if the system is detecting the NTSC converter and assuming the worst.

The process goes like this: DVDstyler asks you to set a default background image. Then you drop MPEG clips into an area like iMovie's. Drop buttons from the button palette (just like iDVD's) onto the background and right-click them to determine their attributes/actions. I hate to admit it but it's easier to use than iDVD 6.

When you're satisfied, save the project (a tiny XML file) and click the burn button. Whereas iDVD shows you a faked preview of the DVD first before you're ready to burn, DVDstyler masters the DVD's ISO first and then dumps the ISO into xine for real-world testing before burning. Less immediate gratification, but no room for misguessing the real DVD later.

Part of the reason I want to fix the screen resolution is because fewer and fewer desktop applications for any platform comfortably fit that size. Dialogs either compress their contents uncomfortably or fall off the borders altogether. It's unpleasant. It also suggests that some interface guidelines should be followed more stringently.

Ultimately, what I'm aiming for is a new plugin for Myth which will automate creating the DVDstyler XML project files. They're appallingly small and simple, so it seems like a no-brainer to have an interface for creating simple project files to open, tweak and set for burning.

OK, the first one burned OK after some tweaking. The second one, I tried with QDVDauthor, but was displeased with the number of unimplemented functions and cryptic errors.

Friday, June 02, 2006

Frying pan not hot enough; reinstalling Myth under Dapper

It seems inane to reinstall Breezy just so I can download six months' worth of updates and bolt on the support that Myth needs, when much of it has been put into Dapper.

So,,,, here goes nothing.

Lacking the official 6.06 LTS release CD, I attempted to install from the Flight 6 CD and discovered that Espresso couldn't deal with the partitioning scheme I intended (20Gb ext3 for /, 1 Gb swap for swap, and remaining XFS for /home). It screwed up partitioning and the choice of filesystem for the ones it got.

FYI: if you have a Breezy install CD and you want to get to Dapper, don't use apt-get dist-upgrade like you would with Debian proper. Install Breezy, then go to a terminal and do the following:
sudo apt-get install update-manager
Breezy's default Update Manager (off the System -- Administration submenu) doesn't have a one-step button for updating between major releases, but the update in the repositories does. As soon as you've done this, go to the Update Manager and click the button for doing the full upgrade.

And expect it to take 5 hours or so to get all 1000 files on a 256K DSL connection.

Wednesday, May 31, 2006

Trashing your Myth Box, day 6

I noticed that video was getting painfully choppy while recording a show this evening and did a little googling to see what could be responsible. It turns out only the boot partition and the DVD burner were set with DMA on, but not the partition where the recordings were. Continued googling explained the hdparm command, and I decided to hdparm -d1 /dev/hdc to change this. It worked, but I went overboard and did an hdparm -d1 /dev/hd? all while everything else was running. The terminal froze, Myth's frontend quit and would not restart, and when I rebooted the Dimension wouldn't recognize the OS.

For a change I actually looked things up before freaking too badly and making it worse. I did, however, boot a Knoppix CD and burn the largest downloads behind the install to a DVD in case I had to start over. This page explains a little of what I have ahead of me.

Edit: There are times when a little more thinking would have been smarter. In my zeal to make everything all better, I forgot that individual partitions don't need their own DMA settings.

Wednesday, May 24, 2006

Building my own MythTV, day 3

The symbolic link hack worked. The backend and frontend are now both 0.19, and AFAIK the entire system works: mythfilldatabase correctly loads the schedule, the program guide shows it, live TV is functional and the recordings are being recorded.

A few tweaks were necessary, however:
  • Ubuntu's default action when DVDs are inserted is bringing up Totem (and it has another default for CDs), and those defaults had to be disabled.
  • Most importantly, the default location for the recordings needs to be reset in mythtv-setup. If you don't, it defaults to /var/lib/mythtv, which is outside the giant XFS partition we set up specifically for this purpose. Everything under /home is on that partition, so I created /home/mythtv/recordings and set mythtv to store recordings there instead.

Tweaks yet to do:
  • Figure out how to stop mythbackend without killing its process.
  • Reconfigure Myth to use 0.19's own DVD player instead of mplayer (which skips menus)
  • Increase mythbrowser's default font size. Mythbrowser's cookie messages imply it's Konqueror-based.
  • Edit channels to show callsigns.
  • Install xmame and configure it to recognize the remote's keys as the default input device.
  • Map color keys to alt-F1 and alt-Tab for quickly accessing Gnome menus/switching windows, unless there's something else already doing this in Myth.


Overall, it was an interesting experience comparable to installing Debian stable (Woody) for the first time: a steep learning curve, a lot of configuration, and a reasonable amount of burr-sanding at the end. Mistakes, reinstallations, and a ton of Googling. If I had to do this again on another box, it would take less time, but I'd also insist on a T1 and >=1GHz CPU as the process involves downloading over 100Mb of source and binaries, then compiling them. If I were an installer who favored Ubuntu over KnoppMyth, I'd probably put all the files on a 1Gb memory stick along with a copy of his webpage.

A recap: Hyams' instructions are good, but he clearly got tired of writing them towards the end. His chief error in the documentation is the one where he assumes the myPHPadmin root password becomes mythconverg's password in all the config files. mySQL's permissions model changed after that documentation was written, and mythconverg has its own randomly generated password visible in Myth's own settings page. Do not change that password. Write it down and insert it into all the config files that default to 'mythtv' for a database password.

His startup script for forcing the 0.19 PATH to the beginning of $PATH does not work. It just doesn't. Accept this and do what I did to ensure 0.18 is neutered. Arguably the test of how well I understood his instructions would be rewriting them to omit the entire 0.18 installation altogether.

Perhaps 0.19 will make it to the Dapper repositories and make all that unnecessary.

Tuesday, May 23, 2006

Building my own MythTV, day 2

The software install worked, technically speaking. Unfortunately the channel listings and program guide don't work. Hyams' instructions blithely assume the phpMyAdmin setup's new root password is the same pw used by everything in MySQL, and that just ain't so. The table mythconverg that the mythtv user creates is automatically assigned a random 8-letter alpha password, and changing it in the PHP config files merely results in errors (which is what happened the first night I tried installing MythTV). The password is correct, the permissions are somehow messed up.

For the hell of it I'm going forward and upgrading to 0.19. As the instructions point out, MythTV-0.19 is a manual compile (estimated at 15 minutes, but still going after 2 hours on the 450MHz PIII). Compiling the plugins took another hour.

The biggest pain in the ass so far has been getting the box to forget there's an older version of Myth on the system and to exclusively point to the new one. I'm giving up on being nice and trying to get Hyams' PATH script to point the system to the new binaries; instead, I'm renaming the old binaries in /usr/bin, then replacing them with symbolic links to the new ones.

Sunday, May 21, 2006

Building my own MythTV, day 1

Long and short: in return for moving data off an old PC's HD to the owner's new HD, I inherited the PC. It so happens that it has 512Mb RAM, 200Gb HD, a DVD burner, an nVidia card and a mediocre 450MHz slot 1 PIII.

In other words, a reasonable candidate for a Linux PVR. Since the box was free, my objective is to get the whole thing done for less than $200.

Myth is a little different than your regular Linux distro. ext3 is apparently unsuitable for large files like the ones Myth creates and deletes, so the instructions say to set aside a separate partition in XFS. I'm following Daniel Hyams' instructions because they're made for the PVR card I bought, the $80 Hauppauge PVR-150. Nota Bene: I fucking hate Fry's. If I'd gone into CompUSA first I would have been done with my shopping and left with my dignity inside twenty minutes.

The Hauppauge series are prized in part because they have the Conexant MPEG2 encoder chip that relieves realtime load from your CPU. The PVR-150 uses the same "microphone" IR receiver the AlchemyTV DVR does, except that it also features a separate IR transmitter as well (for controlling set-tops).

Getting the video out to the ancient 19" Magnavox is another issue. This TV was bought to watch President Bush debate. That is, President Bush debating then-Governor Clinton, so it's not going to have a DV or VGA input on its back. Because we're doing this on the cheap, replacing the video card is out of the question. Fortunately, we've already got a Radio Shack RF converter connected to the television for the DVD player, so what we need is VGA to SVHS. Enter the Grandtek GEZ-1000, a $40 VGA-SVHS cable which encapsulates the converter circuitry and uses a USB cable to leech the 5v it needs from your computer instead of requiring a brick. These were clearly designed for notebook computers, but it's hard to argue with something that eats less space and costs less than the boxes that do the same thing. Had I been thinking more clearly by the time I was at CompUSA I would have purchased one there; I ended up ordering one online. It'll arrive in the mail in a few days and I can test it then.

Since the TV's on the other end of the room from the router, for now the internet connection will be managed by the AirPort Express we installed last year. I'll have to look into whether the kernel is competent at managing a generic wifi card before sinking $70 into that.

Some considerations for those who'd follow in my footsteps:
  1. Hyams' instructions were written soon after the Breezy release, so parts of his timetable are optimistic. If you're not on a T1, they're extremely optimistic; prepare to wait over an hour for apt-get update; apt-get upgrade to finish. There are a few other places where the downloads are either large or slow depending on connection.
  2. I prefer KDE to Gnome. That said, the instructions are optimized for Gnome when it comes to configuring startup and repairing broken scripts that Myth installs. Accept this, use Ubuntu not Kubuntu, and move on.
  3. This process involves creating a lot of users and passwords in various places. Keep a paper notepad nearby and take notes. Resist the impulse to use the same uname/pw everywhere; this is a box with a live internet connection.
  4. There are two PVR-150 models out there; the one with "MCE" in the title is the one you don't want. It's built for Windows XP Media Center Edition and doesn't have a remote. While it has a few more ports on the back, it doesn't have video out either. Skip it and go for the plain PVR-150; it's cheaper as well.

Thursday, May 04, 2006

Making Acrobat Reader 7 save fillable PDFs

I have a flexible spending account with an accounting firm that uses PDF forms. They aren't fillable. At work, I have a license for Acrobat Professional, so it's not rocket science to put form fields on it (and in particular, script them to tote up the receipts I'm filing). This morning, my printer ink carts went belly-up and I couldn't print the form I intended to sign, scan and fax to the accounting firm.

Bummer. See, at home, I don't have a license for Acrobat Pro, so the best I can do is fill out the form in Acrobat Reader (because in Tiger, Preview ignores the calculation scripts and worse, scales the field font size too large to fit them) -- but AR won't let you save the file, and it's just bright enough to prevent you from printing to PDF (which, IMO, is criminal misconduct).

There are two solutions to this problem depending on your platform.

OS X: AR 7 isn't bright enough to prevent you from printing to PostScript proper, which Preview is perfectly capable of reading, converting back to PDF and saving back to that format.

Windows: If you don't have PDFcreator installed as a printer driver on your box, shame on you. If you have CutePDF, double shame: you're using a crippled version meant to sell you a "complete" PDF printer driver which has nearly nothing that PDFcreator doesn't already have. AR 7 on Windows is not smart enough to recognize one printer driver from another, and will be happy to let you print your PDF to another PDF.

Linux: Most KDE distros have a PDF printer driver already configured. Follow above instructions.

Now, I have a filled PDF I can keep in my records, bring to work, print and sign.

Dear Adobe: you created fillable forms and hard-sold them on us. Quit pretending the most basic utility (saving them) is a premium feature and we won't have to own your sorry asses like this.

Tuesday, April 18, 2006

It's Alive: Turning a rev.a 1998 iMac into a Kubuntu box

The situation: Single mom in her early 30s has a hand-me-down first-generation G3 iMac with OS X 10.1 and IE 5.2 still on it. No suitable FOSS that's compatible with 10.1.

Bad news: Oldest iMac ever (tray-loading, IR port on front, no DVD, CD-ROM only). OS X refuses to recognize a partition larger than 8Gb. Internal clock battery died years ago. The infamous round single-button mouse.

Good news: previous owner pimped drive up to 16Gb, RAM to to 512Mb and original 233MHz G3 to Sonnet Harmoni 500MHz G3 upgrade which also included FireWire. The original Apple iMac service manual is available online. Prognosis: an acceptable candidate for desktop Linux.

After backing up all the original data (which consisted of OS X, a slew of ancient Classic Adobe applications and a dog's breakfast of MP3s), it was time to figure out if the box could actually run a modern Linux distro for PPC.

PowerPC leaves you with few choices for distros, and they all divide between Debian and RedHat variants. The latter are provided by Yellow Dog Linux, and my feeling is that spending money on a port of a free x86 distro rather than RHEL is money not well spent.

The "customer" doesn't know OS X deeply and doesn't need to. The behavior she expects is that when she turns it on, the machine boots and logs in for her, no password needed. For this reason, I chose Kubuntu. Ubuntu because of its OS X-like single-user mode, and Kubuntu because KDE's behavior is a smaller learning curve for someone coming to Linux from Win/OS X. In a moment of stupidity I chose Dapper Flight 6, but later reinstalled Breezy 5.10.

Ironically, the Ubuntu PPC installers are peaches and cream compared to their liveCD counterparts which have issues with recognizing some less popular hardware. OS X's 8Gb maximum partition nonsense is a limitation of 10.1 on these iMacs, not Open Firmware, so it was a joy to let the partitioner blow away the entire HD and redo it as one large ext3 partition and a few tiny swaps. Breezy went from booting the CD to first GUI desktop login in less than 60 minutes. Realistically the only shorter install time I've had is from the install DVD and it isn't dramatically so.

Now, the real work. Since the user is not a computer expert and has no reason to become one, the interface needs to be finessed back to what she expected from OS X. KDE's defaults (and Kubuntu's) are well-intentioned, but not ideal for a switcher. What I won't be doing is theming the distro to an imitation of OS X. Nor will I try to move all the menus back to the top of the screen a la OS X's implementation of Fitts' Law. Gnome apps might comply with that setting, but many others don't, and this is a KDE installation. The other KDEisms need tweaking, though.

UI behavior. By default, Kubuntu uses single-click to open icons (as does Knoppix), and its UI leaves scrollbars with both arrows at one end (which is configurable in OS X but not usually default). These are reset.

As an experiment, I replaced KDE's use of DejaVu Sans everywhere with a generic TrueType version of Lucida Grande (OS X's system font), only to discover it looked too tiny and the letterspacing was too wide. Moreover, DejaVu Sans is the master Unicode font for Kubuntu the way Arial Unicode MS and the "real" Lucida Grande are for Win/OS X respectively. Back to DVS.

Single user mode. Into User settings, the single user was set to the default login, "no login" mode. I hear you pulling your hair out there; you can stop now. In order to change any setting or install any software, she will have to first enter her password into a dialog (a la OS X), which the other members of her household will never see. sudo without the CLI.

Real world interoperability. This reminded me; a basic desktop user really can't thumb their noses at the base Microsoft fonts if they expect to share office documents. On x86 platforms, this is usually a matter of installing the msttcorefonts package from your choice of apt manager. Enter adept, Kubuntu's alternative to synaptic. As it so happens, OpenOffice.org is smart enough to detect that you've installed the MS core fonts and quietly resets its default fonts to Times and Arial.

Media players need to be configured to permit browsers to handle embedded movies. mplayer is my weapon of choice here, and fortunately Breezy makes its installation less painful than Dapper's. A blog entry explains that an "ugly" gstream library makes it possible for rhythmbox to play MP3s and it's installed without incident.

Core apps. Regionalization was fine tuned, time servers pointed at, a network printer created and tested, and now it's time for the apps Kubuntu forgot to install: GnuCash, Gimp, Inkscape, Firefox, vlc. The Ubuntu team ships OOo with ambiguous, indistinct application icons for reasons I don't understand but assume are similar to Firefox being installed with the generic Deer Park logo. Those of you who point out that Kub has bitmap versions of the correct logos are advised to consider what happens when you put apps with those bitmaps on the Kicker and mouse over them: a grainy lo-res version appears in the tooltip. Bad marketing, no finesse.

We can fix that by getting SVG versions of those application logos. Doug Schepers redrafted the classic Jon Hicks Firefox logo in Illustrator and exported it to SVG. Downloaded and sudo mv'ed to a new /usr/share/icons/ directory, we can choose it as the K menu icon and then drop it into the Kicker. OpenOffice was a more troublesome beast: finding SVG versions of the apps logos eventually yielded a single SVG with all application icons in one document. If it weren't late at night I'd probably have found them in separate documents somewhere, but I couldn't, so I used Inkscape to split them into individual compressed SVGs and moved them to the same custom /usr/share/icons/ directory.

vlc is a more problematic beast, which surprised me considering the number of x86isms that mplayer requires and vlc doesn't, but it should be done soon. Flash is a problem because Macrodobe isn't shipping a PPC plugin for Linux yet and may never do so at this rate. Development of OSS SWF players has stagnated.

Summary: if you want to switch a user, make them comfortable first and preach FOSS later. This means the following:
  • Crap-ugly Bitstream serif fonts are a non-starter. Get fonts they're familiar with, because they'll be working with them sooner or later.
  • A basement-dweller's conception of what makes a better default UI is alienating. Single-clicks to select, double-clicks to open. If I wanted to sell GNOME, I'd install Ubuntu not Kubuntu.
  • Installers don't get everything right. Clean up font smoothing, check localization, make icons familiar. Set energy saver modes and put in a basic screen saver.
  • Install media players and hook them up to the browsers.
  • Pretest their hardware. Put in the most obscure music CD you can find and see if it plays and if the OS can guess what the title is. Repeat with DVD. Burn a data CD with K3B, then an audio CD. Check onboard microphones, IR, wireless, Bluetooth, etc.

Wednesday, April 12, 2006

A couple good things to say about Ubuntu as well.

As Debian distros go, it's the easiest and fastest to install from an installer CD. Least number of irritating questions about hardware, and I was able to go from boot to go in 60 minutes.

edit: The installer seems smarter in some cases than the liveCD when it comes to detecting hardware. Older iMacs have a few distinctly different hardware configurations/chipsets than later G4/G5s, but they're IMO the most likely PPC candidates for Ubuntu and detection of their hardware should be a higher priority than comments to the effect of "well, they'll all be dead in a few months anyway, why bother."

In particular, booting an Ubuntu liveCD on an older iMac means having to CTRL-ALT-F1 to stop the X server, edit xorg.conf to change the horiz/vert sync settings, and manually restart the display manager.

Once you're there, if your network card wasn't detected properly, you have no eth0 at all. You'll have to drop down into the kernel's /modules/devices/net directory, guess which .ko to insmod, and then dhclient to rebuild the network devices before you can so much as ping your router.

Insofar as a liveCD is supposed to A) impress people with your platform and B) predict whether a given computer can run that distro, this is short-sighted to say the least.

Monday, April 10, 2006

Cringely Pinches His Loaf

Columnists and pundits in the computer industry are somewhere near snot in the great scheme of things. You know it serves a purpose but you have a hard time explaining what it is, even to yourself.

Columnists divide among predictable lines.

The Lickspittle. Paul Thurrott, railing against IE7 one minute as if he were web standards' Joan of Arc -- but as soon as he gets an exclusive on the Beta 2 preview, conveniently forgetting every critique.

The "Consultant." Rob Enderle, making predictions which have no foundation in reality or precedent, but whose outcomes invariably favor his clients and his own stock portfolio, if the two can be considered separate entities.

These two are maddening because reading their idiocy, you get the impression they genuinely believe what they write, despite the absence of facts or a frightening inconstency with what was said just a week before.

And then there's The Dvorak School of faux rockstar gonzo journalism. Bloviate as outrageously as possible as often as possible and your editors will be too afraid to fire you for incompetence. Politics without the risk of accountability. Unfortunately guys like Dvorak don't have the balls to eat a shotgun like Hunter Thompson did when he realized he peaked years ago.

Cringely started out reasonably scholarly, but realized that these days farting gets attention. This week's elevator SBD is no exception. Boot Camp works, nothing useful to write about it because it works, just a plethora of assholes posting photos of XP and Vista running on iMacs. Think think think Cringely, the PT Cruiser isn't paying or itself.

Wait! Got it. Predict that Apple will turn around and sell OS X for whiteboxes. Never mind the fact that we all know Microsoft and Linux have had to spend decades working against guessing what the hardware can and can't do. Forget everything we understand about Apple's only economic model, the one they founded the company on and the one which has sustained the company through three turbulent leaderships and two platform changes.

Here's what Robert X. Cringely knows, but also knows he can't sell columns telling you:
  1. Apple makes its profits selling hardware bundled with software. The clones were killed when it became clear the cloners were directly competing with Apple's desktop market instead of filling the server market they were chartered to make affordable.
  2. Apple sells only enough software to demonstrate proof of concept (barring niche video apps) and allows third party vendors to build their empires writing the killer apps. The number of third-party software packages Apple's poached over the years is miniscule compared to Microsoft's seemingly insatiable need to fill and dominate every Windows market.
  3. Apple avoids any distribution channels which don't show instantaneous and accurate sales figures. iMacs left Sears, iPods left HP, and Apple would rather pay the most outrageous storefront leases than trust another company to sell their products again.
  4. Apple's hardware partnerships are complex and many-reasoned, but largely depend on what it does for Apple's margins. IBM might have been able to deliver a laptop G5 by 2007, but they could never fab entire laptops for what Intel was offering. And Lenovo was the writing on the wall for IBM's future as a hardware company.

The above can be summarized as follows:
  • Entrenchment is more important than short-term growth.
  • Depend totally on no one else's frameworks, technological or economic.
  • Let your product differentiate itself and others will evangelize it for you.
  • Smile a lot.

Dear "Bob," let's cut to the chase. The Internet is a completely valid medium for doing what you're doing right now. The part you're missing is that usually, a webcam and a credit card are involved, and you're expected to lick the jizz off your fingers afterward.

Sunday, April 09, 2006

Love Letter to Dapper Flight 6 team

Preface: this distro is supposed to be finalized in less than sixty days. Were this further in the future, my comments would be less barbed.
  1. A liveCD which can't manage to load the most common wireless chipset on the PPC platform (Broadcom aka Airport) is a lousy demonstration of "it just works."
  2. While the default behavior of the trackpad being a click device in Flight 5 was difficult for some iBook users, at least the tracking was comparable to OS X/Windows. Flight 6's tracking on PPC is ridiculously slow and inexplicable compared to the x86 Flight 6 Ubuntu release. Knock it off.
  3. Kubuntu's default text rendering is the blockiest possible for LCD displays; replace it with regular aliased bitmaps or get a clue.
  4. The Kubuntu wireless configurator fails on both platforms (x86/Intel Pro chipsets, iBook/Broadcom); it momentarily enables eth1 and then disables it immediately afterward.
  5. If you can't get Espresso out of the gate for Kubuntu, put a more informative message at startup that this isn't even fractionally functional compared to the same app in the Ubuntu release, not a copy of the same message (FYI the Ubuntu Espresso is fully functional on x86).
The above can be summed up thusly:
  • The most common hardware for a platform should be anticipated and implemented first, not promised later.
  • A distro release's interface using the same libraries should behave the same on two different platforms.
  • Linus was right about Gnome. Implementing Kubuntu in a half-assed way years after Slax, Knoppix and others finessed KDE live distros says more about Ubuntu's politics/technical skills than KDE's relative merits as a windowing environment.

Either buy into the idea of "the customer's always right" re: platforms and windowing managers or stop paying lip service to the idea of Ubuntu as something other than an x86/Gnome distro.

Tuesday, March 21, 2006

Quick Launch keeps disappearing -- no more

OK, you're already familiar with the registry hacks that had to do with spyware, and you've done your damndest to filter them out of Google because that wasn't your problem, was it.

It wasn't in my case, either. I'd log out of XP, then log back in and the space for the Quick Launch was there but the icons weren't. Turn off the QL toolbar and turn it back on, and there they were. Royal PITA to do every time you log in.

Chances are good if this is your problem, that you work in a networked situation where the sysadmins have put your Application Data folder on a network share that's mounted at startup. Trouble is, the moment at which Windows needs to retrieve that Quick Launch folder probably precedes the moment that Windows maps the share to a drive -- and the registry settings which tell Windows where to find the QL use (you guessed it) a drive address. This is the same reason that wallpapers I select from Firefox don't return on startup; the Quick Launch shortcuts folder and the FF wallpaper are both stored in subfolders of Application Data (which on non-networked computers is neatly tucked into your C:\Documents and Settings directory). In fact, Quick Launch is actually application data belonging to Internet Explorer.

Here's the solution. Usual disclaimer about editing registry and destroying your system here, the secretary will disavow all yada yada yada...

The first thing you need to know is the UNC path to your Application Data folder. In our case, my network share is 'yourshare' and the U: drive maps to
\\yourshare\yourdepartment\yourusername\

There are two registry keys which point to your application data's location; in my case their values used drive addresses instead of UNC addresses.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\AppData
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\AppData
Those keys' values default to U:\myusername\Application Data which is technically correct but undefined at the moment they're needed.

Change both of them to \\yourshare\yourdepartment\yourusername\Application Data and quit regedit. Log out and log back in and you should be fine and dandy.

IE7b2 Testing: day 3. Pitchforks and torches.

The March 20 release was installed this morning. IE7 doesn't pass any tests it failed in the previous blog on this subject. It also doesn't change its behavior with any of the following DTDs, on either IIS or Apache servers:
  • HTML 4.01 Loose
  • HTML 4.01 Strict
  • XHTML 1.0 Transitional
  • XHTML 1.0 Strict
  • XHTML 1.1
More disappointing is the official remark from Microsoft that this second version of IE7b2 represents the final renderer for the shipping version of IE7.

Paul Thurrott was right the first time: it's time to start badging websites again if CSS2 is to stake its claim as a standard, and let IE users deal with dodgy looking websites the way Netscape 4 users had to. Otherwise, Microsoft won't have an incentive to release a 7.5 update the way they did with 5.5.
  • Use QUOTE.
  • Use OBJECT to encapsulate non-text content and cascade it down to progressively less rich content.
  • Use BUTTON on forms the way it was meant to be used and put a note on the form linking to why it doesn't work in IE with links to MSDN's IE blogs anchored to the comment section.
If being a big fucking nuisance is the only method left to get Microsoft to pay attention to standards, be one.

Monday, February 27, 2006

Testing the Blogger widget.

So, it looks like Vista will have a virtual clone of Quartz except it won't use PDF but XPS. Pros for XPS include it essentially being a JAR. Cons are the idea that printer vendors will jump on the idea of installing XPS RIP into their products considering how much of a free lunch PDF gives them.

Tuesday, February 21, 2006

Open letter to Apple re: Secunia advisory 18963

You really dropped the fucking ball on this one.

BOMArchiveHelper can detect executables in .tgz archives but it can't question the existence of resource forks in platform-independent common datafiles like JPG, MP3, PDF?

Until BOMArchiveHelper is intelligent, Safari should at most open a ZIPfile, not its contents.

Friday, February 03, 2006

IE7b2 Testing: day 2

After unsuccessfully struggling with trying to get IE7b2 to run in local mode, I was able to get a test PC I could install it to.

The security problems I mentioned before evaporated. Select menus work. Pages are no longer unjustifiably accused of having popups. That's the good part.

The bad part: CSS support is better but still sketchy in parts. A typical CSS-only CSS menu page like CrazyTB's works but demonstrates the same problems with z-index and "hover holes" that I encountered when adapting the horizontal menus we use on our home page. The z-index issue has to do with daughter menus underlapping parts of the parent menus; the "hover holes" make the menu disappear as you're navigating the elements. Hopefully both can be fixed the way we did it.

HowToCreate's CSS-only menu is a disaster as is Eric Meyer's. How IE7 renders it:

...and how everything else does.

I'll go out on a limb here and guess there's a selector syntax IE7 still doesn't understand. Meyer's CSS2 tests for selector syntax and child selectors indicate that + and > are recognized now, whereas they weren't in IE6. If you've forked your CSS using these operators to hide definitions from IE, you may be in trouble.

When I attempted to create this blog in Blogger, the screen came up but the edit window's text color was white on white. Not funny.

Going through Meyer's CSS2 test suite, we see that it still spectacularly fails every property-based test IE6 fails:Conclusion? This product is lip service to standards and no substantial change from IE6. This was guessed as early as two thousand four. MS improved a handful of unbelievable calculation-based rendering bugs and implemented the missing selector syntax -- but their claims to have rewritten the whole thing from the ground up is bollocks, plain and simple. Bollocks. Couple this with the fact that unless you're running XP SP 2 or Vista, you have no chance to run IE7, and adoption of it could be years in the making. Corporate environments are still wedded to Windows 2000 and home users with dialup are either running earlier versions of XP, pirated versions of XP, or even Windows 98.

Unless there's a beta 3 in production which features changes to the above, Paul Thurott may be right to suggest returning to the days of badged websites and boycotting IE7.

Wednesday, February 01, 2006

IE7 Beta 2 caveat

There's a fairly important difference between IE 7 Beta 1 and 2 beyond the cosmetic.

To vastly oversimplify, IE 7b1 was a demonstration of the new eye candy. New interface, new features (tabs, plugins, security features), but it used the same exact HTML/CSS renderer that IE 6 does. To web developers this is useless.

Recently, build 5296 aka IE 7b2 was released by Microsoft for download. It features the actual new renderer with the CSS fixes promised in MSDN's blogs. There's a more recent version (build 5299) but it's not supposed to be available to the public. Eventually there will be a public beta as well.

One irritating feature of IE is that installing new versions invariably wipes out old versions, and there isn't always an uninstaller to revert to older versions. To make it possible to test new IE versions in the wild, Microsoft put an undocumented "local mode" into the installers.
IE installers are in fact .RAR archives. Unpack them to a temp directory with a tool like 7zip or WinRAR and inside is a pile of files including the iexplore.exe program itself. In order to make this version of iexplore run without trying to install itself, the usual trick has been to delete a DLL in that directory (shlwapi.dll), then create an empty textfile renamed to iexplore.exe.local -- these two things alert iexplore.exe that it's not an installed version and to run in local mode.

There's a problem with Beta 2. Microsoft hasn't been fond of "local mode" because it derails the installer's ability to overwrite system files with newer ones. Beta 2 comes with a new version of a system library (wininit.dll) which it expects to find -- in a particular set of circumstances.

Forumistas with both legit and pirate copies of XP have had inconsistent experiences getting Beta 2 to run in local mode. I was able to get it to run easily on a PC yesterday, but on another PC running the same version of XP Pro the application opens and closes mysteriously. Attempts to run it from a command line result in a cryptic dialog:

iexplore.exe - Entry Point Not Found
The procedure entry point InternetGetSecurityInfoByURLW could not be located in the dynamic link library WININET.dll.

The only difference between these two test bed PCs is that the one which ran successfully was logged in as the sole Administrator account, and the one which did not is an administrator but not the Administrator. Complaints on the forums indicate that this may not make a difference.

Here's my take on how it behaved. The infamous IE CSS rendering bugs documented at positioniseverything.net are largely fixed. I haven't run it through Eric Meyer's CSS2 test suite extensively, but I did notice that it still doesn't appear to support max- and min- dimension properties.

More critically, it accused sites which use JavaScript of having popups it blocked, when no such popups exist. Menu selects fail to work and some actually trigger popup blocker warnings. CSS-based menus do not consistently disappear when hovers end. The last one may be an anticipated side effect of using behavior: JScripts to correct IE6's incomplete hover: model. [edit: this was partially the case. csshover's author rewrote his code to do nothing in the presence of IE7 and it solved the problem.]

Until I can test IE7 in installed mode rather than local mode, I can't tell whether these are bugs in IE7 itself or its interaction with an OS using IE6 libraries.

Sunday, January 15, 2006

Waiting for Login

Testing out an iBook G4, I was hoping to demonstrate a spiffy ATI Radeon demo I installed on my G5. Unfortunately this demo requires a Radeon 9800, and the stock video onboard an iBook G4 is a 9550 which lacks the oomph. The demo locked up and refused to quit, CMD-OPT-ESC quit or anything other than rebooting.

The machine restarted, but after the "Starting OS X" animation, I was left with the pointer in front of the default blue background, and no login screen. Mouse moves the pointer, volume/brightness/eject keys work... no login screen whatsoever.

Rebooted from the install DVDs, repaired permissions and repaired disk. No dice.

Reinstalled OS X with save/archive. No dice.

Here's what worked, and what I should have done first. Reboot using your install CD/DVD, holding down the C key to force boot from the optical drive. Wait for the multilanguage prompt to install, click continue and wait for the main installer screen.

There's a Utilities menu. Select Terminal: we're going bogey hunting for a corrupted login preference file.

At the prompt, enter:
cd /Volumes
ls
ls is Unix's directory command. You should see a listing of at least two devices: your boot CD/DVD and your hard drive. We're going to your hard drive:
cd /"Macintosh HD"
Unix is fussy about case sensitivity and spaces in file names. The quotes make it clear that HD is part of a file path and not a separate argument to be passed to the cd command.
cd Users/yourusername/Library/Preferences
rm com.apple.loginwindow.plist
reboot
Yeah, it was really that simple. If you're savvy to using single-user mode, you can get to the file (without the install discs) that way too.