Chilly in Dallas

My goodness Scott Roman keeps his house as cold as I used to keep the classroom. I woke up this morning to the thought that “Gee, it’s cold,” and just dealt with it for a while, however eventually the air constantly blowing became too much and I got up to look at the thermostat to see where it was. It was set at 60, which I’ve seen before but what surprised me was that the temperature actually was 60 degrees. Insane. It’s woken me up though.

Blogging the Milt Friedman Conference

I knew I kept the economics category around for a good reason. Tonight through Friday I’m going to be in Dallas because I was invited to the “Legacy of Milton and Rose Friedman’s Free to Choose” conference here at the Dallas Federal Reserve Bank. Internet access during the conference is probably not going to happen, as it’s unlikely I’ll be able catch anything wireless or just plug into the wall somewhere, so I can’t promise live-blogging of the sessions, but I can pick up a few access points here where I’m staying so I’ll try to catch up every night. I’m very excited about the oppurtunity to meet Milton Friedman, who was very influential in my early studies. His influence is undeniable, and I’m honored to be here.

The drive was long but in good company with my old friend Iram in the passenger seat. We discussed a lot of current issues, Plato’s Republic which she is also studying, and how our economic viewpoints have changed in the two years since we won the Houston and district-level Fed Challenge competition. I dropped her and her mother at their relative’s house, and made my way back by the Bank where Scott Roman, my former teacher/coach and now head of education for the Dallas Fed, lives and also where I’m crashing. It was a little tricky getting here, but now that I am the exhastion from the drive is starting to catch up with me and I think it’s time for some sleep. Breakfast at 9 tomorrow. Planning to take lots of pictures.

Automatic Paragraph Function Turns 1

Has it really been over a year? I can’t believe it.

An unassuming little script, called “autop” and titled New Lines to Paragraphs was one of my earliest attempts at massaging plain text into smart XHTML, and it has come a very long way since it first started. (See the legacy code.) The code is not perfect, and it may never be, but it has worked very well for an impressive number of people, and I value that.

The code has been improved significantly in the past few months as part of the WordPress codebase, and I’ve updated the code homepage to reflect these improvements. Cheers.

Apple In My Eye

So your Author would be a terrible blogger if he didn’t point out that iTunes is now available for Windows. It was immediately installed, requiring a reboot (the box had not been rebooted for 32 days), and preceded to crash consistently on a seemingly random set of files. It works swimmingly with about 95% of the files, but certain albums, when played or imported, crash iTunes every single time. Winamp, Windows Media Player, and every other media player installed works fine with said files. That said, one is very impressed with many of the features and how consistent it seems with the Mac version. Except the feature where it moves files out of their meticulously chosen folder hierarchy and renames them, losing track information in the process. Every feature but that one. Yes, it is an option, however the option does not communicate the weight it carries.

Ironically, today is also the day one decided to never by a Mac because one’s PCs were significantly cheaper and of comprable quality, the Windows OS is sufficently stable, and because of the beautiful things Michael Heilemann was able to do with Windows. (Not to mention the wonderful things he does with WordPress.) Something similar will be attempted here as soon as time permits. One program, Windows FX, was bought months ago as a result of its attractive functionality.

Update: I just saw this quote and thought it was worth including:

“We’re going to fight illegal downloading by competing with it,” said Jobs. “We’re not going to sue it. We’re not going to ignore it. We’re going to compete with it.”

—Steve Jobs. No wonder people love this guy. Hat tip: Wired.

Update: Something similar, but much worse happened to Adam.

Web Design on a Shoestring

Carrie Bickner, whom I had the pleasure of meeting at SxSW and have done my best to keep in touch with since, has a new book out, Web Design on a Shoestring. She has told me before that I’m not really the target audience for such a book, but it is certainly something I would like to read, review, and recommend. It seems every day I talk to another client who was paying 4-5 times what they should for hosting and spent a fortune on a site whose non-standard code made it obsolescent the day it was delivered. The days of monolithic development by giant agencies with even bigger budgets are over. Carrie’s book is indicative of the new era coming. I’ve ordered my copy.

Web Design on a Shoestring by Carrie Bickner

RSS Requests and Browsers

