« August 2007 | Main | October 2007 »

September 30, 2007

Movie Review Database - Not Yet

After getting the discussion board set up (so far no one has signed up or posted anything; not surprising given the small amount of traffic to that website) using php and MySQL, I thought it might be time to convert my movie reviews over to a MySQL database with pages served like this blog and the discussion area.

It's a big undertaking. For one thing, you have to learn MySQL and php, which I didn't have to do to set up the discussion board (everything was done through wizards and installers). I searched for something similar that I could just use, but didn't find anything. I did find a book whose examples involve a movie database and thought about buying. I found a decent online tutorial and started thinking about how I would set things up.

Currently all of my movie reviews are just static html pages. I put them in folders by the year the movie was released. I have an archive showing all of the movies by year and then title. I also have a frame-based navigation system with a drop-down list showing the year and then a second drop-down list showing that year's movies. Lastly, at the end of each year I will rank all of the movies I saw for that year. This means that when I write a new movie review I have to update the drop-down list for that year, the archive, and (if it isn't the current year) the end of year review. Including the movie review itself, that is four files that need to be updated each time I want to post a review.

Also, the archive by year is okay, but what if you don't know what year a movie came out? Then you pretty much have to do a search on that page since I'm up to 270 movies over a period of ten years. So it would be nice to have a list of all movies alphabetically. And it might be nice to have another list by the grades I assigned, so someone could see my favorites right off the bat. Another thing is that my year-end review pages don't link to the movies.

Some of this stuff lends itself to databases very well. A list by movie title is a cinch, or even by the grade or year. Some things don't: For my year-end reviews I sort out which of the many B+ movies are better than other B+ movies. Plus, sometimes when I'm looking back I might put a B+ above an A-. In HTML this is very easy, because I'm using an ordered list. So the HTML is actually generating the ranking numbers 1, 2, 3, 4, etc. I just put the movies in the order I want and it deals with the rank. That makes it really easy to add a movie or change the placement of the movie. So that would be very hard to work out with a database.

Although I'm sure it would be easy enough to deal with, another issue is in linking with other movies. While writing the review I would have to look up the id number or filename of the movie review I am referencing. That's something that doesn't work particularly well on this blog either. When I changed from storing blog entries by id number to title, I had to manually change all of my cross-reference links in my blog entries.

Another thing to be considered is whether to have the database build a website (similar to how Movable Type works, where each page is an actual page of html stored somewhere, updated only when you rebuild the site) or serve it up straight from the database. I don't know a good answer to that except that the former might help when cross-referencing movies from within a review, since I would have an actual filename to link to (in fact, I was thinking the filename could be a field in the database). At work I had a Microsoft Access database of consultants and we didn't have a way of putting that on our web server dynamically. So I came up with a macro that would generate a web page for each company, and generate an index of all companies, that could be run with a click of button. Then you just had to move all of those files over to the web server. (Eventually we would hire computer consultants to make all of this work dynamically through web pages: What took me a few days took them many months and hundreds of thousands of dollars to do, plus a new service contract any time we want to make a change. Privatization.). I thought I could do the same with the movie reviews and do away with learning the MySQL and php stuff by putting everything in MS Access and using VB scripts. But then I would have to rebuild and upload everything that had changed to the server every time I added a movie (this is what I wound up doing).

But maybe the biggest thing with a MySQL database is that you have to build pages to interact with it. I would have to have a form that allows me to add movies. Maybe another one to edit movies (could be the same as the add, or at least would be very similar). Since this is on the web, I would want a way to log in so that no one else could edit the movies. Then I would have to write up the alphabetical archive, archive by year, archive by grade, etc. Once I did it, it would update automatically, but there is a lot of overhead at the beginning. Then you need some way of exporting all of the information so that you can back it up or move it to another MySQL server.

As I started writing up some HTML forms and php by adapting code that was in the online tutorial, I realized that much of this was just a matter of changing field names and everybody who does a simple database would be doing essentially the same thing, but with different field names and types. That in itself could probably be done with php if someone had written a php/MySQL website wizard. I found Web Form Generator, a java application, that might do the trick, but haven't tried it yet.

