rc3.org

Strong opinions, weakly held

Month: February 2007 (page 5 of 6)

Setting up other accounts with Gmail

Yesterday I noticed that my Gmail account has been upgraded to allow me to check mail on other accounts. It occurred to me at that point that I didn’t want to give my password to Google because the email account is also a shell account on my server and that its password can be used with sudo to do things with root access on the server.

So today I went and created a brand new mail account that’s not able to log in via the shell at all, and then configured /etc/aliases so that all of the mail that was being sent to my shell account is now sent to the new mail account. I then let Google have POP access to the new account, and now virtually all of my personal email is being shuttled to my Gmail account.

The first thing I notice is that Gmail’s spam filters are better than mine. I use amavisd on my server to filter spam get rid of viruses, and while it (and some milter rules I set up for Postfix) toss out hundreds of unwanted email messages a day, generally 100 to 200 still make it through. Gmail seems to be correctly marking virtually all of them as spam.

The other advantage is consolidation. I usually forget to open Thunderbird and download the personal email that is sent to the addresses that I was hosting myself. Now it’s all in one big inbox.

At this point I’m kind of wondering why I didn’t just set up a forward for my personal email to Google in the first place, since I could have done that as well a long time ago.

Resolving the NameError problem with Rails 1.2

I’m just posting this because I have been fiddling around with a Rails 1.2 application for days in utter frustration due to an obscure problem. Every time I tried to load a page, I got an error message like this:

Mon Feb 05 11:22:35 -0500 2007: Error calling Dispatcher.dispatch #<NameError: cannot remove Object::COPYRIGHT>

The name of the object that couldn’t be removed has varied. The NameError has also caused a number of other problems that basically left my application dead. Today some searching revealed the problem. In Rails 1.2, you must put include statements inside class definitions. I had the line:

include REXML

outside a class definition and it blew up my whole application. Fun.

This blog post is provided as a service to the next person who runs into this problem.

Do programmers like coding for its own sake?

This from Andrew Leonard interviewing Scott Rosenberg:

And programmers, as I quote Larry Constantine in my book, programmers are programmers because they like to code — given a choice between learning someone else’s code and just sitting down and writing their own, they will always do the latter.

Jonathan Rentzsch responds:

Summing up: programmers don’t like to code, we like to solve problems. Coding is not problem solving, but software problem solving usually involves some coding. Even when we talk about rewriting something, the objective is not to code, it’s usually to get a better understanding of the problem for solving in the best possible manner.

I think the truth lies somewhere in the middle. I have worked with programmers who, asked to write a feature, never even look at a language’s class library before hacking something out themselves. They like to code for the sake of coding. There are are also programmers who would rather code than learn. They rarely adopt new tools and they don’t pick up new libraries when they’re released.

As a programmer, I’d prefer to do as little programming as possible. I try to make use of libraries when they’re available and to find the best tools possible in order to help me avoid both coding and debugging. I like working with programmers who work the same way, because maintenance is rarely any fun.

That said, even the best programmers often write more code than they need to because it is easier to write code than it is to find what you’re looking for in someone else’s code, or even in your own old code. At the atomic level, there are convenience methods. Let’s say you have an object of one kind that shares some of the same properties as an object of another kind. For example, you might have an incoming HTTP request with parameters that need to be copied into an object that’s stored in a database. One day, you write a method that copies all of the values from the request into the persistent object, you use it in one of your classes, and you check it in. Are the other people on your team going to know you wrote that method and start using it? Probably not. It’s simple to write so they’ll probably just write their own version of it. Knowing myself, chances are I might not remember I wrote that method a few months down the line and rewrite it later without thinking about it. That’s the life of a programmer.

This happens all the time at many levels, from convenience methods on up. The tonic for it is good refactoring tools and good test coverage. The best way to reduce this redundancy is to surgically remove it whenever you see it later. If I’m fixing a bug in the class with the redundant code, I may realize that it’s redundant (or at least that I’m doing the same thing in several places). A good programmer will refactor their code to eliminate the redundancy, and the key to being able to do so is having enough tests to make sure that the refactoring doesn’t break things.

In an ideal world, nobody writes more code than is necessary, but complexity is the enemy of that ideal. The key is to build the habits and use the tools that let you work back toward that ideal to keep things as clean as possible.

