Archive for March, 2007
The lawyers win, again
March 27th, 2007My new Trek bike came with not one, not two, but three warning stickers. They difficult to read, state only the obvious, help no one, and leave an annoying, gooey mess when you remove them.
I wonder if bikes in other countries have to be covered with crap like this.
Ladies and gentlemen, start your bicycles
March 25th, 2007Paris is about to get what could be the world’s largest Yellow Bike Program(ish):
On July 15, the day after Bastille Day, Parisians will wake up to discover thousands of low-cost rental bikes at hundreds of high-tech bicycle stations scattered throughout the city, an ambitious program to cut traffic, reduce pollution, improve parking and enhance the city’s image as a greener, quieter, more relaxed place.
By the end of the year, organizers and city officials say, there should be 20,600 bikes at 1,450 stations — or about one station every 250 yards across the entire city. Based on experience elsewhere — particularly in Lyon, France’s third-largest city, which launched a similar system two years ago — regular users of the bikes will ride them almost for free.
San Francisco, it’s your turn now.
US border crossings worse than middle east
March 25th, 2007In the Seattle Times, Floyd McKay laments the unfriendly US border:
In a reputable international survey, 39 percent said the U.S. was the world’s worst in terms of being traveler-friendly, including document processing and “having immigration officials who are respectful toward foreign visitors.” The Middle East and South Asia were “next worst,” at 16 percent. Canada was cited by only 2 percent.
This survey, by Discover America Partnership, an advocacy organization for America’s tourism industry, confirms what a lot of borderites already know — we seem to go out of our way to insult, intimidate and discourage visitors. We’ve gone across the border with Scottish friends, middle-aged professionals who were pulled out of line, rudely questioned and kept waiting for no apparent reason. One friend, after witnessing U.S. border agents harass an East Asian family, said it reminded him of his native South Africa.
Understanding user needs…in Africa
March 22nd, 2007Jakob Nielsen, look out. Parker Mitchell has a few things to say about the importance of understanding user needs:
In particular, we will propose that the efforts of people in this room ensure that technology development efforts better incorporate the
- functional,
- economic and
- social/culture
realities of prospective users. In my case the “users” are rural Africans, in your case they may be different, however I think the same focus and principles apply.
1. Understanding the user’s cultural/social context
Let’s take the example of an improved brick press, a technology we were working with with a partner in Zambia.
This technology produces a compressed earth and cement brick that is as good as a cinder block yet as uses 1/16th the cement and so is much cheaper. Our partners were trying to determine why more units aren’t selling, as there are innumerable walls for which this compresses earth brick would be perfect. It turns out that users and engineers have a different definition of wall. To an engineer it is a structure preventing people getting from A to B – in which case the new, cheaper brick is much better. To Zambians, it turns out that a wall is a status symbol; having a concrete wall brings more prestige than any other type of wall. As a result, homeowners aren’t interested in this brick maker.
Wendy Seltzer v. the NFL
March 22nd, 2007Wendy Seltzer, a former EFF attorney and current professor at Brooklyn Law School, posted a clip of the NFL’s copyright notice to YouTube as an example of fair use.
Pursuant to the DMCA, the NFL’s bots find the clip and send YouTube a takedown notice. Wendy then sent a counter-notification and YouTube reposted the clip.
Guess what?
The NFL took the clip down again, sending another takedown notice instead of following proper procedure:
The DMCA way for NFL to challenge that, per 512(g)(2)(C), would be to “file[] an action seeking a court order to restrain the subscriber from engaging in infringing activity relating to the material,” which they haven’t. Sending a second notification that fails to acknowledge the fair use claims instead puts NFL into the 512(f)(1) category of “knowingly materially misrepresent[ing] … that material or activity is infringing.”
What next?
BPW’s ugly web site
March 21st, 2007Hello, BPW? 1995 called. It wants its web site back.
Craigslist suggestion: pause and resume listings
March 6th, 2007Here’s a feature suggestion: I’d like the ability to pause and resume a post on Craigslist.
Here’s the scenario:
- I post an ad in free stuff
- I get 10 responses immediately
- I want to stop getting responses until I can deal with the ones I’ve already received
- If I delete the ad, I can’t repost it for two days (it gets flagged as spamming)
It would be nice if I could pause the ad, either until I resumed it, or for a fixed period of time (1, 12 or 24 hours).
I emailed Craig a few months ago. Perhaps if he gets more requests, they’ll implement this.
MySQL database backup script
March 3rd, 2007I wrote one of these for Mailman last fall, and finally got around to putting together a quick script to back up your MySQL databases. It optimizes and repairs all of your tables, then creates a directory for today, dumps each database into a SQL file and zips it up, leaving you with a directory of .tgz files.
The script requires the Python MySQL module. If you’re using DarwinPorts, port install py-mysql; on Debian, apt-get install python-mysqldb. With fink, install mysql-python-py24 (or mysql-python-py23, or mysql-python-py25, etc.).
The script is called mysqlBackup.py, and its syntax is pretty straightforward:
Usage: mysqlBackup.py <backuppath> <password> [<user>] [<hostname>]
If the username isn’t specified, it defaults to root. Likewise, the host defaults to localhost.
Typical use would be to place a helper script like this /etc/cron.weekly:
#!/bin/sh
/usr/local/bin/mysqlBackup.py /home/backups/mysql/ mypassword
mysqlBackup.py is available under a CreativeCommons-Attribution license.
JavaScript date validation
March 2nd, 2007I was searching the web for JavaScript date validation code. All I found were lots of really bad ideas. Some were quite complicated. John Gang was on the right track. I didn’t see Chris Hogben’s article initially, but he used the right algorithm.
Still, nobody offered the complete solution. Given a date string YYYY-MM-DD, is the date valid?
The smart way to do this is to (a) parse the date string with a regular expression, (b) construct a date object and (c) compare what you got out of the date object to what you put in. To make this really convenient, we’ll use JavaScript’s proptotype functionality to extend the String class, making this available to any string:
var IsoDateRe = new RegExp("^([0-9]{4})-([0-9]{2})-([0-9]{2})$");
var matches = IsoDateRe.exec(this);
if (!matches) return false;
var composedDate = new Date(matches[1], (matches[2] – 1), matches[3]);
return ((composedDate.getMonth() == (matches[2] – 1)) &&
(composedDate.getDate() == matches[3]) &&
(composedDate.getFullYear() == matches[1]));
}
Here’s the method in action:
alert(a + (a.isValidDate() ? " is a valid date" : " is not a valid date"));