The other option (I'm sure Jeb has been waiting for) is to do a blog of just movie reviews. A blog might not do everything, but it would do a lot of what I'm describing without much or any programming. Each post would be a movie review, with the movie title as its subject. I could categorize each post based on the year the movie was released and/or the grade I give it. Actually, I would probably make the release date of the movie be the date the entry was posted and the category could be the grade.

For now I think I am going to continue doing this the old-fashioned way and writing up html pages.


September 25, 2007

Privatization

I accidentally stumbled on a great example of government privatization yesterday. I was coming back from a trip to Columbus around lunchtime. I missed the exit where Arby's is, but the next exit showed a Hardees, Waffle House, Wendy's, and Chik-Fil-A. So I pulled off. When I got on to the ramp they had a sign saying which way each place was. The two I might want (Wendy's and Chik-Fil-A) were 2.8 miles to the right. That wasn't much less than if I had turned around and gone back to the previous exit to go to Arby's. I ended up going down that road anyway and it seemed like I was out in the country. After what seemed a very long way I came across some restaurants, though I didn't see a sign pointing out which way the places I wanted to go. I ended up giving up and went to Taco Bell.

I have a friend that manages the guide sign program for the state. It used to be that the state would order the signs, install them, keep up with the restaurants, etc. Part of the agreement with the restaurants was they wouldn't advertise on billboards within a certain number of miles of their blue signs, so the state had people that had to drive around and make sure nobody was cheating. I think the fee at the time was about $1,000 per year to participate in the program and the restaurants had to pay separately for the signs when they were needed (a few hundred dollars every few years). This covered all the state's costs to run the program. There was a big push to eliminate state positions and privatize the program. A 5-year contract was awarded to a private firm that ran the service in other states (and had lobbied lawmakers for the privatization). I believe the price for the restaurants went up to about $10,000 per year, most of which went into the pocket of the company that ran the program, plus they gave some back to the state to cover the state's administrative costs.

Anyway, I called the guy and said how crazy it was in a fairly developed area about 30 miles from a major city that the state would be telling people there was a restaurant at the next exit that was really 5.6 miles out of the way (round trip). It seemed to me to be a disservice to hungry travelers. He said there wasn't much that could be done, but maybe he could come up with some kind of new rules in the next 5-year contract. The restaurants had paid their money and wouldn't stand for having their signs taken down. And further, the company with the contract was counting on getting the money from that restaurant, so to take the signs down would take money out of their pocket and they would demand the state reimburse them for that.

So what did privatization do? The restaurants are paying a lot more for the service and the public is literally being siphoned off the beaten path after being misled about there being a nearby restaurant. Instead of serving the travelers, the state is accommodating business owners. And that is what privatization is all about.


September 22, 2007

Bulletin Board

After doing a bunch of research on different types of discussion boards, I went ahead and decided to try out PunBB. It got good reviews as a small and easy-to-manage bulletin board system. I thought it would be a real challenge, but actually it wasn't bad. Even the installation was fairly simple. The file itself was under 300k. I had to create a MySQL database at my host first, and I wasn't sure what to use as the database server hostname (I left it as "localhost" and it seemed to work). It went surprisingly smoothly and I had a discussion group before long.

Also, in the control panel for the website I set up a subdomain so that visitors can go to:

http://forums.gdotea.com

Right now it is very plain. And I don't think it has a lot of options. One thing I wanted to do was to approve members manually so that I don't get interlopers or robots visiting. It seems the only thing I can do is require a confirmation e-mail. That should help anyway.

I got kind of mad at first because I told it not to show my e-mail address in my posts, and when I went to look, there it was plain as day. But it turns out I could see it because I was a moderator. When I logged out and viewed it as a guest, I could not see the e-mail address.

I wrote this up for ASO's website in case someone else wanted to set up a PunBB there:

First you need a MySQL database. This is very easy. You go to cPanel:Databases:MySQL Database Wizard and create a database with whatever name you want. It will put your domain in front of the name (e.g. "punforum" will become "mydomain_punforum"). You will get a username which will also have your domain in front. It can be like mydomain_admin if you want. Write down the names and passwords. That is all the MySQL you have to worry about.

I used SmartFTP to do most of the FTP work like creating folders, changing CHMOD properties, and moving files. I created a folder in public_html called forums.

If you want to have your forum's web address something like forums.mydomain.com then you will want to go to cPanel:Domains:Subdomains and create a subdomain "forums" that will point to the "forums" folder.

Now you can download the software. Go to http://PunBB.org and download the latest software in .gz format to your PC. I used SmartFTP to upload this file to the "forums" folder. Then I used cPanel:Files:File Manager to extract the archive which it puts in a folder by the same name. (If you have some other way of moving files and extracting an archive, have at it). Back in SmartFTP I moved the contents of that new folder up to "forums" and then moved everything in "upload" to forums as well. Now the archive folder and upload folder should be empty and can be deleted. You can delete the .gz file too if you want.

Now you can follow the installation directions for punBB. In your browser go to your site: http://www.yourdomain.com/forums/install.php (or http://forums.yourdomain.com/install.php if you used a subdomain) and enter the name of your MySQL database and password along with other information you are asked for. The database server can be left as "localhost". It will give you some text that you have to paste into an empty text file, save as filename config.php, and upload to your forums folder. Make sure the CHMOD permissions for config.php are set as 644 so nobody can read the file (this is the default for SmartFTP).

Once you've done that you can visit your new forums website at http://www.yourdomain.com/forums or http://forums.yourdomain.com, log in as the administrator and start changing options by clicking on Administration.

One setting I changed right away was to hide e-mail addresses. But when I tested it out, I could see e-mail addresses on my test posts. This is because moderators and administrators always see the e-mail address. Visitors and regular members will not be able to see it.

Another key change is to change the sign-up type to require confirmation by e-mail which may reduce spam posting and ensures people are using a valid e-mail address.


September 21, 2007

Counter

When I moved the website from the old host, the old CGI Perl web counter stopped working. Because the new host supports php, I decided to try some php web counters. I found a simple one and had to do a couple of things to make it work. First I had to add a file to my www root called .htaccess that enabled php code on html files by adding this line of text:

Addhandler application/x-httpd-php .html .php

Next I had to set the CHMOD permissions for the file containing the page count to 777 or else it would read the file but be unable to increment the number and generated a bunch of error codes.

Unable to get all of that to work at first I tried CGI and Perl using this counter and this digital one. I found that the correct path to Perl was "#!/usr/bin/perl/" but that somehow any scripts stored in the www folder under cgi-bin were not available. I tried changing the CHMOD permissions, but nothing seemed to work. Even if I put an index.html file in cgi-bin, I couldn't see it from the web, so I think there is either a conflicting cgi-bin folder that I can't see or the webhost automatically disables cgi-bin folders. Some people on ASO's forums said that sometimes you had to get a support ticket to get the folder set up correctly.


September 10, 2007

My New iPod

Today FedEx left my new nano under my doormat. nano.jpg The box was very small, about the size of a thick paperback book. Inside was a clear plastic box about the size of my old iPod but thicker.
And there, floating behind the clear plastic front, was my black 8 GB 3G nano. It isn't much bigger than a book of matches. It is just very, very tiny. It definitely looks better than in the pictures. The screen is very crisp.

I converted an episode each of The Simpsons and Seinfeld to see how they would look on the small screen. They came out surprisingly good. It is very small, but for sitcoms it works fine. I certainly wouldn't want to watch a football game on a nano.

nanoship2.gif

The biggest challenge I had was paring down my music collection to fit on 8 gigabytes (really 7.3 something, which is all that is usable). I spent a lot of the weekend unchecking albums and songs. The first cuts were easy but only got me down to about 11 GB. Then I had to start cutting albums I like, but chose the ones I don't listen to very often, or cut out songs I'm not crazy about (Neil Diamond's 12 Greatest Hits went down to 4 songs). That got me to just over 8 GB. Then I made even more cuts to get down to the usable space. I could really have used a 16 GB nano, but they don't make those yet. Plus if Apple releases a hard drive version of the iPod Touch, I will be able to store absolutely everything.


September 5, 2007

New iPods

Well, I've waited for a long time and they finally announced new iPods today. Unfortunately, I didn't get what I've waited for for so long: a high capacity widescreen iPod. Instead they have a really high capacity iPod classic (160 GB) and a really low capacity widescreen iPod (16 GB). I still hope Apple will introduce what I want, and I see no reason they won't introduce such a thing by January anyway.

So in the meantime, I'm thinking I will get one of the new fat nano's in either red or black (I don't like the light blue and light green colors!). I like the engraving Claire has on hers, so I will probably order directly from Apple so I can get that. Maybe even this week.


September 4, 2007

The Dark Side of Cheese

Last week I heard a piece on NPR about alpine cheese. In particular they were talking about a cheese producer in Vermont who was making Beaufort cheese, which is typically made in France. They also talked to some French cheese makers who said it was getting harder to make their cheese due to global warming. In addition to the pastures growing different types of plants for the cows to eat, the hotter weather has made the cows thirstier, meaning they drink more water, and the milk they produce is less concentrated, requiring more milk to produce the same amount of cheese. Stupid global warming.


Well, that got me hungry for cheese and I thought about cheese all weekend. I found the piece on NPR’s website and started my research on Wikipedia. They talked about different types of cheese and how cheese is made. While reading I found out about “rennet” which makes the milk curdle, the first step in making cheese. I’d never heard of that before. I read about rennet and found out that is derived from the stomach lining of young cows. They need it to curdle their mother’s milk, I guess. Rennet is obtained from the stomachs of baby cows slaughtered to produce veal. And I don’t eat veal. There are rennet alternatives and there is also vegetarian rennet produced from bacteria or something. But some cheeses are required to have rennet in order to be authentic. It was depressing that something I always thought was just dairy, actually was meat-based. And not just meat, but one of the few kinds I won’t eat.

But that didn’t stop me from wanting some cheese. Yesterday I went to the farmer’s market intending to try some Beaufort cheese and see what it was all about. I couldn’t find any of that. But I did find some St. Nectaire from France (a little more firm than brie and containing rennet) and also some Wensleydale cheese from England which I bought primarily because it is a favorite of Wallace and Gromit (contains no rennet). I bought a baguette to put the cheese on. It was good (the Wensleydale was white and had a kind of bad taste, but I sliced off the outer layer which I think had white mold on it and the remaining cheese was much better). I did see a couple of cheese with “non-animal rennet” and of course some that didn’t have rennet at all, so I think I can avoid it if I want.


September 1, 2007

One Thousand Google Dollars

At the very end of August, I passed $1,000 in lifetime (just over three years) earnings from Google. I had already broken that with Amazon, but I'm halfway through a 4-month hiatus with them, so I won't start earning from Amazon again until November 1.

I was crazy to make note of how regular Google is because immediately thereafter monthly earnings dropped way off and it took me 4 months instead of the normal 3 to earn another check.

New iPods come out on Wednesday . . .