Gold Plated Blog Posts
Whatev.
Sunday, October 28, 2007

Steamrolling Ducks

I hear people now and then talk about moments in history where everyone "remembers where they were when they heard the news". Well, I haven't been around for a lot of really huge moments in history; Obviously I remember 9/11, I have vague memories of the Berlin Wall coming down, and I remember right where I was when Kenny Wheaton picked off Damon Huard and ran it back for a touchdown to win the game and ultimately make it possible for the Ducks to go to the 1994 Rose Bowl. It was my earliest Ducks memory and I still get chills whenever I hear the call.

Depending on how the rest of the season turns out, Duck fans may have another bookmark on history, as Matt Harper picked off Mark Sanchez at the Ducks' 15 to seal the victory with 11 seconds left. With Arizona State beating Cal later in the day, this sets up a great scene next week, when two top 5 ranked teams meet at Autzen for the first time in the stadium's history. It's especially exciting for me because I will be there. I didn't respect The Sun Devils for much of the season, but beating Cal is tough, even with their confidence as low as it is. I hear ESPN Gameday is going to make another trip to Eugene on Saturday, I just hope they don't curse the Ducks like they did for the Cal game! :-P Anyway, I'll take some pictures during the game and post them, but probably only if the Ducks win.

On a side note, while the Harper interception was huge, it wasn't nearly as jaw-dropping as this play from Division III Trinity, which is the most unbelievable end to a game that no one ever saw. Both of the fans in the stands were excited, I'm sure.

Before next Saturday, I'm heading down to San Jose for the Business of Software Conference on Monday and Tuesday. I expect it to be a really great experience and I will post some notes about it as well as pictures, which you can all view using the newly installed Lightbox interface (click on an image to check it out). Check back Monday and Tuesday for each day's recap.

Thursday, September 6, 2007

FogBugz Road Trip 2007

Debbie and I made the road trip up to Seattle today for Fog Creek's FogBugz World Tour. It was a good roadie, even while both of us were pretty sick. Debbie's at the end of her cold while I'm at the beginning of mine. Still, Joel Spolsky is the most exciting person I've met since Gabe Newell, who I met a few years ago at Valve.

Hearing Joel talk was a good experience, I learned a lot from the talk, and FogBugz 6.0 looks pretty impressive. After he was finished, I waited around and talked to one of the programmers, Brett, about working at Fog Creek. He seems really happy there and I hope to get Adaptavant to the point where programmers are this content with their jobs. In fact, one of the reasons I went was to try to find out what the secret is. I don't know that I necessarily found it, but Joel and Brett both provided some good clues. Oh that's right! I also hung around to personally meet Joel. He was nice enough to talk to me for a few minutes while he cleaned up. Oh, and one thing I noticed about the demonstration was that there was not any kind of check-in or registration system. Also, there were several seats open if you looked hard enough. So if you're on a waiting list and it's not too far out of your way, it might be worth just showing up.

The demo was pretty short, it ran about an hour and then the QA session lasted about as long, but I got a lot out of it. And although FogBugz may not be right for our company right now, hearing about its features and the questions that came up taught me a lot. For instance, Joel mentioned that Fog Creek doesn't do automated testing; we don't either and I wondered if that was a problem. It didn't seem like it would work very well for our projects but I thought maybe I was missing something because I've never done it before. Hearing that Fog Creek doesn't do it gives me some assurance that it's not a requirement for making good products.

Anyway, aside from the World Tour, Debbie and I had a good enough time in Seattle. We visited Waterfall Garden Park, the birthplace of the United States Parcel Service, which was interesting. And we ate at Il Terrazzo Carmine, which was probably a bit more authentic than I care for (on the other hand, I've never been to Italy so I couldn't say for sure) but a nice change from the normal Olive Garden/Spaghetti Factory menu.

Saturday, August 18, 2007

And for my next trick: CameronHinkle.com/blog

The exciting news is that while you may be viewing this blog at my Blogspot domain, you might also be viewing this blog at my own personal domain. While the differences in url are subtle, I'm pretty excited about having my own domain and actually hosting my blog there.

My initial thought was to create a blogger layout and somehow...host...the blog...from...cameronhinkle.com? I'm actually not really sure what I was going to do, but what I ended up doing has turned out much better. Rather than creating a template, I integrated with Blogger's API. I've put a lot of work into it and so far it is very bare bones, but that's because I spent several hours converting my site from static HTML to a site completely controlled by PHP. It's a pretty slick setup and I'll blog about the whole thing when I get some more time. The best part is I can easily integrate with Picasa, where I have a few albums stored and plan to put some more. So after the blog is a little more full featured, I'll be taking that up as my next task.

I hope you'll all take a few minutes to check out the new site. Unfortunately I'm still building it and I don't have a development environment to speak of so it will go down occasionally. Once everything is the way I want it (hopefully in a week or two), I'll remove the Blog widget from this site and just put up a link to the new site, so you might find your bookmark (assuming anyone has actually bookmarked this blog) expiring soon. Anyway, just a heads up.

