Welcome to phroggy.com

Welcome to
You are visitor #555573.
Weblog Archive About Me About This Site
BannerFilter Open Source Frogbot
Fish Banner Cannons and Castles Noughts and Crosses
Articles Recipes Files
“Saying Windows 95 is equal to Macintosh is like finding a potato that looks like Jesus and believing you've witnessed the second coming.”
- Guy Kawasaki


Thursday, 20th January 2011

WHATWG says they're dropping the version number from HTML, and calling the specification a “living document” that will continually evolve without the need for specific version numbers (like “HTML 5”). Like everything else I've seen from WHATWG, this new position reflects reality pretty well, at least for now.

Critics are complaining that a standard should be a complete and consistent target that implementers can aim for, and if there are no version numbers, you can never be sure when you've achieved conformance with the spec, and different browsers that implement different revisions of the spec will be incompatible. However, these people have an idealistic view of how things should work - they have no idea how things actually do work in this field. No browser has ever been 100% compliant with one specific version of the HTML specification; browsers implement whichever bits and pieces of the latest spec that they like best (plus other bits and pieces they made up themselves). Thanks largely to WHATWG's work, this situation has rapidly improved over the last several years, but it will be many more years before the Web is stable enough that trying to implement a particular version of HTML actually becomes useful.

Meanwhile, W3C will still put version numbers on everything. They still cling to the fantasy that someday somebody somewhere will try to implement a spec just because the W3C says they should.

Open Letter About A Timer

Thursday, 14th October 2010

I just sent this email to Woods Industries/Coleman Cable, and thought I'd share my experience with anybody else who cares to read it. I'm in the middle of remodeling my bathroom, and I'm replacing all the outlets and light switches. I thought it would be a good idea to replace the fan switch with an automatic shut-off timer, so I can turn it on when I take a shower and have it stay on for a few minutes after I get out of the shower, then turn itself off without me having to think about it. I like it when things work the way I want without having to think about them. Anyway, here's what I sent them.


After purchasing an Intermatic FD2HW timer and attempting to install it in my bathroom to control the fan, I eventually gave up and instead purchased a Woods 60 minute countdown timer. I wanted to let you know that I have found the Woods timer to be a superior product in every way, except for one.

First and foremost, the Intermatic timer comes with four holes on the sides, and two separate screws. Unlike a standard outlet or light switch, which come with permanently attached screw terminals, I was supposed to screw these in myself. There was no indication on the timer body itself, but the directions indicated that the screws should be installed on the left side, not the right, even though there are holes on both sides. After I had done this, I tried to push it into the electrical box, but it looked like the screws might be sticking out far enough that they could potentially make contact with the box itself - and since it's an older metal box, that would be a problem. However, this problem quickly disappeared as something inside the timer broke and one of the screw terminals fell off.

I tried ignoring the directions and attaching the screw terminals to the right side of the timer instead of the left, where they were not in danger of touching anything, and carefully finished installation. The plastic knob was so tight that getting it to go on was a chore, and it still stuck out at least 1/8″ from the cover plate.

Unfortunately the directions were correct, and after flipping the breaker back on, the fan did not work at all. At that point I decided to buy the Woods timer, which a local hardware store had on clearance for about half what I had paid for the Intermatic timer on eBay. I then discovered that the plastic knob which had been so difficult to get on was nearly impossible to remove; I was barely able to do so without breaking something.

The Woods timer comes with flexible wires attached, which I easily connected to the old stiff copper wires with the included wire nuts and some electrical tape. The included screws that mount the timer to the box are Phillips heads, while the Intermatic timer came with annoying flat-head screws. The plastic knob was easy to attach, and the timer mechanism itself is easier to turn and does not make as loud a ticking noise as the Intermatic timer did.

All in all, a vastly more enjoyable experience and I am quite pleased with the results... but I did say there was one problem:

The only timers the hardware store had in stock are light almond, and I wanted white. Could you please send me a white knob and cover plate for a 60 minute timer? Let me know if you can do this, and I'll provide my mailing address.

Thank you!

Background Processes On Windows

Saturday, 11th September 2010

Sometimes Windows makes me want to kill myself.

It was a simple enough idea: I've got a task to be performed, which can take anywhere from several seconds to a minute or two. I want to activate it from a web page, and display a progress bar to the user. To make this work on the web, of course, this means the initial request has to spawn a background process and terminate, then I'll use AJAX to make subsequent calls to another script that checks on the progress, and update the progress bar every couple of seconds.

It's a little more complex than you might expect, if you're not familiar with web development. But on UNIX-based systems, it's really not that complicated. Unfortunately, I needed to do this on a Windows server.

It turns out that Windows doesn't have anything equivalent to fork(). PHP's pcntl_fork() doesn't exist on Windows. Perl's fork() is a crazy hack that uses threads to emulate pseudoprocesses, but the parent thread can't exit until the child threads are done. It's supposed to be possible to create a WScript.Shell COM object and call the Run method, but while this worked fine when I tried it from command line, I couldn't get it to work when running it from a web page. There were no error messages anywhere I could find, so I still don't know why that didn't work.

Eventually I downloaded the PsTools package from SysInternals, and was able to use psexec -d to successfully spawn a background process. Unfortunately the first time you run it, a dialog box pops up and requires you to accept a license agreement, which is a little awkward when you're trying to run it from within a web server. However, I was able to use the RunAs command (Windows' equivalent to sudo) to run psexec as the web server user and acknowledge the resulting dialog box that way.

There was just one other minor hurdle: even though I set $|=1 to explicitly disable output buffering in the Perl script that I eventually got running as a background process, it apparently still buffers output somewhere, because the file I was writing my progress to remained 0 bytes until the file was closed. I had intended to keep the file open for writing, appending to it as I went. I figured out a better way to report progress, so now I'm repeatedly opening the file, writing to it, and closing it again, but without keeping a running transcription of every last detail.

In the end, I got it working, and the resulting progress bar works perfectly. It was quite an adventure in frustration and annoyance, but now I know what to expect if I ever need to do something like this again.


E-mail me

You can send me e-mail at contact@phroggy_NOSPAM.com or use this form:

Bottom 95% of the Web This site has been rated
among the bottom 95%
of all Web sites by
Pointless Communications ®
Powered by Perl Made with MacOS Built with BBEdit
Any Browser Valid CSS! Labeled with ICRA
Green Ribbon for responsibility in free speech ΙΧΘΥΣ Fish Slackware Linux Made with Pico Lynx Friendly
[Dogcow] MADE WITH MOOF! IN MIND. [Dogcow]
Made on a Mac Boycott Microsoft
Got Linux?
Download AIMAIM RemoteSend me an Instant MessageAdd me to Your Buddy ListSend me an EmailAdd Remote to Your Page
© 2011 Phroggy, all rights reserved. All models 18 years or older. May cause drowsiness. External use only.