Out of curiousity I ran some stats on the different RSS versions I offer here. The results were pretty much what I expected:

  1. 47 % — RSS 2
  2. 39% — RSS .92
  3. 14% — RDF 1.0

Also as an update to a previous look, I don’t know what it was about Mozilla that month (August). Here’s what is happening currently:

  1. 38% — Internet Explorer
  2. 36% — Netscape/Mozilla
  3. 6% — Googlebot
  4. 3% — Safari

That’s pretty much on par for the course. One interesting note is that IE6 users seem to spend the most time on the site, for whatever that’s worth. As before, let me know how these things stack up in your neck of the woods.

Wildcard DNS and Sub Domains

What follows is what I consider to be best practice for my personal sites and a guide for those who wish to do the same. Months ago I dropped the www. prefix from my domain in part because I think it’s redundant and also because I wanted to experiment with how Google treated valid HTTP redirect codes. The experiment has been a great success. Google seems to fully respect 301 Permanent Redirects and the change has taken my previously split PageRank has been combined and now I am at 7. There are other factors that have contributed to this, of course, and people still continue to link to my site and posts with a www. (or worse) in front of it, but overall it just feels so much cleaner to have one URI for one resource, all the time. I’m sure that’s the wrong way to say that, but the feeling is there nonetheless.

Now for the meat. What’s a good way to do this? Let’s look at our goals:

  • No links should break.
  • Visitors should be redirected using a permanent redirect, HTTP code 301, meaning that the address bar should update and intelligent user agents may change a stored URI
  • It should be transparent to the user.
  • It should also work for mistyped “sub domains” such as ww. or wwww. (I still get hits from Carrie’s bad link)

So we need a little magic in DNS and in our web server. In my case these are Bind and Apache. I am writing about this because at some point the code I put in to catch any subdomain stopped working and while I reimplemented it I decided to write about what I was doing. This method also works with virtual hosts on shared IPs where my previous method did not.

In Bind you need to set up a wildcard entry to catch anything that a misguided user or bad typist might enter in front of your domain name. Just like when searching or using regular expressions you use an asterisk (or splat) to match any number of any characters the same thing applies in Bind. So at the end of my zone DB file (/var/named/photomatt.net.db) I added the following line:

*.photomatt.net. 14400 IN A 64.246.62.114

Note the period after my domain. The IP is my shared IP address. That’s all you need, now restart bind. (For me /etc/init.d/named restart.)

Now you need to set up Apache to respond to requests on any hostname under photomatt.net. Before I just used the convinence of having a dedicated IP for this site and having the redirect VirtualHost entry occur first in my httpd.conf file. That works, but I have a better solution now. So we want to tell Apache to respond to any request on any subdomain (that does not already have an existing subdomain entry) and redirect it to photomatt.net. Here’s what I have:

<VirtualHost 64.246.62.114>
DocumentRoot /home/photomat/public_html
BytesLog domlogs/photomatt.net-bytes_log
ServerAlias *.photomatt.net
ServerName www.photomatt.net
CustomLog domlogs/photomatt.net combined
RedirectMatch 301 (.*) http://photomatt.net$1
</VirtualHost>

The two magic lines are the ServerAlias directive which is self explanitory and the RedirectMatch line which redirects all requests to photomatt.net in a permanent manner.

There is a catch though. The redirecting VirtualHost entry must come after any valid subdomain VirtualHost entries you may have, for example I have one for cvs.photomatt.net and I had to move that entry up in the httpd.conf because Apache just moves down that file and uses the first one it comes to that matches, so the wildcard should be last.

That is it, I’m open to comments and suggestions for improvement.

Beginning On PhotoStack

It’s an entirely pleasant, rainy day, so I thought it would be a wonderful time to get going with Noel’s PhotoStack. I grabbed the latest version available and uploaded it to the server.

Trying to be as true as to I would actually use a program like this, I didn’t read any of the documentation. Plus there’s a readme file, but it has no extension so opening it means no less than three or four dialogs in Windows XP. A .txt extension wouldn’t hurt anybody. It gave me a message that the storage directory wasn’t set up properly, which told me that I probably need to edit a configuration file of some sort. So I fire up SSH. A ls -lah (which I have aliased as ll) shows a config.php, which I guess is what I’m looking for.

