Potential Differences

Fri, 11 Apr 2003

DHTML Fun

As I mentioned earlier I’m using this site and two others as an excuse to update my web authoring skills. At work I was also asked to do what initially seemed to be a simple task, but ended up not so simple. There’s a table of data with alternating row background colors to help legibility. Based upon what a user selects from a select list on the page we want to highlight a particular column of the table by changing its background color.

So, I quickly learned about the new col tag table child, as well as the document.getElementById javascript method. However, a straightforward col.style.backgroundColor = x call didn’t work. After some research I discovered that row backgrounds are drawn on top of column backgrounds. It was time I enter hack mode.

I ended up dynamically creating a “shadow” table absolutely z-positioned behind the primary one, matching it’s position, size, and number of rows. The shadow table’s rows had background colors. The primary table’s background colors were all transparent, so that when I set a column’s background color, it was visible. Problem solved.

I think a lot of developers look down upon doing javascript and html work (and GUI work in general) and that’s really a shame. Elegant code and ingenious solutions can be found in the user interface arena.

potential differences [/dhtml] permalink

OS X as a Postscript RIP

A couple of weekends ago, my old printer died just as my wife was working on taxes. She still hasn’t made the leap to OS X, so I had to get the new HP 5550 printer working from her desktop — quickly. The printer is attached to my SMC Barricade wifi router. Well, it ends up OS 9 can do IP printing, but it assumes the printer understands postscript, which mine doesn’t. I knew the CUPS framework could handle the rasterizing of postscript to the HP, so I just had to figure out how to do it from the OS 9 machine.

I had already discovered linuxprinting.org when I first setup the TiBook to print to the HP. Gimp-print gets a lot of press, but for HPs, I recommend hpijs. Another section of that site offers PPD-o-matic which allows the OS 9 machine to set various aspects of the printing through it’s normal IP printing infrastructure, even though it’s really an inkjet it’s printing to.

My last piece of the puzzle was to find an article at macosxhints.com to setup an lpd daemon on the OS X box. So, with some trepidation I pointed the OS 9 machine to print to the TiBook. I pictured OS 9 converting to postscript, spooling it out over ethernet to the router, which sent it over wifi to the TiBook, which then rasterized the postscript, and spooled it over wifi back to the router, which dumped it to the printer. Nothin’ but net! My jaw dropped when it worked flawlessly the first time I tried it. I love OS X!

Note that this solution would work with any printer that OS X can print to, and from any client that can talk to a networked printer, and it’s free. Did I mention I love OS X?

potential differences [/mac] permalink