Monthly Archives: May 2003

A Better Image Rotator

The Hiveware Image Rotator, shared by Mr Zeldman, does one thing and does it fairly well: it shows a random image on each reload. However, the approach the script takes is slightly flawed, and could be improved as detailed below.

My first issue with the script is that it is really only set up to handle two types of files, GIF and JPEG, and then only with the file extensions of .gif or .jpg, so something like .jpeg (fairly common) would not be included. Not to mention the noble PNG is left out entirely. Fixing this, however, leads us to a more fundamental problem: the images are served through the script. This means that the script has to handle the content-type header, something that is messy to do. A better method, I propose, is for the script to merely serve a temporary redirect header, which sends the browser with a minimum of overhead to the actual location of the file, which has a number of tangential benefits including that it allows the image itself to be cached properly, either by a caching server or the browser itself, and it delegates content negotiation and such to the web server, which is most likely infinitely better at it.

So now what we have a script which reads files in a directory, grabs the ones with a user defined set of file extensions, and sends a simple Location header to whichever file is randomly chosen. The complication now that the location of the image is now important in terms of the web server document root. One bonus of Dan Benjamin’s method is you can use images outside of the web root, though I don’t know why anyone would want to do this. The script could ask for two variables to be defined, the absolute path to the images and the path to the images through the web server, but I would like for this to be as ridiculously easy to setup as possible. Another option would be to subtract the $DOCUMENT_ROOT variable from the absolute path given and use that, but that would require people to know the absolute path of the directory they’re using, and like I said I’d like this to be easy as humanly possible. The best solution is to use a relative path; if the users enters nothing it’s assumed that the images are in the same directory as the script but if they aren’t the path can be entered in a relative manner, like “images/random” or “../rand-img”. Easy peasy.

Finally, instead of the plain rand() we’ll use mt_rand, which is about four times faster and slightly more random. What do you get? The Photo Matt Random Image Script. I’ve tested it thoroughly, but if you have any problems don’t hesitate to let me know. It’s just standard HTTP though so I don’t foresee any trouble. Something neat about this is that with the code we just wrote, you can also serve random anything—from zip files to MP3s—just by changing the extension line. Enjoy! Here’s an example of it in action, you should recognize some of the images as the delightful graphics Jeffrey has been putting up, the rest are snips of photographs I haven’t uploaded yet.

A Random Image

Keeping the Faith

If you’re like me, you’ve been very concerned about the direction XHTML 2 has been heading. Very recently I’ve thought to myself that I won’t develop a commercial XHTML 2 site this decade. (Look how long it took them to get simple stuff right!) Only time will tell, but Tantek’s XHTML Considered Hopeful brings back that warm fuzzy feeling that promising new technologies give. Yes, it was going in a bad direction. Yes, it’s coming back.

I’ve lurked on www-html for several months now, maybe it’s time (and I finally have the time) to start seriously reading working draft and lend my voice to the process. That’s assuming of course I have anything cogent to say. I think the lesson to be learned here is if you’re concerned with where the spec is heading, let people know. As Tek says, they’re listening.

(My personal favorite new element so far? Gotta be <l>. Lots of possibilities there.)

All Done

Free at last, free at last. I took my last final and now I am done with school for at least a couple of months. Now it’s time to dive back into projects I have been neglecting due to school. I have been very much looking forward to this summer.

Who Ya Going to Call?

From a trusted correspondent, talking with a contact who works at the Netscape part of AOL/Time Warner. “He said they had decided that weblogs are the next killer app, and that most of the work at the Mountain View office was going into building a weblog component for AOL. He also mentioned that about 400 people are working on that software. This is in constrast to about 20 who are working on Mozilla.” […] If there’s a problem doing this, please contact me, in confidence, if necessary.

Source. Three comments:

  1. I know Dave isn’t crazy about CSS and all that jazz, but could he at least use paragraph tags? Nothing by line breaks is so… never. Paragraphs have been around forever, no reason not to use them.
  2. 400 people working on it, assuming that even only 10% are actual developers (is this high?) I find it hard to believe that those 40 people will come upon a technical problem so insurmountable that only help from Dave, in confidence, if necessary, will help them.
  3. It also follows that if Microsoft and AOL/Netscape’s respective blogging tools or platforms don’t interoperate, I don’t think it will be because either lacks the technical skill to do so.