Thursday, August 9, 2007

Quirks with Tiles

I was helping one of our programmers working on a bug with Tiles today and thought I would mention this in case anyone else was stumped. The solution came from just a good guess and I'm still not sure why it worked.

We came across a strange happening in the code where the page would load correctly visually but when viewing the source within the browser, there was a huge section of HTML missing. On a hunch, I asked the PM to use Firefox's View Selection Source feature. Sure enough, most of the HTML for the page was being loaded after the header and footer. It was almost as though the body of the page was being loaded through AJAX, although there was absolutely no AJAX written into the page. Today I had one of our programmers try to figure out why and I ended up stumbling over the problem.

We're using Tiles in this application and the section of code that was missing from the page was a part that was being inserted using Tiles' "insert" tag. There were a few usages of insert on the page but only one of them was missing from the initial source. I noticed that the one that was missing had the flush attribute set to "true". I've looked at the documentation for Tiles and the definition of flush doesn't seem like it would indicate this would be a problem. Just to be sure, I had the programmer remove the attribute completely and it happened to solve the issue. I apparently don't know enough about Tiles to understand what happened here because I was under the impression that Tiles would build the whole page before sending a response to the browser. I would love to know what was going on.

Sometimes you get lucky. On the other hand, the more things you try, the more you get lucky. In a similar situation last week, Tomcat wasn't starting properly, it was taking up to 10 minutes and would sometimes fail a few hours later. Of all things, our logging level for Log4J was set too high. The thought had crossed my mind but it wasn't until I had sufficiently banged my head against the wall, after attacking the issue from every logical angle, that I tried lowering it. I knew it was way too high but how could log messages cause a 10 minute delay in what is supposed to be a 2 second process? Anyway, in strange situations it's usually best to eliminate all peculiarities- no matter how unrelated to the problem they might seem- to be sure you know how it's working.

Wednesday, June 6, 2007

We have liftoff

With the help of my co-worker Alec (whose finger is visible at right), I've managed to get the development of Popratings.com started. Every development project has a first step, and most of them involve the words "Hello, World!".