Your vulnerable search history

How valuable is your search history? How would you feel if somebody else could see everything you’ve searched for in the past few months? One Google user was surprised when their search history wound up in someone else’s account. In this case, the problem was user error:

A couple of months ago, l was pitching our product to a VC in a coffee house in Palo Alto. He wanted to compare LeapTag to Google Personalized Search, so he logged in to his Google account from my laptop. We had a nice discussion.

A week ago, I received an email from him asking me if the following searches were ones I made recently, and he included a list of searches.

My jaw dropped! Those were all searches I made a mere half an hour earlier – two months after our meeting.

I realized that he had never logged out of my laptop, and that all the searches, personal and professional, that I had done for the last two months using my laptop were now part of his search history. He had access to all of it – as if it were his. Now who owns what?

My search history is of little value to me. On the other hand, I expect my search history to be private. Time to go fiddle with my browser settings and my Google account settings to reflect those priorities.

You should read Nelson Minar on this topic as well. He explains how to turn off your search history (with Google).

Adium 1.0 is released

Adium 1.0 is finally out. I find it to be vastly better than iChat, so I can’t resist using it, even though I have found it to have had a number of crippling bugs. The bug that drove me to the 1.0 beta series from the commonly used 0.8.x release was a problem where Adium wouldn’t reconnect if it disconnected due to your computer going to sleep, so when you came back from lunch you had to quit the application and restart. Then a month or so ago, a bug was introduced that periodically hosed the networking on my Mac entirely every once in awhile, forcing me to restart the computer. The fact that I still use Adium in spite of the headaches it has given me tells you how good it is otherwise.

Bill Gates’ dishonest spin

Just when you start to respect a guy, he lets you down. When asked about Microsoft adopting some features of Apple’s Mac OS X in Vista, he responds with a completely counterfactual interpretation of events. I’m going to assume Bill Gates isn’t stupid, and put his statement down to dishonesty instead. He says:

I mean, it’s fascinating, maybe we shouldn’t have showed so publicly the stuff we were doing, because we knew how long the new security base was going to take us to get done. Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine. So, yes, it took us longer, and they had what we were doing, user interface-wise.

Why can’t he just admit that in the software industry, companies adopt features that other companies create? In other industries, nobody bats an eye when desirable features see wide adoption. Take the car industry for instance. Traction control, seat belts, air bags, antilock brakes, and cruise control were all invented by somebody. Some company was the first to put a radio in a car. Nobody complains now that all of those features are commonly found in cars from every manufacturer. Just about everything is derivative in one way or another, trying to pretend that’s not the case is just disingenuous.

What’s a mooninite?

Teresa Nielsen Hayden has the definitive post on the “bomb scare” in Boston. Bruce Schneier is worth reading on this subject as well.

By the way, I have seen Fox News as being partly complicit in this fiasco but haven’t made the connection. If you can explain Fox News’ role, please do so in the comments.

iConcertCal, too cool for school

iConcertCal is an add on for iTunes that displays a concert calendar for all of the bands in your iTunes library. You just install it, enter your city and state, and it populates a calendar automatically. I had been wondering if there was a good way to keep track of the concert dates for bands that I’m interested in, and iConcertCal exceeds my expectations in every way. Simple yet brilliant.

President Bush broke the law

James Bamford in the New York Times:

Last Aug. 17, Judge Anna Diggs Taylor of the United States District Court in Detroit issued her ruling in the A.C.L.U. case. The president, she wrote, had “undisputedly violated” not only the First and Fourth Amendments of the Constitution, but also statutory law, the Foreign Intelligence Surveillance Act. Enacted by a bipartisan Congress in 1978, the FISA statute was a response to revelations that the National Security Agency had conducted warrantless eavesdropping on Americans. To deter future administrations from similar actions, the law made a violation a felony punishable by a $10,000 fine and five years in prison.

Yet despite this ruling, the Bush Justice Department never opened an F.B.I. investigation, no special prosecutor was named, and there was no talk of impeachment in the Republican-controlled Congress.

Churchill on democracy

Dissent, democracy, Winston Churchill, Abraham Lincoln. Glenn Greenwald outdoes himself. Just read it.

Older posts Newer posts

© 2024 rc3.org

Theme by Anders NorenUp ↑