25 January 2009

the chatterböxen story

I have just launched the beta of Chatterböxen, my ephemeral, anonymous chat program (with tightened-up graphics). Chatterböxen began as a simple attempt to create an AJAX chat with jQuery, but quickly evolved into the current look and feel, with words and phrases floating in a bright white space.

I developed the very first incarnation while I was working at VSA a couple of years ago, and wrote it in PHP with a MySQL backend to store the messages. This was fun to show to a few friends by hardly efficient enough for the big-time, and it was also extremely buggy and susceptible to hacker attacks. I showed it to some coworkers and a few friends and then shelved it.

As part of my new years resolution to bring all of my side projects online, I began working on chatterböxen again a few weeks ago, as a ruby on rails project. It was very effective and easy to write that way, but it was too bulky. Rails is a wonderful framework for a lot of different kinds of website, but it's far too complicated for something like this. I had just learned about the Sinatra framework, which runs with Rack and a few other libraries to produce super simple, one-file web applications. I'd seen a blog implemented with Sinatra in less than a couple hundred lines and I was intrigued.

Rewriting Chatterböxen in Sinatra turned out only to take a single afternoon, ajax bells and whistles and all. A few further refinements, and now I am officially announcing that it is in beta and y'all should all go look at it and poke around for a few minutes. Within the next day or two I should have an improved backend solution implemented, and an FAQ on the site for people who are confused or having issues. Also, there is a facebook page! Despite my own reservations about it, this is a thing and it is happening. Go check it out, space cadets.

11 January 2009

a curious computer science problem

I was discussing linguistics with my esteemed colleague and close friend Alex English earlier when I stumbled upon a very interesting computer science problem: the generation of grammatically-correct, semantically meaningful palindromes. The minute I typed my message about it I regretted it, because my immediate impression was that this is an extremely difficult problem.

We have to sort of reign it in just a little and make the problem more generic, too. So, let's say that we have one language P, a subset of a more generally-defined language comprised of only those recognizable phrases which are palindromes. It's fairly easy to arbitrarily generate phrases from a given grammar and lexicon but doing so in such a way that it remains a palindrome is somewhat challenging, but doing so in such a way that it remains syntactically correct is what we're interested in here.

Consider the following simple grammar:
S -> A
A -> x A
| x
This grammar only generates strings of x's, so of course it only generates palindromes, and it can also generate arbitrarily-long strings. This is a patently ridiculous grammar but it does demonstrate one issue: how do you prove that your grammar even has a maximum-length palindrome? Consider the following grammar:
S -> A
A -> x y A
| x y
That grammar produces an infinite number of phrases, none of them palindromes. How complicated is it to prove the existence or nonexistence of palindromes in a well-defined language?

Because it reminds me of some aspects of the Busy Beaver Problem, perhaps a version of the Busy Beaver Problem for push-down automata. If anyone's heard of it or better yet a proof of its complexity, let me know.

Thinking too much as always. Sleep tight, space cadets.

08 January 2009

2008: a retrospective

I'm looking forward to 2009 mostly because I'm glad to see 2008 be finished forever. The politics and the economics of 2008 were just about the worst I've seen in my lifetime. The 2008 primary—at least on the Democrats' side—got super messy. I was behind Obama from the very start because I live in Chicago and that's just how we do; we support our own. Even before his campaign I was impressed with his rhetorical skills, and I agreed with a lot of his politics as well. I disliked Hillary because I saw that since the Clinton presidency she'd been working towards occupying that seat herself, but it always seemed to me that it was for her own glorification that she did it. Sure she would probably do a good job, but that would mean that for my entire lifetime every US president will have been from one of two families, and that just seemed wrong to me.

Meanwhile I got laid off from my job last summer, which didn't surprise me but it still pissed me off. I didn't mind because I really saw Fave as a company adrift. Working there was like living out someone else's mid-life crisis. The owners were amiable and well-meaning enough but at the same time they were two men completely out of their league who, though they had surrounded themselves with people who knew what they were doing, often refused to listen. It angered me but I knew that I would fare better than they would in the long run, so I struck out on my own freelancing and pretty immediately got snatched up by an agency. I've made it to 2009 just fine but I hear interesting rumours coming from Fave lately.

The presidential election last year produced a curious mixture of feelings for me. On the one hand I felt so very proud of this country and, in a way, this city, when Obama won the nomination and especially when it started to look like he was going to win. The Republican side just made me feel ashamed for this country. In the 2008 election we saw that the Republican party has become a party of only three issues: abortion, gay marriage, and teaching evolution in schools. The 2008 presidential campaign was the ugliest I've seen in my entire life and I've been paying attention for a long time. To me my choice was clear and it had to be Obama, because to me he represented everything I liked about America, particularly the notion that you really can raise yourself up from poverty to Presidency here. Having up 'til then lived a life dominated by Bushes and Clintons (except a couple of years where there was a Reagan, but I was like two years old whatever), I had never gotten to witness that happening. John McCain, married to a trophy wife he ditched his old wife for when she got in an accident, son of a wealthy admiral, just did not give me that same impression. He never seemed like he knew what I, as a member of the middle class, go through on a day to day basis to make ends meet. But the real show-stopper there was his bewildering choice of Sarah Palin, a virtual unknown from Alaska whose uncouth "you betcha!" perkiness made me cringe visibly. It was at that point that I almost felt like it was McCain's way of bowing out. When he picked her for VP, it seemed like he was throwing the fight. A sort of dejectedness settled over the McCain camp and it really seemed that by the time election night rolled around, they had long given up.

Speaking of which election night was an amazing night for me. It's rare that you come upon a moment in history and in your life that you think afterwards, I will remember this forever. I think that I will, too. I was in Grant Park and I witnessed first-hand the election of the United States' first President of any colour besides white as all hell. That alone was reason to be excited, but in addition the election of Barack Obama meant the possibility we could break free from the kind of divisive, fear-based politics of 2000–2008. That's really the one thing I will miss the least about 2008: the bullshit fearmongering. I'm not saying that all the Fox News anchors are out of a job just yet, but I think we are about to see a major change in how the White House views the world and the American people.

One of the horrors of 2008 continues still: the economy. In 2008 we saw a house of cards forever on the precipice of implosion finally fall, and I suspect most of the people who built it up knew how fragile it was. In the interest of furthering the interest of a "free" market, the powers that be left the rest of us out in the cold. As a consequence of losing my job at Fave and also the beginnings of the economic downturn, I lost a mortgage on a condo I was planning to buy. In the end I think that was a good thing because I wouldn't want to be saddled with a huge mortgage at a time like this anyway, but it still sucked. I'm seeing more friends than ever getting laid off, and the more I think about it, the more I realize we're gonna be feeling this for a while. This isn't an ordinary recession at all. It feels like a depression. Here's to 2009 being better I guess.

Keep hope alive, space cadets.