This is all pure speculation on my part, and I’m not afraid to admit it. I’m trying to think what kind of effect this could have on the blog world. There are already services out there such as Diaryland, Blogspot, Free Opendiary, Livejournal, Deadjournal, and Easyjournal that make the technical and financial barriers to something akin to blogging nonexistent. I know several people from my old school that might be hard pressed to send an email attachment but used one of the above tools with a degree of proficiency. What’s more these services, particularly OpenDiary and LiveJournal, tend to be very closed communities and don’t mingle much with blogs outside their service. So I think these new services in and of themselves will not be a big deal, however if they hook people on the concept and get them running for more advanced tools, then it could be significant. We’ll see.

L’Auberge Espagnole and X-Men 2

Thanks to a Craig’s List posting I got in at the last minute to see L’Auberge Espagno with Josh. I was excited that Audrey Tatou of Amélie fame would be in it, but like the posting said her role was relatively minor. Overall I enjoyed the film a lot, it had some really novel things in it and some great moments. The characters fluency with so many languages made me wish for a similar fluency in at least one other language.

Last Friday I saw X-Men 2, I just forgot to post about it. I went in with very low expectations as I thought the first movie was really mediocre. This was about a thousand times better. If you’re in to that sort of thing, go check it out. It was also neat because it was the first movie I’d seen in months.

It feels strange talking about to movies from very different genres right next to each other, they were both good, but in very different ways. Of course movies will never be the same when the new Matrix comes out in 9 days. Is it over-hyped? Not at all.


Today has been a wonderful day feeling with code goodness. I don’t know why, but I really, really, really like playing around with XHTML. I find I enjoy programming in other languages (mostly PHP, but Python and Perl more now than before) most when it deals directly with XHTML. Anyway, I’m working on some really fun stuff and by this afternoon this site should be even more on the bleeding edge than it was before. Stay tuned.

Call Me Speedy

Well the 512MB of DDR333 memory I ordered came in today, and so now I’m up to 768MB, which is quite nice. I feel like my applications can breath again. Even more importantly I upgraded the 900MHz processor that was in there on accident to a Athlon XP 1600, and it’s making a huge difference. My desktop is starting to feel like a real work environment again.

In other news, we’re going on 3 weeks since they took my laptop, and it’s really starting to get to me. I really could have used it to keep up with things these last few weeks, which incidentally have been my busiest in a long, long time. I had my next to last final today, and I was really ecstatic afterward. Knowing there is just one more (on Thursday) is a great feeling, and I can’t wait for summer to finally get started.

It’s going to be a summer of road trips, beaches, tans, jogging, and some very cool web stuff.

Another Brand Spanking New Blog

It’s not Sunday anymore, but if you’ve still got nothing to do you should know that idle hands are the devil’s workshop, so by visiting, the new home of Adam, you’ll be doing a good thing. It seems that splitting blogs into public and personal is all the rage these days; I know Josh has one coming soon and I’ve been considering spinning something off PhotoMatt for a while. Oh just a side note, both of Adam’s domains are now with Spyder Hosting and rumor has it he’s enjoying it.

Blogroll Updated

The blogroll on the menu has been seperated into Pingers and Non-Pingers. People under “Updated” ping when they update and float to the top of the list, which I check umpteen times a day. Those on the other list ping very inconsistently, or not at all, so I just check them every now and then to see if anything new is going on. If you’re on one list and think you should be on the other, let me know because there’s probably a problem with the URL I have for you not matching whatever you ping with. I also came up with a much, much simpler way to parse blogrolling lists into semantic lists, and I’ll update the script and article accordingly later this week when I have more time.

Waiting For Fries to Catch Up

As I write this I am eating “Cool Guacamole” chips. Yes, chips flavored with guacamole. This is not the first time I’ve encountered this, as I had some tostada chips that were almost just like this before. Does anyone else find this trend of rolling common condiments into what they’re used with disturbing? Before we know it we’ll have ketchup-flavored French freedom fries, milk-flavored cookies, and, God forbid, pre-mixed peanut butter and jelly. Oh wait…

Author, Designer, Troublemaker, Person, Musician

If you’re having a lazy Sunday I would highly recommend you go check out the two songs Derek has posted. I have to admit that before I clicked on the first one, my expectations were low. Not as any sort of statement on the musicianship of other web music I’ve heard before, but just that I am not a big fan of a genre sometimes described as urban acoustic pop, or guitar/vocal folk music. But something about Derek’s music really struck me, especially the lyrics on the first one. Enjoy.

Danger Tom and Jerry

