Wednesday, October 31, 2007

Google Tech Talk: Plurilingualism on the internet

Google hosts a surprising number of really interesting tech talks about language. Back in July I attended a particularly good one by Stephanie Booth, about plurilingualism on the internet. Here's the abstract:

More people are multilingual than purely monolingual. Yet the internet is a collection of monolingual silos. Where are the multilingual spaces? How can online applications assist the people who bridge the linguistic chasms, instead of hindering them? How do present applications decide what language to present? IP address or keyboard locale detection are clearly bad solutions. How could this be done better? This talk addresses some localization issues, but beyond that, questions the very way languages are dealt with on the internet.

It's definitely worth watching in full, but if you want the highlights, these are some of the more interesting ideas I took away from it:

  • Code-switching! I'd forgotten there was a term for it. Code-switching is awesome, especially as a form of word-play. Everyone should try it.
  • Stephanie is multilingual, and when she blogs she prefaces each post with a short summary in the language in which it wasn't posted (that is, posts in English get a synopsis in French, and vice versa). This lets her reach two language communities at once, without the tedium and mess of double-posting each post in full. Check out these recent examples.
  • "Some people really resent being shown languages they don't understand."
    Google develops software with a global reach, and we put a lot of care into trying to make sure users get our products in the right languages; but this quote was an interesting reminder that getting it wrong can provide a very negative experience for a particular user. Right now, for example, we use IP address as a factor in determining which version of Google search to show. If you're browsing from a US IP, we'll show you www.google.com in English; if you're browsing from a French IP, we'll show you www.google.fr in French. But what if you're browsing in Switzerland? We'll show you www.google.ch, but should we show the German, French, Italian, or Rumantsch version? We generally default to German, which—statistically—is the right answer, but for all the French/Italian/Rumantsch speakers is clearly the wrong answer. And what about someone from China who's road-tripping across Europe? She's probably going to want to see Google in Chinese, rather than being served a different language every time she logs on.
  • The lang and hreflang attributes are underutilized and offer some really cool potential for ways of understanding documents and hyperlinks. The most common use of lang is in the <html> tag, to define the language of an entire webpage: <html lang="en-US">. But you could also use it to define smaller subsections: stick it in a <blockquote> tag when you're quoting a different language; stick it in a <div> or a <p> if you have a section of text in a different language (for example, a summary at the top of a blog post!).

    The hreflang attribute is even more interesting to me, since I'd never heard of it before. From W3C:
    The hreflang attribute provides user agents with information about the language of a resource at the end of a link, just as the lang attribute provides information about the language of an element's content or attribute values.
    So if you link to a cool website in Spanish, you could throw <a hreflang="es" href="www.example.es"> in the <a> tag. The thing about these attributes, though—especially hreflang—is that they're underutilized because no technology takes advantage of them. But no technology takes advantage of them because they're underutilized. If we ever find a way to break out of this Catch 22, I could imagine some cool opportunities (visualizations for language targets, applications in search and social networking... the sky's the limit!).

Saturday, October 27, 2007

Jet City: Derby of the Dead

Just got back from Derby of the Dead: a doubleheader of Black vs. Blue (two mashup teams of Jet City rollergirls), and an invitational match between the Sacred City Derby Girls and Jet City's new travel team, the Jet City Bombers.

The Black vs. Blue bout was pretty evenly matched, and some decent derby. But the real action was in the invitational. Sacred City is all but undefeated (I heard they've only lost once—to Rat City), and this was the Bombers' first bout as a team, so perhaps a defeat was to be expected. But the match ended with nearly a hundred-point spread (ouch).

Sacred City pulled ahead right at the beginning; they had a few star blockers and some solid jammers. But I think what really won the game for them was their defensive coordination combined with Jet City's inability to learn from their mistakes. SCDG were great at controlling the front of the pack, so that every time their jammer made it halfway through the pack she had nothing but her own girls ahead, and they could just whip her through; whereas the Jet City jammers were constantly getting stuck behind a wall of two or three Sacred City blockers at the front of the pack, and the rest of their blockers hardly ever stepped up to try to break that wall or help their jammer through. On the few jams that they did make an effort to match Sacred City at the front of the pack, they did much better as a team, and held the score even for a few jams before falling to the back of the pack again (and sliding back down the scoreboard).

Sierra Fist did some really awesome jamming for Jet City, but unfortunately her best jam got discounted (the time got put back on the clock and the points taken off) because it was decided that Sacred City's jammer had been incorrectly sent to the penalty box, where she'd spent most of that jam. And Ta Ta Tina (who used to skate with my squad!) was getting in some really solid blocks [edit: apparently I'm an idiot; she was skating for the Blue team at this bout, not the Bombers; but she was still rockin']. But as a team JCRG's coordination and strategy just wasn't enough. They also weren't using the lead jammer position as strategically as they could have: every time a Jet City jammer broke out ahead of Sacred City's jammer, she'd just keep skating (probably trying to make up the point difference), but that usually just gave Sacred City a chance to catch up and match the points Jet City had just scored. Hopefully JCRG will be able to analyze this game after the fact and get some good takeaways and strategy from it.

One thing I didn't like was that Sacred City seemed to have a bit of an attitude. Perhaps the standards for bout behavior are different in California than up here; but it seemed like their team was constantly arguing with and yelling at the refs, questioning every call, and their skaters were swearing and giving the finger when they were called out. I totally get that derby is an aggressive sport, but some of it seemed in bad taste to me (especially for a team that was so obviously winning). They even had some fans and statskeepers in the bleachers next to me who were laughing at and mocking the Jet City skaters. Sure, some friendly trash-talking is all part of the bargain, but making fun of people for falling? or for what they're wearing? I thought derby fans were better than that.

My final gripe was that the score whore this evening was pretty disappointing. She wasn't even on skates (!), and she looked completely disinterested in what was going on. She could've been walking on a treadmill instead of around a derby track, for all it registered on her face.

To end on a positive (if not entirely derby-related) note, check out this most excellent skating video I just came across. I think this beats even the Google ball pit:

Friday, October 26, 2007

Solving Tough Problems: Timezones and DST

I spent all my time putting out fires this week, and none of my time adding cool functionality. The trouble really started when I tried solving what I assumed to be common problems. But of course, when I tried to figure out how other people had dealt with these problems, I ran into a brick wall. Well, not a brick wall actually. Instead I found lots of "solutions". All of which took me forever to realize they had nothing to do with my problems.

The disaster actually started out as planned. I was working on some functionality dealing with calendar data (which is a difficult subject). This should be a simple thing. You've got a user in one time zone and another user in a different one? No problem. This isn't exactly a new problem. There should be support for such a thing in all this advanced technology. And it should be very natural to convert between them. And it should be natural to work with both computer oriented times as well as human oriented times. By which I mean the ridiculous practices we have of leap years, leap seconds, timezone offsets, and daylight savings times.

As it turns out, I needed to find different solutions for two operating systems, and three computing platforms (and I'm not even doing much AJAX yet). Just to give you a quick overview, most of the problems arise around counting the number of seconds in a day.

There's 86400 seconds in most days. But things get hectic with leap seconds and more importantly daylight savings time (which adds or subtracts an hour from two days a year). PHP provides the function strtotime which lets you do stuff like strtotime('+1 day') to add a day, taking into account daylight savings time so that today at 6:00am "+1 day" is 6:00am tomorrow. Combine this with date-default-timezone-set and you're ready to go, no matter where your users are.

Python, smug as always [ed: I love python], provides a timedelta class, assuming 86400 seconds in every day. This is as opposed to being timezone aware (even if you install and correctly use pytz). And it gets worse. You can convert from a UTC timestamp using the handy method datetime.fromutctimestamp. But how do you convert back? Is there a datetime.toutctimestamp? No, there isn't. What about the traditional mktime? That's only going to work if the datetime you're working with is in the system's timezone. And don't even try converting your datetime to the system's timezone. The only way to access the system's timezone is time.tzname which is non-standard and incompatible with pytz. I ended up using a combination of calendar.timegm and datetime.utctimetuple. No searches I tried found this solution.

Don't even get me started on MySQL. Check out this article on timezone support. And take a look at this list of date/time functions. But don't try using the timezone db they've got for download. It was inconsistent with all the olson zoneinfo databases I saw. I had to use mysql_tzinfo_to_sql on a Linux system and copy the resulting SQL script to my Windows box and apply it manually (mysql -u root -p mysql < zoneinfo.sql).

That's probably enough geeking out / ranting for this week. Next week I'll tell you about how I solved my very unexpected "(13)Permission Denied" / "403 Unauthorized" / ".htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable" / "No input file specified" errors.

Thursday, October 25, 2007

Answering an age-old question

Which came first, the chicken or the egg? What is the sound of one hand clapping? And what happens when you give 16 Googlers ice cream, two limousines, two hours and no agenda?

Why, they go to Microsoft, of course. :)

Google Kirkland recently held an office decoration contest to celebrate our expansion into a new building in Kirkland (we Googlers are fond of office decorations). The Webmaster Tools team won by a landslide. Our prize? A limo ride to the local Ben & Jerry's shop, and ice creams all around. But we had the limos for two hours, so we decided to use the extra time to swing by Microsoft's Redmond campus to see if we could get a sneak peek at the beta version of their Webmaster Portal.

Google Webmaster Tools team at Microsoft

In the end we didn't make it much farther than the lobby (due to not knowing the last names of any of their team members), but good times were had all 'round.

Have a funny story about a team outing? Photos of your quirky office decor? Share them with us!

Tuesday, October 23, 2007

You say potato, I say linguistic train wreck

While checking out the new search queries data in Google Webmaster Tools this week, I noticed that I rank #2 for [separate wheat from chafe] (thanks to my last grammar rant). I was all ready to draft a follow-up post in the hopes of reaching a few more unenlightened searchers:

  • e + s is not pronounced [ex].
    So stop saying 'excape' instead of 'escape', and please stop saying 'expresso' instead of 'espresso'. Look it up. Really. It's espresso.
  • fiancé != fiancée
    If you choose to use the French word for "person to whom I am engaged", please be aware that (although they sound the same when spoken) there are two versions of the written word: fiancé is masculine, fiancée is feminine. A pre-husband is not a fiancée, nor is a pre-wife a fiancé, unless there's something they haven't been telling you.
  • nuclear
    I might be able to forgive him for stealing the election... twice... invading Iraq, ruining our international reputation, destroying the environment, attempting to constitutionally ban gay marriage, running our debt sky-high, and spending most of his time on vacation, if only Bush would stop saying 'nucular'. There's no vowel between the 'c' and the 'l', buddy. It's 'new' + 'clear'.
    ...Though on second thought, I probably wouldn't forgive him even then.

Yup, I was ready. But then I saw this article on YOUmoz. It argues that one man's grammar tragedy is another man's wordplay (using the examples of mondegreens, snowclones, and eggcorns):

You'll find these linguistic occurrences are popular on satirical websites like Fark and SomethingAwful, in cartoons and TV comedies, on the radio and in movies. Custodians of grammar may frown at the decay of 'proper English' but the laziness of online writers is a boon for observing the hyper-evolution of our language.

I shelved my draft and lamented having become a codger at 25.

But I think this commenter summed it up well for me: it's not that I don't like change in language. I love linguistic puns, code-switching, and other creative forms of breaking the "rules". I love hearing language twisted for clever or comedic effect; I just don't like hearing it twisted out of ignorance.

My phonetics professor in college used to dream of the day when everyone would learn the IPA (International Phonetic Alphabet) in school and mispronunciation would become a thing of the past. News anchors would no longer hesitate over the pronunciation of foreign names. You would no longer be asked to phonetically transcribe your name using English characters (most frustrating exercise ever!) so that the principal can read it out correctly at graduation. And Wait Wait... Don't Tell Me! wouldn't get to make fun of Bush for needing a phonetic cheat-sheet in his speeches.

While we're on the subject of language, I found this article on the language of the Berkshire Hathaway annual report both insightful and reassuring. At least I'm not the only neurotic out there.

Sunday, October 21, 2007

Dumbledore is gay!

Wow! Did anyone else see this one coming?

Rowling said Dumbledore fell in love with the charming wizard Gellert Grindelwald but when Grindelwald turned out to be more interested in the dark arts than good, Dumbledore was "terribly let down" and went on to destroy his rival.

That love, she said, was Dumbledore's "great tragedy".

I can't wait to see the conservative response... now Harry Potter promotes both paganistic devil-worship and homosexuality! As Bush would say, that's a double whammy.

Saturday, October 20, 2007

Google Experimental (who knew?)

One of the things I love about Google—and that drives me a little crazy—is that they're constantly coming out with so much cool stuff, both big and small, that it's hard to keep up with it all. I'm loathe to say impossible (since sites like Google Blogoscoped do a pretty bang-up job), but I'd rather spend my free time listening to NPR or playing cards than stocking up on Google press releases. So I miss a few things here and there.

Just last week I found out about Google Experimental: Google is constantly running experiments on their search pages, but usually you only stumble into them by chance (and often don't know you were in one until you think about it later and go "Wait a minute, did I really see [whatever] on that SERP?"). But apparently, with Google Experimental you can explicitly enroll yourself in certain experiments to try out new features that Google is testing for search. Cool, huh?

Looks like it's been in Labs since May. Apparently I live under a rock.