What I Learnt Last Week

Wednesday, March 12, 2003

How big is that image?

This morning, I saw an email on the Australia Java Users Group mailing list asking if anyone knew of any tools to determine the size of a GIF/JPG image.

This sparked my curiosity a little. It turns out that it doesn't take too much to get this info directly from the file.

I'm not sure who actually devised these file formats, but I can say that it was much easier to understand (with the specs that I found) the GIF format, than it was the JPG format. I do know that the EG in JPEG stands for Expert Group. It is no suprise to me that the spec is difficult to understand. I often find that groups do a worse job of developing/documenting technology than a single company or person.

I wonder if the www would have ever got off the ground if Tim Berners-Lee had to work with a committee of others.

Wednesday, March 05, 2003

I love mathematics

Last night I was talking to my father-in-law about the hot water in our shower. Natalie's (my wife) parents are staying with us for a few nights and I told Dad that he should help himself to use the shower. I followed that by saying 'It takes a little while for the hot water to come through though'. Then I told him what I like to do while I'm waiting for the hot water to come through.

I like to set up a few estimates on either:

  • water flow rate

  • length of pipe from shower head to hot water system

  • diameter of piping

  • time until water becomes hot, etc


Then, I either deduce the final variable from my estimates of all the rest, or just see if all my estimates are consistent.

My estimates were that the water flow rate would be about 5 litres per minute. It usually takes about 30 secs for the water to get hot. The pipes would be about 20mm in diameter. The length of pipe from the hot water system to the shower head would be about 30m. When I did the sums, I found that I was fairly close.

This reminds me of one of Edsgar Dijkstra's papers that I read the other month about doing some mental arithmetic. I tried his challenge, but found it too difficult. I guess the water in my shower always gets hot before I'm able to solve the challenge.