According to a dilalog box that just popped up, the batteries in my mouse are dangerously low. Yes, my friends, they could go any second. It’s just a matter of time. I truly hope that I can click the submit button on this post before it’s too late.

But really, sometimes I think error message writers have an overly high opinion of their task’s importance. I guess it puts things in perspective though.

Being In Katie’s Dream

Katie—one of the first people to ever link to this site, who I met at a H-Town gathering months ago, and who I was lucky enough to spend some time with at SxSW, but who unfortunately I haven’t seen in a while—had a dream in which Jane and I were in a fight and everyone there (including Christine) won’t talk to each other except through their blogs. (I bet the trackbacks were flying.) We’re mere feet away from each other, but no one speaks a word. (A situation not unlike some HWUG meetings.) I know how even the most bizarre dreams can sometimes echo in real life, so to avoid any distress, a public apology is in order.

Jane, you seemed like a perfectly nice person when we met so if we’re fighting it’s probably because of something stupid I did, which is not at all unheard of. I am sincerely sorry for my actions and I hope you can find it in your heart to forgive and forget. Hope to see you again next year at SxSW. —Matt

Blogshares Etiquette

Is it just me or is there an entire social structure evolving around Blogshares? Links go back and forth, and every blog is given a quantative value. Gifts are given, but for what reason? Is anything truly altruistic? What’s polite? Are there vested financial interests involved? As if the social world of blogs wasn’t delicate enough.

Anyway, my dilemma is two friends I own stock in have gotten dangerously high price to earning ratios. I bought stock in them as sort of a token of my appreciation, a way of saying “Hey buddy.” Because when you buy stock in somebody, you are essentially making a value statement about that person or blog. If you think someone is smart/funny/sexy/interesting then logically that person’s audience and linkage will grow, it’s just a matter of being discovered.

Ideally I would have stock in every person on my blogroll, and I would buy it and hold it, and buy more whenever I had the means to. However, that’s a terrible way to make any money on Blogshares, so I don’t know. I’m going to have to decide whether I’m playing socially or if I’m in it for the money.

Spirit Refill

I had a very artistic night, which I can only describe as spiritually refilling. It started at the first of two senior recitals of the night. It was by Joe Santa Maria and it was really great. The selection of tunes was very diverse (Beatrice was beautiful) and his tone sounded great. Directly following was Kyle Wilson’s recital which was just as excellent. He did a lot of technically challenging songs (Last Rites of Rock ’n Roll, Snake Charmer, What Goes Around) but played them with soul. Both will be online as soon as I get them and maybe it’ll motivate me to finally do something with, which I haven’t touched in about a year now. (While it’s visually lacking, there’s some pretty neat stuff going on behind the scenes. All the song lists and extra files are generated dynamically from the filesystem, reading the metadata from the ID3 tags.)

The reception immediately followed, but I had promised Elissa-who-is-not-linked that I would check her art performance at the Contemporary Arts Museum. So I rushed over there and got there just in time to catch hers. It would be extremely difficult to describe, but it involved a wooden chair, a black dress, panty hose, and Elissa cutting her hair. We talked about it earlier and Elissa didn’t know how long it was going to be, she was just would cut it however long felt right. For a few excruciating seconds she paused before making the first cut, and I really thought she wasn’t going to do it, and I don’t think I could have. (And I don’t even have that much hair!) I didn’t have any idea what performance art was going in, but now I think I have a better sense of it. There were no words, but something about the situation and the way in which the action was carried out really spoke to me and affected me emotionally, just like a good piece of art. It’s something that has to be experienced, because it loses everything in the description.

The joint reception for the recitals was at Molina’s, a great Mexican restaurant. The food hit the spot and I got to socialize with a number of folks I hadn’t seen in a while, some as long as two years. Kyle, along with Chase Jordan and Marcos Varella whose recitals I attended earlier this week and were great, are going to be attending the New School, all on generous scholarships. Joe is going to join Rene at Berklee College of Music. So many great players are coming out of HSPVA, I think it’ll just be a few years before the jazz record scene starts to take notice.

After the reception I just couldn’t go home, perhaps because of the paper due tomorrow, so I headed over to the Rivendell to hear the Stan Killian Trio with Clayton Dyess and Maggie Grebowicz. Met some nice people and heard some swinging music, plus there was no cover, so it was a very enjoyable performance and I stayed to the very end. Definitely going to check them out again.

Once I got home I did what anyone would do after such an inspiring night: practice!