I'm really terrible at IT-related work so I feared setting up an environment would be painful but it was actually not so bad. I decided to go with Ubuntu Server Version 7 as a development environment. As a user, I'm more comfortable operating in Windows (which I'm not necessarily proud of, but it is a fact) but for programming, I've been working in Linux for the last 5 years so I prefer that.

Since I don't have a spare computer lying around, or space for one, I found a VMWare image at thoughtpolice.co.uk and have set up the environment there. To start working, I installed PHP 5.0, Subversion, and Vim using Aptitude, which was all very easy. I decided to go with Subversion mainly because I don't really know anything about it and I've heard good things. As for Vim, I haven't decided what I'm going to do for an IDE but Vim will suffice in the interim.

For a few different reasons, I want to have a lot of control over the way the URLs look in Popratings. Because of this, I'm using Mod_rewrite inside Apache to map all URLs that aren't images to a front controller, which I call TrafficController.php (although I certainly could have come up with a more useful name, this is my first PHP project in a couple years so I'll learn from my mistakes). In addition to providing his finger for the photo, Alec also gave me the idea to use .htaccess files to route traffic to a front controller class, although I believe you could also do it for an entire site as opposed to a single directory using 000-default in /etc/apache2/sites-enabled/. Alec used .htaccess files for a site he worked on a few months ago and said it worked out well.

I also decided to add a sub-directory for Popratings in the default directory that Apache serves files from (/var/www/) so that I can easily support more sites in the future from the same server. I can add directories to this folder as my list of sites grows. To accomplish this as well as the URL rewriting, I followed these steps:

  • enable Mod_rewrite by adding a symlink from etc/apache2/mods-available/rewrite.load to /etc/apache2/mods-enabled/rewrite.load. The command for that is ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load

  • in /etc/apache2/sites-enabled/000-default, set the DocumentRoot to /var/www/popratings/ so that Apache knows where to get the files specific to Popratings

  • in /etc/apache2/sites-enabled/000-default, change /var/www/ to /var/www/popratings/ so that the settings in 000-default are applied to the files specific to Popratings

  • in /etc/apache2/sites-enabled/000-default change "AllowOverride None" to "AllowOverride all" to allow rewrites

  • create a file at /var/www/popratings/.htaccess so that I can control traffic sent to the document root

Then, my .htaccess file looks like this:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^$ /home/
RewriteCond %{REQUEST_FILENAME} !^.*css
RewriteCond %{REQUEST_FILENAME} !^.*js
RewriteCond %{REQUEST_FILENAME} !^.*jpg
RewriteCond %{REQUEST_FILENAME} !^.*gif
RewriteCond %{REQUEST_FILENAME} !^.*png
RewriteRule ^(.*)$ TrafficController.php?uri=$1
There are a couple notes to mention here. One is to make sure that when you add "FollowSymLinks" to Options, if you leave the plus sign out, you'll override the other settings for Options that are defined in 000-default. This is a problem if you're writing PHP (and other non-HTML languages) because you'll get a "Forbidden" error. From what I've read of the documentation, I think it's because the "MultiViews" Option gets overridden, although I may be mistaken. At any rate, using the plus sign in front of FollowSymLinks adds it to the other options rather than overwriting them.

To explain a bit about the rewrite rules and conditions, the first rule states that if there is nothing after "popratings.com" in the request, direct the traffic to /home/. The next conditions take all images and include files out of the scenario and tells everything after "popratings.com" to be added as a parameter to TrafficController.php with the name "uri". Note that this includes cases where a user was just accessing the home page, in which case "/home/" is added as the uri parameter. In other words, the URL continues through the redirect rules even after being altered by one of them. Also note that the list of files to exclude from the rules is probably incomplete; you may want to add .exe, .pdf, and/or .xml, among others. As the list gets longer, you may want to change the regular expression so that it only requires one RewriteCond for all necessary file types.

This information was all available on the web but it was not usually specific to my operating system and was not all in one place, so it took a little work. I'm now ready to get some real work done. Unfortunately after setting up this environment, I sat down to actually do that work last night and realized that while I know a lot of design theory, I've forgotten almost all the PHP practice :-( While the progress may take a little bit of effort to get going, I'm sure it will be like riding a bicycle.

Saturday, June 2, 2007

Heavy reading

Since leaving Portland for India, I've had more time to sit and read than I normally would. I saw this coming and in the weeks before I left, stocked up on some interesting reading. As a pet project, I'm going to start building a website for a domain name I registered over a year ago, Popratings.com. Right now it's just a lot of ads from my registrar but when it's finished it will be a site for users to submit reviews on various things. I'll get more into the details of the functionality in a later post, but rest assured that it will include social networking, Web 2.0, and Ajax, as well as any other buzz words that happen to be popular at the time. It's really just a way for me to get back into programming and, more specifically, into PHP.

Since this project is aimed at getting more familiar with some of the technologies I've used in the past and using some skills I've picked up while working at my current job, I want to do everything myself. Given that this covers several different areas, I chose four books to read based on what I'll need to know and what I'm not already comfortable with. The four books are The Principles of Beautiful Web Design by Jason Beaird, User Interface Design for Programmers, by Joel Spolsky, PHP 5 Objects, Patterns, and Practice, by Matt Zandstra, and Beginning JavaScript with DOM Scripting and Ajax: From Novice to Professional, by Christian Heilmann.

I've only had a chance to read the first three selections but so far they're all worth reading. Joel Spolsky is someone who I have a lot of respect for as a developer and an entrepreneur. I've been reading his blog over the past year, which is what prompted me to get his book. Although it's a bit brief, he really has some very simple but effective things to say. His book has stood out the most as being a valuable asset for anyone designing user interfaces- it should definitely not be limited to programmers.

The second two books have certainly been useful. Beaird had a lot of good techniques to share. Towards the end of the book, he walks us through the process of designing an actual website for a client he had, which was helpful. Some of the material throughout was covered in my high school art class but I'm sure it's helpful for many people.

PHP 5 Objects, Patterns and Practice has been a great source of information. The first third covers new features to PHP 5, which you can really skim through if you know Java (yes, Java). The last third covers several PHP tools, including package managers and automated build tools, and will be a great reference. The heart of the book focuses on implementing several design patterns in PHP. There's actually not very much PHP-specific information in this portion. In fact, you might be better off reading the beginning and end of Zandstra's book and Design Patterns: Elements of Reusable Object-Oriented Software by the "Gang of Four", which is referenced throughout PHP 5 Objects, Patterns and Practice.

I'm looking forward to putting these to use; I plan to start writing Pop Ratings in the next week and hope to get a lot done while I'm in India. As I go along, I'll be logging anything particularly difficult or interesting that happens so that hopefully it will be useful for others working on similar projects.

Thursday, May 17, 2007

Welcome

Welcome to my (long awaited, highly anticipated) blog. If any of you reading this know me, you probably know I'm going on an extended trip out of the country soon and I thought I would probably have some time on my hands so I should start a blog. This will give everyone a quick way to read about the latest adventures on my trip. It will also give me a chance to release all that pent up angst that I've been holding onto for so long. I'm sure you're all looking forward to that.

In addition to trip details and random thoughts, I'm starting a web development project. I've recently earned a new job title and, while it was a step up the food chain, it unfortunately took me out of any programming roles I previously had. As to keep fresh on my (so-called) skills and pick up some new ones, I've decided to do a pet project. My plan is to journal the process of creating a rather large and ambitious website; I think I've learned some things about development after going through 4 years of school and almost 2 years of work so hopefully some of my posts will be helpful for developers out there who haven't had these opportunities. I'll talk more about the project in the next few days.

The articles in this blog are authored by Cameron Hinkle, Software Engineer for Nike. The thoughts and opinions expressed are not shared by Nike or any of its affiliates.