Gordon P. Hemsley

Linguist by day. Web developer by night.

Archive for February, 2010

Calling all HTML5 and Bugzilla enthusiasts!

Posted by Gordon P. Hemsley on February 20, 2010

Earlier in the week, I went through the process of filing and fixing bugs 546338 and 546340, both related to fixing <a name> problems in Bugzilla. Once that was successful, I got the idea to do a major overhaul of the Bugzilla templates in order to upgrade them from HTML4 code to HTML5 code (sans presentational markup, which Bugzilla has a ton of). I’ve filed bugs 546838, 547171, 546353, 547311, and 547389 for this purpose.

After spending a few days attempting to accomplish something, under the very helpful and reassuring guidance of Max Kanat-Alexander, I realized that it was a bit much for one person to take on. The sheer number of instances of presentational markup (and I only got so far as looking at @align, @cellspacing, and @cellpadding) is quite overwhelming.

But then I thought: This would be a perfect series of bugs for ‘student-project‘; that is, the keyword used to attract open source students to specific bugs that they can tackle during a semester. If we can get a group of students together, along with myself and Max, we can probably accomplish this much quicker.

If you’re interested in helping out, or you know a student who may fit that description, drop by #mozwebtools on irc.mozilla.org and ping GPHemsley or mkanat.

Posted in Mozilla, Web Development | Tagged: , , , , , , , , | Leave a Comment »

PHP, MySQL, and the BIT field type

Posted by Gordon P. Hemsley on February 8, 2010

As Dave Humphrey once taught me:

When you do a search, and it comes back with no results, it’s a sign that you need to write something.

This is an issue that I came across while testing SASHA (which is available for you to try out, by the way), and I didn’t know if it was a bug or a feature. I could find no mention of it anywhere, and the people in the #mysql IRC channel on FreeNode weren’t especially helpful in helping me get to the bottom of it.

What is the issue, you ask? Well, even that in and of itself is a question, because I don’t know whether it’s a bug (or feature) in PHP or MySQL. However, I’m inclined to think it’s the latter, and I’ll get to why in a moment.

But first, some background. The table that SASHA uses to store schedules uses the BIT field type for keeping track of which days of the week a schedule occurs on. I figured it’d be easiest to use a 7-bit field and just flip a bit for each day of the week. And that worked fine for me on my local test server. But then I had a colleague test SASHA out on his test server, and things went a little wacky.

It took a little while to figure out what was causing our problem, and we finally got to the bottom of it: I was using MySQL 5.0 and he was using MySQL 5.1! Apparently, between 5.0 and 5.1, the return format of a BIT field changed from the literal binary data (output in the browser as a character, because the browser didn’t know it wasn’t) to a decimal representation of that data.

The first problem with that was that I had no idea there was a possibility of getting anything but the raw binary data I was getting on my server. The second problem was coming up with a straight-forward solution to detecting whether the database was feeding us raw binary data or converted decimal data. There was no direct way to do this, but I figured out the next best thing. A simple way to check what kind of data we’re getting is to find out whether it converts cleanly to an actual character. Here’s an excerpt from SASHA that demonstrates:

// MySQL 5.0 returns bit as binary, while MySQL 5.1 returns decimal
if( $days == chr( ord( $days ) ) )
{
	$input = 'binary';
}
else
{
	$input = 'decimal';
}

That seems to do the trick when it comes to handling unpredictable BIT field data.

(Again, I can’t guarantee that this isn’t actually a PHP issue, but I seem to recall us both being around the same version of PHP.)

If you have any insight into the matter, please do leave a comment.

Posted in Mozilla, Open Source, SourceForge | Tagged: , , , , , , , , , , , , , , , | 4 Comments »

“Patton and I”—Object or Subject?

Posted by Gordon P. Hemsley on February 2, 2010

