Mar 12, 2008
Over the past few years my Blockbuster subscription fee has increased and the number of in store exhanges allowed has decreased. At the same time my queue is running on empty. At 1st there were tons of movies I wanted to see but now I'm caught up and I don't have the desire to rent more than 1 move a week.
What are 4 movies a month worth? If I use Redbox those 4 movies will cost me $4 (if I return them in 24 hours). With Blockbuster Online only the cost is $9 (no in store exhanges).
Sure I can keep the blockbuster movies as long as I want but I only watch them once and why not just grab one when I know I have time to watch it.
The trouble with Redbox in the past was that you never knew what was going to be in the box when you got there. They recently made my local Redbox part of their online rental system so that problem is solved.
There is a remaining issue that I hope Redbox is working on. There are frequently people browsing movies when you get to the box. You need to wait for them to finish before you can return a movie or pick up your movie, that you ordered online. They should have an online pickup and return slot on the side so those of us impatient people don't need to pace around behind the people browsing titles. :-)
Bye Bye Blockbuster. I suspect next year I'll be able to dump Comcast an use Antenna and the web for my television consumption.
Mar 8, 2008
After I blogged about building a sitemap for Rails I contacted Mike Clark and asked him if he thought it would make a good Recipe for his upcoming book, Advanced Rails Recipes. He thought it was a good fit and it is currently in the Beta version of the book.
I wrote up my notes in the Recipe format, then Mike basically rewrote it for Rails 2.0 and added some additional content. Thanks Mike! I almost feel bad being cited as the author since after editing it is drastically different from the original. :-)
The core concepts are still there and some thoughts were dropped since Recipes should be short. So, Here are some elaborations..
The Ping Protocol
There is a warning in the book about excessively pinging to Google to have them read your sitemap. I would recommend letting search engines crawl your sitemaps at their own speed. The ping example in the book was a nice overview of when to use an Observer and also provided complete coverage on how to submit sitemaps. Please use ping sparingly, if at all. :-)
Sitemaps with over 50,000 entries
I work on sites where we use siteindex files because we submit well over 50,000 URLs to the search engines. I didn't provide an example on how to build these in Rails because I'm not sure they provide any value to the typical site.
My theory is that if you build a sitemap with the 50,000 pages that were most recently updated you will give the search engines all they need. If a page isn't updated for a while and it falls off the list is that really a problem? If the page was worth anything someone externally would be linking to it before it fell off the list. Now if your site is creating millions of pages a day this may not be the case.
If your pages are islands (no links to them) and you're afraid they won't be found unless they are all in the sitemap, I would suggest building the sitemap via a rake task that is kicked off via a cron job. This will also give you an opportunity to gzip the files. I'll try to writeup some example code for the this when I find some free time.
Do I really need a sitemap?
If your site has navigation to all its pages, then a sitemap will probably not benefit you. I suggest checking what pages the search engines have in their index and if key content is missing then pursue a sitemap. Even if they are finding all your pages a sitemap certainly couldn't hurt.
Just in case you didn't know how to find the pages Google knows about on your site you can simply type site:youdomain.com in the Google or Yahoo search box.
Example results for my site are here
Feb 15, 2008
I hate traffic lights. I hate them even more when they have me stopped unnecessarily. I'm always thinking about the gas being wasted as cars are forced to stop and then idle. Sure, electric cars will recapture energy when you are breaking but there is still energy lost. I suspect 10% of the traffic lights in this country are unnecessary and of the remaining 90%, 50% of those are only useful for about 8 hours a day. Still more aren't needed on weekends.
As a teenager I was visiting Utica NY and there were stoplights at almost every intersection, despite the fact that Utica was already a ghost town (population was in steady decline since the late 1960s). Was it cheaper to leave them up than to install some stop signs?
What we need is a place where people can report useless stop lights so they can be removed. We also need a way to report enhancements. On my way home I come to a light that I turn right at. There is a right turn lane but no arrow. This results in all cars stopping when the light is red even though the cross traffic runs one way at a time. A turn arrow would easily save 500 cars a day from needing to stop. How much gas would that save? I guess I should write my county government but I'm sure this will be a time consuming and painful process. If people stuck at intersections thought about issues with the intersection and were able to report them easily, think of all the energy (and time) we would save.
Besides removing lights, some municipalities need to work on making their lights facilitate the flow of traffic. You should never be driving down a main road and get stuck at over 50% of the lights. It kills me when I'm stuck at a light and I see the next light in sequence turn green only to be red by the time I get there.
I always loved driving late at night when most of the traffic lights were blinking yellow. I think most lights should do this much earlier and some should do it all weekend.
More traffic circles would also save energy, if only American's knew how to use them. People are too timid resulting in less than efficient operation. Also you have the confusion made by differing rules. Most states use the same rules as Europe (traffic in circle has right of way) but New Jersey made up their own rules. Even with US circle inefficiencies I suspect traffic circles are a big energy saver.
As an experiment I'm going to see if I can get a right turn arrow put in at that intersection I mentioned. I suspect it won't happen because there is no incentive. It will cost money to install and will provide the county no benefit. In fact they'll lose a little tax revenue from gas sales since we'll be using less. ;-)
Of course if everyone was reporting light change suggestions the county could prioritize them by impact. How many cars per day can you stop from stopping would be one measure and idle time reductions would be another. That's all for now. Let me figure out how to request a light!
Feb 12, 2008
Electric clothes dryers are not an efficient way to heat your home, but if you're using it anyway, you might as well use that heat to warm and humidify your home in the winter. Not only is your dryer heating air and sending it outside, it is constantly pulling warm air out of your house when it is running. What is coming into your house is cold dry air to replace the air the dryer is expelling. There is also the issue of air coming into your dryer vent when the dryer isn't running. If your outside vent cap doesn't seal well this can make your laundry room very drafty.
Here's what I do every fall to help warm my home, increase humidity and lower drafts in my laundry room.
1) I disconnect my dryer hose from the outside and stuff the hole with plastic grocery bags. These make great insulation, just don't forget to take them out in the spring when you reconnect.
2) I connect a longer dryer hose to my dryer and run it to a lint trap. Try to get the trap as far as possible from the dryer as you want the humid air to dissipate. Depending on your existing setup you may be able to use your existing hose.
Here is my lint trap. Under the sink, next to the washer
Here is the dryer hose running from my dryer and past the washer.
Since I have kids we do a lot of laundry, which in turn results in me never having static electricity issues in the winter as my home is never too dry. These lint traps are pretty common. If you Google "lint trap" you'll find plenty of places selling them. They are filled with water and they catch most of the lint. Warning, If you let the trap run dry you'll end up with a linty home.
I know some people use nylon stockings over the end of the hose instead of a trap but if you didn't clean it often you could damage your dryer or cause a fire. I also have friends who have created larger boxes to capture more lint. Please leave comments or other ideas below.
Warning #1: Only do this in the winter months as you may end up with a mildew problem from excessive humidity and this will work against your air conditioning. We want to expel heat in the summer. Also, the dryer will not be able to dry clothes as fast if it is pulling in excessively humid air. I find this to be a non-issue in the winter because the humid exhaust is quickly evaporated into the relatively dry house air. The further you can get the lint trap from the dryer the better.
Warning #2: Don't do this if you have a natural gas dryer. You must vent this outside to prevent carbon monoxide buildup in your home.
Warning #3: If you use fabric softeners or home dry clean kits you should probably not do this as you may end up with unhealthy air.
i find that switching over from internal to external venting gives me an excuse to clean lint out of the lines and dryer twice a year. When was the last time you cleaned your vent hose?
Jan 25, 2008
I love buying and selling things on craigslist but I'm amazed at how many people email you about an item and never respond back. Are they just gathering email addresses for spammers? That seems like too much effort to build a spam list but I would say about 50% of the people I respond to never follow up. Maybe they found a better price but if so why not offer me less?
I feel like adding a note to my postings saying that if you inquire about an item and then don't follow up I will post your email address on my blog. :-) The flakeout list.
These flakeouts make everyone's life miserable. I always give an item to the 1st person who inquires and tell other people that someone else responded 1st but I will let them know if they don't follow through. Anyway here are my craiglist tips after selling about 8 things on craiglist.
- Post items around lunch time on a weekday. People browse craigslist from work. I get much better responses on weekday posts than weekend.
- If you get multiple responses let the 1st responder know that the item is theirs but they need to pick it up soon or you will give it to the next person. This will get them to commit or bail quicker so you won't wait a week for them to make up their mind. Respond to other interested parties letting them know someone else is ahead of them but you will contact them if the other person does not follow through.
- Google the person who emailed you. On a few occasions I have found that someone lived near my work and I met them at lunch. Saving them a long drive to my house. You might also find some scary information on a person. Remember, you're inviting these people to your house for a pickup, so do a little research. ;-)
- Always include a picture of the item.
- Don't host the pictures on craiglist. If you upload pictures to craigslist they are deleted when the entry expires. There is a nice repost option but you need to upload the pictures again. If you put the pictures on a photo sharing site and type the html by hand the reposting process is much easier. for example
Jan 10, 2008
- <img src="http://tonycode.com/craigslist/jacks.jpg" />
Recently I implemented a Rails application sitemap but once the search engines started hitting my site, I realized that I wasn't giving them all the information they desired.
- Yahoo was doing simple HTTP head requests on my sitemap and going away
- 22.214.171.124 - - [11/Dec/2007:08:35:49 -0800] "HEAD /sitemap.xml HTTP/1.0" 200 334 "-" "Yahoo! Slurp/Site Explorer"
- Google read my sitemap infrequently but loved to do HEAD requests on my index page
- 126.96.36.199 - - [17/Dec/2007:07:11:24 -0800] "HEAD / HTTP/1.1" 200 372 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
For those of you unfamiliar with HEAD requests, they are requests for a page that don't actually return the page. Just information like size and date. Its a nice way for search engines and caches to decide if there are any changes they need to pull. For some examples of HTTP requests check out the wiki page I wrote on making HTTP requests via telnet.
Now what do you think Google and Yahoo were looking for? My assumption is they are looking for the Last-Modified header in the response to see if they should bother requesting the sitemap. They could compare the size of the response since they last visited but I doubt they want track this information.
The Last-Modified date is the ideal field to check.
This is all fine and good but guess what. Rails doesn't set that header for you.
telnet ficlets.com 80
Connected to www.ficlets.com.
Escape character is '^]'.
HEAD / HTTP/1.0
HTTP/1.1 200 OK
Date: Wed, 09 Jan 2008 20:22:31 GMT
Server: Mongrel 1.0.1
Status: 200 OK
Content-Type: text/html; charset=utf-8
Set-Cookie: _session_id=s322clipped; path=/
The good news is this is easy to add! If you look at my wiki example you'll see that I set the header with the time of the latest entry in the sitemap.
headers["Last-Modified"] = @entries.updated_at.httpdate
Now it isn't rails job to add this header for you but it would be nice if the scaffolding added this header. The standard show/1 actions are pulling a record from a database and the action knows the updated_at value.
I have added this header to my show actions as I am just pulling a record from a database and I have the modified time!
headers["Last-Modified"] = @business.updated_at.httpdate
That's all. I'm looking forward to any comments and suggestions people may have.
Jan 8, 2008
Up until a few months ago, all of my bedroom ceiling fans used Compact Florescent bulbs (CFLs). Back in October I bought a Hampton Bay Ceiling fan for Dani's room and when I installed the light fixture I noticed it had a different socket type. It used Intermediate base bulbs (also known as E17). These bulbs are rare and there is no CFL option. So I went back to Home Depot and sure enough all the manufacturers were starting to use these things. The Home Depot guy suspected it was a conspiracy between the ceiling fan companies and the bulb manufacturer. There is only a single brand of intermediate base bulbs at Home Depot so this made a little sense. They also cost as much as a CFL!
I had no desire to use these bulbs so I started looking into converting my base to use the standard medium base socket. I saw a medium base for a ceiling fan display model at Home Depot but they wouldn't sell it to me and it was no longer going to be carried. The plot thickened. So I looked on the Lowes website and I found a medium base socket that I figured I could retrofit onto my base. While I was looking for the item at Lowes, I asked a representative of one of the lighting companies (who was restocking) about the intermediate bases and he said it was all part of the 2007 Energy Bill. Huh? How can using a base that doesn't support CFLs be part of an energy bill? I googled around and it appears this was a loophole to get around the Bill. The bill required ceiling fan manufacturers to ship with CFLs, UNLESS they used candelabra or intermediate base bulbs.
Here is the conversion that I did tonight in about 15 minutes.
DISCLAIMER: Please do no do this unless you are experienced with electrical wiring. Follow these steps at your own risk. There may be typos so use common sense if you do this.
1) Unscrew the existing sockets and cut the wires. Keep track of the original wiring. Save the screws.
2) Remove the mount from the Lowes socket and attach it to the base with the screw from the intermediate base. Twist and bend to get it as close to center.
3) You'll need to strip the existing wires that were not part of the intermediate bases.
4) Combine your whites and blacks and attach with a twist on electrical wire connector.
Since these sockets are bigger I needed to bend the socket a little before the light covers fit but overall the fixture looks great.
Pictures. yeah close ups are out of focus but hopefully helpful. ;-)
This is the bottom of the intermediate bulb base. poor focus. This is where you will find the screw to remove it.
Here is how the medium base (lleft) compares to the intermediate base (right).
The new base had 2 screws. I removed them and used the screw from the intermediate base since I knew it fit the fixture.
And now I have CFL joy.
Jan 5, 2008
I bought a Honda Fit on New Years Eve. What was I thinking?
I drove my 1996 VW GTI for 11 years and over 120,000 miles. I bought it back in December of 1996 after the oil pump on my 1988 Jeep Comanche died while I was at my mom's house for Christmas. Before the Comanche I drove a 1977 Mercury Cougar XR7 that I bought from my mom when I was 16.
- Cougar had a 351M 5.8L V8 (173HP) 4000 lbs (23.1 lbs per horse)
- Comanche had a 2.5L 4 cylinder (117HP) 3000 lbs (25.6 lbs per horse)
- GTI had a 2.0L 4 cylinder (115 HP) 2557 lbs (22.2 lbs per horse)
- Fit has a 1.5L 4 cylinder (109 HP) 2551 lbs (23.4 lbs per horse)
There seems to be a trend in engine displacement and weight. ;-)
I'm pushing 40 and I'm on my 4th car. I had a friend in high school who had bought over 10 cars before he was 20. ;-)
Why the Fit? Honestly I did not expect to like this car. Before I drove it I drove
- Mini Cooper. This car is really cramped inside and there were some interior design flaws that I would not have expected from a BMW.
- VW Rabbit -- I loved my GTI but I can't spend another 10 years in the same car
- Mazda 3 -- I liked this car but I didn't love it. And it was a bit heavy
- Scion XD -- I wasn't impressed and the front end is really high. it looks a little goofy
The fit looks tiny but it is well designed inside and has more interior space than the other cars. It also only weighs 2551 lbs which is about the same as my 1996 GTI. Cars keep getting heavier and I love light car for city and rush hour traffic. Yeah, I know some people prefer to drive tanks for safety but I also own a 1986 Kawasaki Ninja 250 that I stopped driving when I had kids. I gave up the motorcycle for safety but you won't find me in a Hummer anytime soon. :-P
There were a few things that I didn't like about the Fit that were being addressed in the 2009 model but I became convinced that my GTI was not going to live to see November 2009 (New Fit Launch date) so I headed to the dealership on New Years Eve. I figured I would have more negotiation power on the last day of the year. They only offered my $500 for my trade in and I asked them if they would match an offer from CarMax. They said they would, so I came back an hour later with my $1200 trade in offer from CarMax and they matched it. They also matched a price I was quoted over the internet.
So my car buying tips of the day are
- Always get a CarMax trade in offer 1st
- Always get an offer from the dealer via their internet department 1st as this is better than what you get when you just show up.
That's the story. I hope the Fit gets better gas mileage than my VW. The Golf was advertised at 23/30 but I got 30/34. The Fit advertises 27/33. Lets see what I get out of it. My notes will be here.
Dec 16, 2007
A few days ago I was having my old AC unit removed and my AC technician noticed that I had a PEPCO Kilowatchers box on my AC Unit. "You won't be needing that on the new unit" he said. Sure enough they killed the program 3 years ago. These boxes allowed PEPCO to turn off AC units during peak hours to prevent brown outs and help them reduce expenses. In return, people who volunteered to add this box to their AC Unit would get paid each time they were turned off. I think the max was 1 hour per day. So much for trying to get by with fewer power plants.
When I moved into my house in 1998 the power meter was setup for Time of Use (TOU) billing. The off peak rate was about 1/2 the normal rate and the peak rate was a few cents higher than the normal rate. Since my wife and I worked during the day, this saved us money. I kept the AC off during the day and turned it on again when the rates dropped. A few years ago PEPCO changed the off peak rate to be almost the same as the normal rate so I dropped the program. There was no longer incentive to participate.
Just this week I heard that utilites pay 10x more for energy during peak hours. Giving me 50% off my off peak rates seems like a huge win for them and me. I don't understand why they removed the incentive.
My guess is that since they no longer own any power plants, they are no longer concerned with having to build new plants to keep up with demand. Any increase in peak power can just be passed onto consumers and they profit regardless.
Time of Use programs have the power to reduce the need for more plants and they allow us make better use of our existing infrastructure. Perhaps the government should push for reasonable TOU programs so we can reduce our peak energy usage.
Dec 12, 2007
I was going to write about how much I hate December but instead I'll attack www. :-)
Now I love the World Wide Web but I hate typing www for web sites. I'm specifying http:// and I'm hitting port 80, i expect a web page. So why do so many sites still expect you to type www. then the domain name? My site works fine with http://tonycode.com/ or http://www.tonycode.com/ but there are still plenty of sites that just plain break if you don't add the www. A friend of mine worked at a startup and he mentioned the company name so I entered http://companyname.com/ and I got some guys personal web page. As it turns out one of the employees was using the base domain as his personal web site. No one at the company noticed because they always typed www first. I wonder how many people like me landed on this guys page instead of the company page. Needless to say this was corrected after I brought this issue to the attention of my friend.
That was a few years ago but there are still plenty of examples today. Here is the most recent one I stumbled on
http://www.berkshirehathaway.com/ works correctly but http://berkshirehathaway.com/ returns a directory listing error. Come on Warren, surely you can get Bill Gates to fix this for you. :-) Any competent IT professional could fix this issue in a few minutes. Of course the site is running on Microsoft IIS so maybe this takes days. I live in an Apache world were everything is easy and free.
Ok, enough picking on Warren and Bill, I own stock in both of their companies so they have the last laugh anyway. :-) But please fix the www. I never type www. unless a site won't work otherwise.
Did I mention that I hate December?