I fire up the one true editor. There seems to be a little more at the top than necessary and it doesn’t say much, but that’s a personal peeve. The varible names seem logical (some camelCase going on) but the descriptions above each is not always helpful. Mostly it’s just $photosName. I’ve never used the program before, and the description “The name of your Photos section.” makes sense to me as an English sentence but I don’t quite grok its significance.

Next up is the path information, which could possibly be streamlined. First we have $dirRoot where PhotoStack seems to want the absolute path to the script. It recommends “$_SERVER[‘DOCUMENT_ROOT’].’/photos’ may work for you.” but even though that makes perfect sense I’ve dealt a lot with this in WordPress. More people have messed up DOCUMENT_ROOTs than you could ever imagine, there are a few other solutions that may be better. One I’ve had good success with is dirname(__FILE__). which works like a charm for finding the absolute path of the current directory. realpath() may also be helpful, but we use the first trick in WordPress. The next variable is the URI of where PhotoStack is located, with the instruction “no trailing slash.” This is another pet peeve, but an instruction like this should be avoided at all costs. No trailing slash there, should I have a trailing slash on $dirRoot? It didn’t say anything. It causes confusion. It’s programatically trivial to detect and remove a trailing slash on this variable, so why even bother the user? Don’t make me think.

There are a lot more configuration options, a lot. It suggests replacing “no” with “yes” or vice versa to change the value. While this is probably more intuitive than boolean values of true or false, I think spelling out “yes” or “no” several times is a little patronizing. I know, impossible to please.

Okay so I’m done with the configuration file, I reload the URI. Still doesn’t work! I’m guessing it’s time to go to the readme, probably the storage directory needs to have permissions set or something. There is no wrapping in the file, which means each paragraph stretches really far and to read it I’ll have to scroll horizontally in my editor. Wrapping at 72 characters would probably not be a bad idea. Fortunately I know a shortcut (ctrl + j) to fix this but that’s just luck. I find out the software is licensed under the Creative Commons Attribution-NoDerivs-NonCommercial license, which I suppose means I can never use this for a paying client and if I want to improve on the code and release the changes without explicit permission from Noel. If Noel fell off a cliff I suppose the code would be locked under the license and development would halt? I don’t know exactly, but that’s what goes through my mind. Generally I’m much more comfortable with more liberal licenses, be it MIT or GPL or Artistic or anything Free. Next it says:

Templates in PhotoStack are not licensed as part of PhotoStack. Therefore, they are not subject to the licensing terms of PhotoStack. I’m placing this decision in the realm of Mr. Allen… If anyone can lend some clarification that would be great.

That doesn’t inspire the greatest confidence, but I’m planning to modify the templates anyway so maybe I should worry. Finally at the end it tells me to chmod 777 the storage directory. Ah, what I needed to know. I have heard some peopl ecomplain about the liberal chmod requirement before, but it’s really only necessary because of the way most web servers are set up to execute PHP, which I suppose could change in the future. It’s no problem to me. I secure things at a much lower level.

I’m already at the command line so it’s a simple matter to modify the directory. No errors but the pictures don’t load. Whoops, I missed setting $webDir variable, probably because I was planning to talk about it but went off on a tangent. The default value of this is “http://yoursite.com/photos”, and this is splitting hairs but there are several domains expressly for this purpose and an RFC to back them up. It’s a good practice because since yoursite.com isn’t reserved, it could theorectically be taken by some unsavory character that used its ubiquity in examples in some malicious fashion. You never know.

It loads! However I click on the sample album and there’s something funky going on with the layout. Perhaps it has something to do with the size I set my thumbnails at (150×150, though I would like to just be able to say something like 150 px on its longest side and allow it to keep its proportion, or just 150 px wide all the time. I’m not crazy about every thumbnail being square). What ever it is it will have to wait until tomorrow because it is past my bedtime. Hopefully tomorrow I can start loading this thing up with photos.

“Matthew! How could you possibly be so nitpicky with this poor guy’s project? How would you like that if someone did that to your project?” Actually, I would be thankful and flattered. If I didn’t like Noel and think PhotoStack could be great I wouldn’t be spending time documenting my thoughts on it. Constructive feedback is golden to an open-minded developer.

Fray Day 7

