Archive for April, 2006

Note to self, this is not the best way to set an element’s style

Saturday, April 29th, 2006

I love coming up with solutions on the fly. It’s fun to read the code later and see where my brain is at, under extreme pressure.

Bless this mess of CSS. :)

add(newTag('style', 'textarea{width:100%;height:100%;}'));
add(newTag('textarea', u));

Windows Active Desktop is good for something!

Monday, April 24th, 2006

My main accomplishment today was the discovery of a use for Windows Active Desktop! I managed to get it so the Bryant Park Webcam is my desktop. The desktop refreshes every 10 minutes, just like the webcam. All this required was some serious drill-down into the Display control panel:

Here are the steps to get a webcam image displayed on the desktop; and set it so the image on the desktop updates with the one on the web:

Learning to appreciate Selenium 1.0.6

Saturday, April 22nd, 2006

Earlier this month I had a problem with Selenium. This was because I was trying to test rollovers, and I didn’t realized the Selenium can only trigger rollover events when run in Internet Explorer!

Today I am setting up unit testing on the canonical e-commerce interface.

I’ve left my canonical interface rough around the edges to more accurately simulate my typical clients’ production environment. Image names are not consistent, for instance, and the data structures I use are bloated, with barely-mnemonic naming schemes. This has so far prevented me from getting a false sense of ease and thus overvonfidence when working on my own application.

So I was able to appreciate the rigor with which writing Selenium tests forced me to examine my own code. Which div has the mouseover that triggers the image switch? Are all of the image names consistent? These questions all too often don’t get answered until there’s a bug which requires their investigation.

A Selenium test can be a narrative format in which to describe the optimal functioning of an application. The test itself creates a record of the required functionality of a given application.

Overlooked technical issues in client-side Web Development

Thursday, April 20th, 2006
Rapid Prototyping
Don’t create static HTML files, ever. Use PHP or mod_perl, or even Ajax, to generate HTML comps on the fly. The same goes for “flat” HTML pages that are created prior to integration into a content management system. Even though it may seem troublesome to maintain a local installation of Apache (it isn’t!) the tradeoff in speed is worth it.
Automated Backup
Run a tape once a day and back up every workstation, fileshare, and staging server. Keep a box of 30 tapes and rotate them out so there is a month of backups. Sure its a pain and a bit OCD… but the look at the gains: the magical ability to erase mistakes and restore lost data, sometimes in seconds.

Big Web Application weekend

Wednesday, April 19th, 2006

This week I put together the largest JavaScript application I have attempted so far. It was a lot of fun to learn all the new Web 2.0 techniques. I got to try out, Rico and prototype.js. Most importantly I learned how to generate HTML using JavaScript’s ability to manipulate the DOM tree. I can see a day ahead where I don’t type any tags at all, except for maybe HEAD, SCRIPT and BODY. :)

I also designed a UI from the ground up for the first time. Nothing complicated, aespecially lthough I did create some 3d buttons, which was fun. I know a lot more about Photoshop than I thought, when I have a good tutorial in front of me.

One thing I didn’t have time to do, that would have really helped, is to learn the command set for the Selenium client-side testing suite. Although it was very easy to install, I haven’t figured out how to check rollovers with it, so it wasn’t very useful.

4.22 Rollover testing AFAIK* only works in MSIE, which is why I was having so much trouble. In fact I think I had a test that would have run, had I tried it on MSIE instead of Firefox. Yet another example of why it’s important to always test in multiple browsers.

*I read this fact on a forum whose url I can no longer remember. It is, in fact the case, as I have tested it several times (MSIE 6 vs. FF on XP SP 2).

the purposeful destruction of information is the essence of intelligent work

Tuesday, April 11th, 2006

“the purposeful destruction of information is the essence of intelligent work” –Ray Kurzweil, “the age of intelligent machines”

MediaWiki on Mac OS X 10.3/Jaguar

Thursday, April 6th, 2006

Yesterday I installed MediaWiki on Mac OS X 10.3/Jaguar. Apache is installed by default on OS X. So is PHP, but I couldn’t get it to run. So I wound up installing binaries of PHP and MySQL.

I learned a lot, but maybe the most important thing was that on OS X, starting PHP tags must have the form:


Otherwise the code does not run. I saw quite a few confused netizens asking why their scripts suddenly didn’t run when tried on OS X.

It took a couple of tries to get the MediaWiki first-time-configuration script to run. It kept asking me for a root password, in order to set up a new MySQL account. It took me a few tries to realize this was my MySQL password, not the BSD root user’s password.

I didn’t expect to need to configure the DNS. I just had an IP address, no hostname. When I put in the direct ip of my machine, fine. As soon as I switched to a subdirectory, 404. It was the UseCanonicalName directive in the httpd.conf file. Once I set that to off, everything was fine.