Defining torture

One of the questions that people seem to be unable to answer easily is, what constitutes torture? Slate has published an interactive guide to US use of torture, which includes a list of various techniques we apply and the legality of them. For me, I answer the question by considering a hypothetical. Pretend that insurgents in Iraq (or in Afghanistan) capture a US soldier who they believe has knowledge of an imminent airstrike that could very well hit civilian areas. These insurgents believe that unless they find out what the targets of those airstrikes are, their wives, children, or neighbors could very well be killed. What interrogation tactics on their part would we consider acceptable in interrogating that soldier? Of course the truth is that the insurgents probably wouldn’t adhere to any standards of treatment in that case, but that’s beside the point for this scenario. I can tell you that almost none of the tactics we read about from Guantanamo, Abu Ghraib, or other hellholes around the world would be acceptable to me if applied to American soldiers, just as they are not acceptable to me when applied to our detainees. ...

May 26, 2005

Mail Filtering 101

My friend Jef Poskanzer has published an extensive tutorial on filtering mail to fight spam. The article is targetted at Unix administrators running Sendmail. Update: Another friend mentions grey listing as an alternative for blocking spam at the server level.

May 26, 2005

Apps vs frameworks

Java Developers Journal author Timothy Fisher blogs that all the cool open source Web applications are written in PHP, whereas Java developers seem to focus on writing frameworks. I think there’s a big reason for that. Let’s say that I want to put up a blog or a message board for my own use. I can spend $10 or $20 bucks a month and get a shared hosting account, unzip an archive containing a PHP application, run the database setup script, and I’m off and running. It’s cheap and it’s easy. If I wanted to use a Web application written in Java, I’d have a much tougher road ahead of me, both in terms of finding a hosting provider and getting things up and running. That’s the strength of PHP. So if I want to write an open source application that’s going to see wide adoption, I should pick PHP. Even if people write the best message board software ever in Java, it’s not going to be as popular as PHPbb, the administration overhead is just too great. On the other hand, most of the Java developers out there are writing applications that lend themselves to the use of frameworks. I’ve worked on several internal projects and a couple of products that have used Hibernate for persistence. Using Hibernate has saved companies I’ve worked for more money in development time than any popular PHP web application ever will. So the reason why the open source development effort in each camp falls out the way it does seems completely organic and natural to me, and intentional efforts to change things don’t make much sense. ...

May 26, 2005

More on ads in RSS feeds

Nothing quite like of having every item in a feed marked as unread because ads have been inserted. I wonder if the fact that ads constantly change will mean that sites like Bloglines will have a harder time keeping track of what’s new and what isn’t. I hope not. I guess it depends on whether or not it’s done by diffing new content against the old or by timestamps.

May 25, 2005

Matt Haughey on ads in feeds

Matt Haughey has a good post on why running AdSense ads in your feeds doesn’t make sense.

May 25, 2005

The filibuster

Here’s the bottom line, as I see it, on the compromise that has forestalled the application of the “nuclear option,” which would change Senate rules permitting unlimited debate of judicial nominees. If less than 5 Republicans had broken ranks with their leadership, there would have been no compromise, the nuclear option would have been exercised, and every Bush judicial nominee would be confirmed unless the Senate changes hands in 2006. It’s hard not to see that as a victory for the Democrats, no? Update: other people don’t seem to think the Democrats did well at all. ...

May 24, 2005

Scary things

Over the past week or so, a new New York Times series (part 2) detailing an investigation into Afghans who were killed while in US military custody has been much discussed in the blogosphere. Needless to say, the idea that US soldiers, believing they were acting according to the wishes of their superiors, beat their (sometimes innocent) prisoners to death in the course of interrogating them is terrifying and disturbing. But what’s more terrifying is the chorus of hatemongers, morons, and psychopaths who believe that this story is “old news” and that the New York Times was wrong to print it. And more disturbingly, believe that the publishing of the story is evidence of a conspiracy among major media outlets to cover for one another. For more, see Bruce Rolston, or John Cole. It’s at times like these that I have to remind myself that this country and human society have been plagued with people of this ilk for all time, and that we’ve managed to survive. I should also mention that I’ve been following Jeanne d’Arc and Jim Henley on this topic for some time. I don’t have particular posts to point out, just read everything they write. ...

May 23, 2005

Object-oriented PHP

In spite of my own fears and warnings from others about the limitations of using the object-oriented features in PHP 4, I plowed ahead this week. In the reporting system I’m working on, I finally got to a point where I needed more structure than include files and functions. Object-oriented systems have three characteristics, encapsulation, polymorphism, and inheritance. I won’t go into the boring details of what each of these characteristics involve, but suffice it to say that I’m only using the object-oriented features of PHP to take advantage of one of them – encapsulation. At this point in my programming career, I find it nigh on impossible to deal with complexity without bringing encapsulation into the picture. A few weeks ago, I mentioned a problem I was having involving reports that include outer joins. Once I had solved the problem, I realized that I had a whole bunch of code that was used to convert the represenation of the data in the database to the representation used in the reports. Then I had a whole different bunch of code that’s used to create the where clauses for the queries that generate the reports. In the Java world, all of that stuff is hidden away in nice private methods so that they aren’t exposed to the rest of the application. Unless you start travelling down the path of object-oriented PHP, that same functionality pollutes the core namespace of your application. The functions are bad enough, but the real problems come into play when it comes to variables. You get into a situation where you pass ever increasing numbers of arguments around, you start using the global keyword everywhere, or you start abusing associative arrays really badly. In any case, you are liable to run into trouble. There are two downsides to OO PHP. The first is that it’s obviously an add-on. My core logic isn’t object-oriented – it lives in a page. It just brings objects to the party as it needs them. The second is that the syntax is pure torture (at least in PHP 4). I still don’t fully understand all of the implications of using references to pass objects around by reference rather than by value, and the necessity of using $this everywhere within a class is painful. Finally there’s the matter of not getting compile-time checking when you reference a property in an object like $object->property. I still don’t know what that’s about. In fairness, I haven’t investigated PHP 5, which may address some or all of these problems. In any case, in spite of the awkwardness of OO in PHP 4, I recommend its use if you want to stay sane. ...

May 20, 2005

Words to live by

Ruby on Rails creator David Heinemeier Hansson on problem solving: If you can get those magical 80% of the solution for 20% of the effort, how about just finding a way to cope with the missing 20% of the solution? If you can, you get to solve five easy problems (with comparable value) instead of solving one hard. Oftentimes this is the right answer. In terms of software development, the question is whether the remaining 20% gives your project or company a strategic advantage over everybody else. ...

May 20, 2005

Google supports Maps hacks

The O’Reilly Radar reports that there’s support within Google for the maps hacks that have been popping up everywhere.

May 19, 2005