[Note: I know I haven’t posted in a while. That’s the kind of relationship I have with my blogs. I also know that, when I do post, I post about computer stuff. But this is my blog, about my life. And my life also involves linguistics stuff. So here’s the first of what will likely be a number of posts relating to linguistics. If that bothers you… deal with it.]

Last night, while at the Grammys, Al Yankovic (you know, Weird Al) tweeted a picture with a caption that read:

Patton and I having a last-minute brawl before the show.

Knowing that he is usually as much of a stickler for grammar as I am (perhaps even moreso), I tweeted to him:

@alyankovic Patton and *me*, Al. Come on! You know better!

I was hoping to get a response from him, but I instead got a response from Jacinta of New Hampshire. (Not having much evidence to go on, I’m going to assume this person is female for the remainder of this post.) Here’s what she said:

@GPHemsley sorry, but Al is right… it’s Patton and *I*

To that, I replied with:

@Jacinta716 Not it’s not. “Patton and I” is the object of the untensed sentence fragment, so it should be “Patton and me”. #linguistics

As an aside (and another attempt to get Al to weigh in), I also tweeted:

I may have just started a grammar war on Twitter about a simple caption for a photo @alyankovic took. #linguistics

After that, Jacinta really let me have it. She devoted five tweets in a row to supporting her claim:

@GPHemsley “Patton and I” is the SUBJECT of this sentence; Al is correct.

@GPHemsley You use the same pronoun as you would if you had a singular subject in the sentence.

@GPHemsley Patton is texting like a 12 year-old girl. I am texting like a 12 year-old girl. Patton and I are texting like 12 year-old girls.

(I realized later that this was referencing another tweet that Al had made afterwards.)

@GPHemsley “Patton and I” is not the object. If you said “someone is throwing incorrect grammar rules at Patton and me” then you’d be right.

@GPHemsley “Patton and I” is not part of a sentence fragment. Although this is. And so is this. Which is why Al is right. And you are not.

And then she added:

@GPHemsley I wouldn’t call it a war. It’s…an educated discussion. It’s a lot better than most of the crap that people put on Twitter! 😉

Originally, I started tweeting back to her:

@Jacinta716 “Patton and I” is not the subject of the sentence. The subject of the sentence is implied; it refers to the picture.

@Jacinta716 The difference with these examples is that they are tensed. In that last sentence, “Patton and I” is indeed correct.

I was going attempt to diagram the sentence using bracket notation and go on to further support my claim. But when I went to phpSyntaxTree to diagram it for real, I realized I had a problem. The way I was diagramming it did indeed put “Patton and I” in the subject position of the subordinate sentence (which is still untensed):
[S [NP This] [Aux ] [VP [V is] [NP [NP a picture] [PP [P of] [S [NP Patton and me] [VP [V having] [NP a last-minute brawl]] [PP before the show]]]]]]
However, the point of view I was arguing was that the picture itself was the subject and “Patton and I/me” was the object. (I originally tweeted the sentence that included the implied part, but I later deleted it. I used that sentence in the diagram.)

Now, here’s the problem. I still think I’m right in saying that “Patton and I/me” is the object of the sentence and that it should be “me”, not “I”. But right now I’m at a loss to explain why. It doesn’t help that my diagram doesn’t take full advantage of X-Bar Theory and its extensions/improvements (and, thus, uses ternary branching to attach an adjunct), nor that I haven’t drawn the semantic relationships between words. But I wanted to get this down in a format longer than 140 characters so that a proper discussion could be had.

So… Is “Patton and I/me” the object or the subject? Is it both? Is there a different implication that could be had that could change the answer to those questions? What is the grammar of picture captions, specifically, and sentence fragments, in general?

This post seems to raise more questions than it answers, but it’s quite likely that I’ve made a mistake somewhere in my diagram that would lead me down this path. Please correct me if you can. Otherwise, let the discussion begin!

Posted in Linguistics | Tagged: , , , , , , , , , , | 3 Comments »