Archive for April, 2005

Kung Fu Hustle

Monday, April 25th, 2005

I went to go see Kung Fu Hustle yesterday, and it turned out to be the best movie i’ve seen all year. Granted, I haven’t seen many movies at all this year, but this one was special. The comedic timing was perfect, as were the many nods to American cinema. It’s essentially a similar cast as Shaolin Soccer, so the kung fu on display is pretty breathtaking. Even so, if it were any more tongue in cheek, it would look like a squirrel.

If you enjoy kung fu or Hong Kong cinema at all, you owe it to yourself to go see Kung Fu Hustle. It reminds me of all the great H.K. kung fu comedies of the 90’s that I saw when I was restless from jet lag in Beijing, except this one shows that a big budget doesn’t spoil Stephen Chow at all. In fact, this is one case in which the special effects truly add tremendously to the absurdity factor and catapult it into the top place in my movies list.

“Social” Services as an Inversion of Traditional Privacy

Wednesday, April 20th, 2005

It occurred to me today that by using public (or semi-public), social services for bookmarking (del.icio.us), tagging, event listing (Upcoming.org), and goal listing (43Things), i’m essentially taking information that I would traditionally hate a company to have, and making it publically available.

With tagging, i’m even taking care of classifying and organizing my traditionally private information - what i’m interested in, where I’m going, what i’d like to do.

My usual attitude towards data mining is that it’s a bad thing for privacy. So what does that mean when I don’t want companies like Choicepoint compiling general personal information? It’s an aversion to any company trying to aggregate information about me without my consent. It’s creepy to think that my old addresses and phone numbers are on sale for the highest bidder. What else might someone be able to buy?

But then, I look at my use of del.icio.us, and it’s almost like a sort of cognitive dissonance. I’m basically providing a public profile of keywords that i’m interested in, connected to both my real name and my personal blog. I look at Upcoming, and there’s a list of events that i’m interested in, along with keywords associated with those events. Taking a gander at 43Things, and I list goals of my own as well as things i’ve done.

Put that all together - you could theoretically data mine a pretty extensive profile of someone’s online interests by using open API’s from all these services. But it’s not like anyone’s invading your privacy to extract that info - you’re inverting your privacy preferences by putting it up for the world to see in many cases.

Sure, you might limit it to FOAF in certain privacy-aware networks, but it’s still centralized somewhere.

But is it outweighed by the community usefulness of such tools? I think it’s worth it to consider for a second that all information you’re publishing and tagging on these services is basically public information. But it’s so handy, that I’m almost okay with it.

Check this week’s Upcoming.org events in Perl!

Monday, April 18th, 2005

Hey developers,

I whipped up a quick perl script using Greg Knauss’s Upcoming CPAN module (should be released by the time you read this, and if not, then soon). The module is called WWW::Service::Upcoming::API, and it’s pretty badass. It handles all the negotations and REST parsing for you, and it would be awesome if a lot of development took off with it.

This script looks up your metros by the username and password you provide. It then searches through events in those metros that start in the next seven days, and emails a list of those events in chronological order to you. Feel free to use this script as a starting point for your own creations - it’s pretty barebones, but it actually does something useful. :)

I ended up extending the Upcoming.org REST API somewhat to allow the script work from your username and password, instead of requiring numeric event_id’s. The API now allows you to get a list of metros from your username, so the whole script only makes the minimum number of API calls possible at this moment.

It requires the WWW::Service::Upcoming::API module, Date::Calc, and Mail::Sendmail for the mailing. Here’s a link to the code, which i’m making available via the BSD license. Have fun!

http://getluky.net/code/upcoming-thisweek.pl

Freetag - an Open Source Tagging / Folksonomy module for PHP/MySQL applications

Saturday, April 16th, 2005

Tagging and folksonomy are pretty popular terms nowadays. In a nutshell, the concept is simple - allow users to describe content with descriptive words and phrases, or tags, that can then be used as an informal categorization system known as a folksonomy. The model of tagging has really caught on strong with the blogosphere zeitgeist (as well as tech investment), and for good reason: it works, so far.

Freetag is a module that implements a simple, fairly robust beginning of a tagging and folksonomy system. It works with PHP4 and MySQL 3.23 so far, and i imagine that if it gets popular, it should be easy to port to additional databases and/or languages.

You point it at your users, then you point it at your objects, and use the API to allow your users to tag your objects.

Eventually, it will be extended with a RESTful interface, so that you can plop a gateway PHP script somewhere and get instant access and inter-operation between any applications that use Freetag.

I’ve wanted to do this since my star-studded lunch group started thinking about integrating tagging between sites, and I started off on my crazy plan of creating a lightweight way to decide where to go to lunch. I felt that any site I was going to spend effort in developing should have some sort of tagging / folksonomy support, so i happily generalized the Freetag PHP class in preparation for a time to use it in other projects.

Freetag is now in use in at least one high-profile project - Upcoming.org, where I integrated Freetag within about an evening and a half. Since then, there have been some big improvements to the class, and you can see it in action behind the scenes over there.

For the technical details, head over to the Freetag project page. Or browse through the Freetag API Documentation.

It’s my first ever big contribution to the world of open source, as Freetag is released with a dual BSD and LGPL license. I hope you get some mileage out of it!

Thanks go out to all the people who I bounced ideas off of - Andy Baio, Phil Fibiger, Greg Knauss, Leonard Lin, Christian Newton, the users of eatlunch.at, as well as John Lim, on whose ADOdb for PHP layer I always rely.

Update! I had to make a small change to the library to fix a problem with quoted tags that someone found on Upcoming. I’m sure there will be many more problems found, now that the code is out there, but you should grab the tarball again to get version 0.201, because this is a really annoying bug. Sorry about that! - Sunday 4/17/2005, 10:00 AM.

Resolution Commending the making of Napoleon Dynamite

Tuesday, April 12th, 2005

This is just about the best thing i’ve ever seen.

http://www3.state.id.us/oasis/HCR029.html#daily

(Yes, it’s real)

Stripslashes in Perl

Monday, April 4th, 2005

Just a quick bit of code for reference - here’s a regex to implement stripslashes (a useful PHP function)in perl.

$string =~ s/\\([^\\])/$1/g;

Update: Slashes have been escaped. Thanks, helpy.

Another update: In trying to be clever, this does way more than it should. This seems to work better:

$string =~ s/\\(\'|\"|\\)/$1/g