I'll be at Fray Day 7I’m going to participating in Fray Day 7 here in Houston tonight at 8 PM. I’m a “featured speaker” tonight and I’m going to be telling a story I call “The Little Red Button That Changed My Life.” Several friends have already expressed an interest in coming and I’m looking forward to seeing everyone. It should be a lot of fun for everyone involved. I know Robert Nagle has worked very hard in putting all this together, my Dad told me he heard the event mentioned on the radio Friday morning.

To be honest though I’m scared to death.

Where? The Nexus Cafe (Walden Internet Village) is located on 2828 Rogerdale, 2nd floor (between Richmond and Westheimer).

Two Great Shows

Radiohead was really exciting. The Chronicle has a review, but like most stories there it’s painful to read and I doubt that link will last as long as this entry is on my front page. Our seats were on the lawn and we were a bit to the left and back. We had a good clear view of the stage but couldn’t see too many details, though certainly everything came through. I would have liked te been closer to see how some of the effects were done, but maybe next time. They went through old and new songs, starting with some of the latest ones from Hail to the Thief and moving forward. There were a few flubs, such as Yorke skipping a section on 2 + 2 = 5 one or two other minor things that I doubt too many people noticed. My only complaint would be that with several songs they would end with a solo usually from the guitarist on the right (I can’t think of his name at the moment) but you could tell it was the end of the song and the energy was dying around him as he was trying to build up his solo. It would of been nice if they took a cue from jazz and went from a solo back into the melody or some sort of chorus to end the tune and keep the energy up.

The Lincoln Center Jazz Orchestra at Jone’s Hall last night was one of those musical experiences that will stay indelibly burned in my memory for a long time. I had been looking for tickets and the day before my uncle called asking if I’d like to go with him, row B right in the center. Close enough to hear the musician’s sounds and not just the amplification, I was blown away. Every soloist and every piece was top-notch. The highlight of the evening, besides of course Houston native and HSPVA grad Andre Hayward’s music, was Eric Lewis’ piano. I have never heard of this man before, nor can I find anything on the web. Throughout the concert whenever Wynton introduced him he prefaced his name with what sounded like “Top Professor” which I’m sure means something, but I’m not sure what. Lewis’ solo on A Love Supreme’s Resolution was so intense and captivating that I was completely taken away by it in a way that music effects you only a few times in your life. The personnel of the group was different in several regards from the program, but that’s to be expected with the dynamics of a touring group and the fact that the programs are printed months before. If you have a chance to check out the Lincoln Center Jazz Orchestra, do so. Highly recommended.

Ongoing

I usually write entries in my head before I put my fingers to the keyboard. The problem with this is that the longer I go between entries, the more that I try to cram into my mental post and inevitably the more that’s lost.

When you last left your Author he was gearing up for the second night of the Kemah Jazz Festival. It was fantastic, as expected, and he had good fun with the company. Tim Hagans made a guest appearance on Woody Witt’s set and it was the highlight of the night. Ended up leaving a little bit early due to tiredness, and slept well.

Saturday started with leftover pizza from Star Pizza, which, in hindsight, was most likely bad. Your Author was very, very hungry and ignored the fact that it tasted a little funny (it was vegetarian “gourmet” pizza anyway) and he was already on the way to rehearsal. By the end of the dress rehearsal with Steve Fulton things were queasy. But not too queasy to miss Kathy and Christine‘s birthday party that night, to which he was accompanied by Elissa. Too queasy to eat much there save a taste of really nice meat stick from Coffee “BBQ” Mike and a slice of cake, both of which were sorely regretted later.

Saturday night and Sunday morning were very harsh, and will not be discussed. Many thanks to my angel of a mother who helped smooth things over.

Sunday the Author was still sick, but knew he couldn’t miss the gig at Kemah, so went and played anyway. It went well, and many thanks to those such as Cody, Elissa, Greg, Sarah, and the others that attended. Food was still a bad idea though, and the trip had an early end. That night the fever came back strong and not much sleep was had.

Monday was a day of recovery. Tuesday was a return to normal affairs and catching up with things.

Which brings us to today. Things are very busy with many projects, but that’s par for the course. Tonight is the Radiohead concert which I’ve been looking forward to for months it seems. The weather is gorgeous. Can’t wait.