Sunday, December 17, 2006

Scriptaculous Effects Demo

Links to this post
I threw together a demo of Scriptaculous effects: http://ndpsoftware.com/ScriptaculousEffectsDemo.php Nothing crazy here, but I'd like a flexible and interactive demo. Send me ideas or suggestions, Andy

Saturday, May 6, 2006

Powerbook Battery Rejuve

Links to this post
My aging G4 Powerbook battery slowly died over the last month or so. It just seemed to hold a charge less and less. Last week it wouldn't go on for more than a minute or two. This weekend, unplugging the power cord was equivalent to a shutdown. After that, the battery reported "missing". It seemed like a strange progression-- not as organic, following some sort of decay curve, as I would have expected the material to behave. So I looked on the Internet to see if there were any clues. There were a set of my batteries that were recalled, but (damn), mine didn't qualify. Next, I found a thread about resetting p-ram and other such shenanigans. I was skeptical, but it seemed like there was one trick that worked for people: going into open firmware (Restart with Cmd-option-O-F pressed), and then resetting the chip that manages the battery power (reset-nvram). It was worth a try. So I did this. Wow, what a transformation. Now my battery seems to hold a charge just like it did a month or two ago. I haen't gone through extensive tests, but it's workable again. Perhaps that other dead battery will come to life... -- report from a year later -- Battery life wasn't that great for very long. It decayed to be mostly unworkable after a month or two. After a year it was down to ten minutes or so, but never as bad as before. Yeah, I've bought a new battery.

Sunday, April 9, 2006

Page layout options

Links to this post
I put together this little experiment to show the options and technique for doing different page alignment strategies: fixed width, stretch to the browser, or various hybrids you see around the web.

My question was,

can I just wrap a site in a div or two and then decide this later?

YES!

http://ndpsoftware.com/experiment/css/stretch.php

Friday, January 6, 2006

First grade first

Links to this post
Is using temporary variables was messy? I now advocate writing 1st grade code. By that I mean "See Dick run. See Jane smile." etc. Hey, we're all adults here, you say, why can't I write real code.

Well, writing really simple code makes debugging easier. What do I mean? I've had a couple occasions in the last week where debugging would have been easier if I'd writing really simple code. For example, I just got an null pointer exception here:


_dataSetsNeedingCleanup.add(new DataSetRef(state, dataSet.getId()));


I can't easily tell where the problem is coming from. It could be one or two places: my member variable _dataSetsNeedingCleanup could be null, or dataSet itself code be null. If I had written it like this,


final DataSetRef dataSetRef = new DataSetRef(state, dataSet.getId());
_dataSetsNeedingCleanup.add(dataSetRef);

a stack trace provided by the user tells me exactly what's wrong. This saves me a whole step in the debugging cycle!