« March 2006 | Main | May 2006 »

April 30, 2006

links for 2006-04-30

April 29, 2006

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

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));

links for 2006-04-29

April 28, 2006

links for 2006-04-28

April 27, 2006

links for 2006-04-27

April 26, 2006

links for 2006-04-26

April 25, 2006

links for 2006-04-25

April 24, 2006

Windows Active Desktop is good for something!

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:

  1. Right click on any blank area of the desktop, and choose Properties from the context menu
  2. Click on the Desktop tab
  3. Click on the Customize Desktop button
  4. Click on the Web tab
  5. Click on the New button
  6. Enter the url of your preferred webcam
  7. Click on the Properties button
  8. Click on the Schedule tab
  9. Click on the Add button
  10. Give your task a name. Ignore the hours/minutes boxes as we'll set the time later
  11. Click the OK button
  12. Click on the Edit button
  13. Click on the Schedule tab
  14. Set the Start Time for 12:01AM
  15. Click on the Advanced button
  16. Check the Repeat Task checkbox
  17. Enter the interval you want your desktop to refresh, in minutes; Keep in mind that refreshing more than once an hour will get annoying very fast.
  18. Set the Duration to 24 Hours
  19. Click OK
  20. Check the Show Multiple Schedules checkbox
  21. Click the New button
  22. Change Schedule Task to "At System Startup"
  23. Click OK twice
  24. Select the "Lock Desktop Items" checkbox
  25. Click OK twice

NOTE: To get the desktop to look exactly how you want, it may be necessary to move or resize the "live content." Just go back uncheck the Lock Desktop Items checkbox.

These instructions have been tested on a Windows NT/XP box and on a recent installation of Windows XP SP2. But this procedure is not recommended. Ever. It's something cool that can be done with Windows, but it will slow down your general operating speed; and likely it will occasionally crash certain processor intensive programs, such as video games.

links for 2006-04-24

April 23, 2006

links for 2006-04-23

April 22, 2006

Learning to appreciate Selenium 1.0.6

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.

links for 2006-04-22

April 21, 2006

links for 2006-04-21

April 20, 2006

Overlooked technical issues in client-side Web Development

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.

links for 2006-04-20

April 19, 2006

Big Web Application weekend

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 script.aculo.us, 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 1.5.0.1 on XP SP 2).

links for 2006-04-19

April 18, 2006

links for 2006-04-18

April 17, 2006

links for 2006-04-17

April 16, 2006

links for 2006-04-16

April 15, 2006

links for 2006-04-15

April 14, 2006

links for 2006-04-14

April 13, 2006

links for 2006-04-13

April 12, 2006

links for 2006-04-12

April 11, 2006

the purposeful destruction of information is the essence of intelligent work

"the purposeful destruction of information is the essence of intelligent work" --Ray Kurzweil, "the age of intelligent machines"

links for 2006-04-11

April 10, 2006

links for 2006-04-10

April 09, 2006

links for 2006-04-09

April 08, 2006

links for 2006-04-08

April 07, 2006

links for 2006-04-07

April 06, 2006

MediaWiki on Mac OS X 10.3/Jaguar

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:

<?php
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.

I learned that on OS X the default directory where Apache serves files is:

/Library/Webserver/Documents/

On OS X, su doesn't get the superuser account. THe command to use is sudo.
sudo bash
opens up a new shell as root.

To start and stop Apache, I used the Sharing control panel (Apple Menu > System Preferences > Sharing) Apache is called Personal Web Sharing and there's a big, shiny button that turns it on and off.
httpd.conf iss located by default in:

/etc/httpd/httpd.conf

Apache's environment variables are displayed by the command:
httpd -V

links for 2006-04-06

April 05, 2006

links for 2006-04-05

April 04, 2006

links for 2006-04-04

April 03, 2006

Asking if something will be ready for deadline

How about a single word that means "is it really going to be ready by the deadline?"

Example:
"I've just finished the spec for a new all-seeing widget engine that's going to be integrated into all our products!"
"Sounds great but, _________."

links for 2006-04-03

April 01, 2006

links for 2006-04-02