« May 2006 | Main | July 2006 »

June 30, 2006

On the Red Sox Season Tickets Waiting List

Heidi and I have been talking about getting Red Sox season tickets for a few years, but this year the conversation has gotten a lot more serious. Besides us finding Fenway Park a great place to spend an evening, we've talked about as the kids get older it would be nice to take them to games more regularly, or having access to tickets to give to visitors or friends.

So today I called the ticket office to see just what the process was like and was informed that in 2002 the Red Sox started a season ticket waiting list. The list grew to ~5000 people during a three-year period where they weren't able to accomodate any new season ticket requests. Apparently last year some folks did get a chance to buy season tickets.

There are three season ticket packages, a 10-game package based on day of the week, an evening game package for all evening games, and a full 81-game package. You can choose to be on the waiting list for a specific type of package, or be listed for any that come available. To be honest, a jump up to 81 games would be way to much for us who've never gone more than 5 games in a season, but if the chance comes up we'll see if we can pull together a bunch of folks to split up the season.

Since the waiting list appears to move slowly, I decided that even though we are not fully prepared to be season ticket holders, I'd get on the list. Getting on the list means paying $50 and getting a season ticketholder membership number, just doesn't allow you to purchase tickets.

So I did it, I put down the $50 and indicated that I'm interested in any package that becomes available. The person I talked to said that generally, the tickets becoming available are in the bleachers and outfield grandstand. Once you are a season ticketholder you can work your way to better seats by upgrading as seats become available.

So who knows, I think best-case scenario is we'll get a 10-game package next year. What's probably more likely is that we'll be on the waiting list for several years before we get a chance to buy. With the Red Sox playing great baseball I imagine that people want to hang on to their season tickets.

Now I have a reason to feel better if the Sox have a bad year, it might increase the chances of getting tickets. That will provide some pretty good consolation if the season falls apart.

Posted by mike at 12:05 PM

June 28, 2006

Sheeri Kritzer: Storing Images in MySQL (presentation video)

Finally got to capturing, editing, and exporting the video from the June Boston MySQL meetup. This month Sheeri did a presentation on storing images in MySQL.

The video is up on Google, and here and here in Quicktime.

Thanks to Martin at kbglob for donating bandwidth.

Posted by mike at 10:02 AM

June 27, 2006

Baseball Hacks

I recently was given a copy of O'Reilly's Baseball Hacks and have really enjoyed digging into a deeper level of understanding baseball. Yes, I watch a fair amount of baseball, but I'm only beginning to understand some of the strategies that come into play during the game (e.g. pitching to a batter or positioning the players on the field).

A few hacks of note:

I initially was a bit skeptical about the book when Joseph Adler proclaimed himself a New York Yankees fan, but it doesn't deter from the hacks. In fact, it's nice to see credit being given to other teams and players throughout the league.

In general I'm also impressed with the use of R (which I'm just learning), and how much how much is done with SQL in queries against MySQL. Adler's (and contributor's) query-writing is impressive, some pretty nasty stuff in these pages.

I'm glad to have this on my shelf and will no doubt draw on it many times over the years as I attempt to figure out what's going on. It seems like every game the announcers say something, or something happens on the field that I wonder about and Baseball Hacks comes in handy in making sense of it all.

Posted by mike at 8:38 PM

Setting Date/Time on Linux

Note to self . . .

Every now and then I need to adjust the time on a Linux box and I always have to look at the man page or dig around online to remember.

To set the date/time to June 27th, 4:04pm:

sudo date 06271604

To make sure that setting sticks in the hardware:

sudo /sbin/hwclock --systohc

Posted by mike at 4:10 PM

June 22, 2006

The Best Part of this Year's NBA Finals

Truth be told I watched one NBA basketball game on TV this season, the game that turned out to be the final game of the playoffs (I did get to see the Celtics twice at the Banknorth Garden thanks to a generous friend with season tickets).

During this NBA playoff season I found the most interesting thing to follow was Mark Cuban's weblog. I think most folks (esp those that follow basketball) know Mark as the crazy, outspoken, owner of the Dallas Mavericks. It was reading his weblog that made me think I'd better watch game 6 to see how things turned out. If the NBA fines an owner for what he writes on his weblog it's probably worth checking out.

It seems like each year I watch less and less basketball. Reading Mark's weblog, and particularly the thoughts of Bill Simmons on the state of the NBA might explain some of it. Is it possible that the NBA is closing in on the WWE?

Of course, if I was a huge Miami fan I might not agree with any of it. I have certainly watched more games the years that the Celtics have done well and not felt as disenchanted with the NBA.

To really be honest I'd have to say that my limited sports attention is captured a little more by the Red Sox every year and there's just not room for the NBA like there used to be. Maybe that's because the NBA is headed downhill, or maybe it's just I'm gradually shifting over to baseball.

Posted by mike at 12:23 PM

Limit on Number of Indexes on MySQL Table

YAMQ (yet another MySQL question) came up at work this past week. Some of our old data warehousing libraries work under the assumption that MySQL can only handle 16 indexes (built during the early 3.23.x days). So the question is how many indexes can a single table have these days?

This is similar to last week's questions on how many joins MySQL can handle. I don't see much in the way of official documentation, but dug around the forums and found good information in this thread.

Creating an index requires creating a key, and there's a limit placed on the number of keys allowed for a table. Thus the limit on indexes is governed by the number of keys you are allowed to create. The error message when you've created one too many keys looks like:

ERROR 1069: Too many keys specified. Max XX keys allowed

And in the documentation:

Error: 1069 SQLSTATE: 42000 (ER_TOO_MANY_KEYS)
Message: Too many keys specified; max %d keys allowed

A quick run through a few machines/architectures I have access to gives a hint at the limit on various systems:

From the forum post it appears that this limit is controlled by the MAX_KEY variable in the source code (sql/unireg.h). Changing the value requires a recompile of MySQL.

For anyone interested here's the SQL file that I run through the MySQL client.

shell> mysql -f < test_index_limit.sql
ERROR 1069 (42000) at line 75: Too many keys specified; max 64 keys allowed
...

The test script creates a test_index_limit database, creates an index_limit table and attempts to put 70 indexes on that table. The script drops the database, so if you happen to have a test_index_limit database on your system please be careful.

Posted by mike at 8:40 AM

June 19, 2006

What does "Another One Bites the Dust" say played backward?

When I was a young teenager my parents (and the parents of many of my friends) corraled us into attending a presentation about the evils of music (not as bad as Footloose, but along the same lines that Ren was up against). This was mid-80s and my groups of a dozen or so friends lived and breathed music, mostly from the alternative scene (The Smiths, The Cure, Echo and the Bunnymen, R.E.M., U2, etc).

The presenter had a somewhat dated collection of insights into the evils of musicians and the music industry. This included stories and musical excerpts from Styx, Queen, the Beatles, AC/DC (All Children/Devils Children), Michael Jackson, W.A.S.P. (We are Satan's People) and more that supposedly backed up his point that if you listen to (or let your kids listen to) this music they are hell-bound.

We all listened with interest but most of the points were lost on us because we didn't really know the music this guy (I remember his name, but will refrain from using it) was referencing. Of course in the weeks/months/years following this presentation we got a lot of good mileage having fun with the interesting things we heard that night. We even once did a parody interview for a fake radio show looking through all of our Depeche Mode records and pointing out the satanic associations.

Now to the point. One thing that was played a few times was a clip from Queen's Another One Bites the Dust. As I recall, the presenter told us what it said, and then played it back a few times repeating what it said. Of course we tried it at home and heard the same thing.

I recently (20 years later) stumbled into an mp3 of Another One Bites the Dust and decided to flip a section of the song around around see what I think now. Was suprised to hear exactly what I was told it said so many years ago. I forwarded it to Pete, (who was in attendance as well) who also confirmed that he still hears it too. But I wonder if it's just because we can still hear the presenter up at the microphone saying it along with the song.

So here's the clip. It's an 8 second clip playing forward and then the same 8 seconds played backward. Does it say anything to you?

Another One Bites the Dust Backwards

The WikiPedia has a paragraph about this (but it gives it away), and a link to a much nicer walkthrough of the hidden message. Don't go there until you've at least tried to formulate what it says.

Now that I think about it, maybe this hidden message is something that everyone knows about, which would make this test (and post) pointless. Too late now.

Posted by mike at 12:08 PM

June 16, 2006

Limit on Number of Joins in MySQL

I've been digging around to find documentation on the limit MySQL places on the number of tables in a query. The error is number 1116:

Error: 1116 SQLSTATE: HY000 (ER_TOO_MANY_TABLES)
Message: Too many tables; MySQL can only use %d tables in a join

I can't seem to find documentation on what number triggers this error. There are a lot of references to a limit of 31 and 61 out on the web.

I wrote a quick script to generates a slew of tables and a large SQL statement to test the limit. MySQL 4.0.23 precompiled binaries (RPM "standard" package) running on RedHat ES Linux says the limit is 63 tables. MySQL 4.1.14 running on Gentoo Linux raises the error once statements get above 61 tables. MySQL 5.0.20 on Intel Mac is the same, once the statements gets above 61 tables the error is raised. I also found a RedHat ES 2 Linux box with MySQL 3.23.58 running. Limit there is 31 tables, so the folks who came up with this on my Google search were getting the error using old-school MySQL.

The data simplified and without narration:

The message from the MySQL client looks something like:

ERROR 1116 (HY000): Too many tables; MySQL can only use 61 tables in a join

And yes, many will be quick to point out that if you're bumping into this limit there's likely something really wrong with the data model. I know, I know. We've got complex software with a pretty controlled data model. However there are some wicked reporting tools that let the user put together all kinds of crazy combinations of data. In reporting it doesn't take much and the table count gets out of control so we limit the choices at the application level.

The question that doesn't seem to get answered on the forums or anywhere else is how the limit is determined and what governs it. I'm guessing it's a setting that's compiled into the binary? Anyone know?

Update: I just tried my tests on MySQL 4.0.23 (installed from RPM) on Red Hat 7.3, an older Linux distro. Limit came up at 31. So it's not based on the MySQL version, but something to do with the OS? Maybe it's determined by hardware?

Posted by mike at 11:17 AM

June 15, 2006

Web-based Spreadsheet: EditGrid (not Google)

Today I was looking at the Catalyst Web Framework for Perl, a web-development framework to bring Perl into the modern age of framework-based web development (ala Ruby on Rails and Django). Actually, there are a variety of frameworks for Perl, but Catalyst seems like it's got the best shot at competing with the other frameworks.

Anyhow, I was interested to see that one of the web applications built using Catalyst is EditGrid, a web-based spreadsheet utility. Some pretty impressive functionality they've developed. It's amazing what can be done in the browser these days.

I haven't used Google Spreadsheets, but EditGrid has a spreadsheet comparing EditGrid, Google and MS Excel.

One thing that stands out in the comparison is that EditGrid has more search functionality (search within spreadsheet and search across public spreadsheets), more sharing options (share read or read/write with public and share read or read/write with password protection), and offers interoperability with more document formats. I would have guessed Google would be at the top of innovation in all of those areas. EditGrid also has SSL support available for all grid interaction.

Looks like EditGrid launched on March 2nd this year, a few months prior to Google. They are well aware of the competition.

Cool, you can post a spreadsheet to your weblog.

Posted by mike at 3:56 PM

June 11, 2006

Day in NYC Detoured by Puerto Rican Day Parade

The last day of our weekend in New York/New Jersey started with an hour in the hotel pool and then off to Liberty Park in New Jersey to get close to Liberty Enlightening the World (aka the Statue of Liberty). We really only got to see her backside, but a pretty good view from the shore. I've never actually been out to Liberty Island. I am keeping my eye on the re-opening of the crown and interior of the Statue of Liberty (apparently a bill was passed in May 2006 to make this happen). Once that opens for visitors it will be time to cough up the dough for the ferry and stand in the long line at Bettery Warf and watch the contortionists for a few hours waiting for a turn to float out and climb up inside Lady Liberty.

While at Liberty Park we were seriously sidetracked from our day's plans by this monstrous playground, bigger than anything I've seen in my life. The kids were so enthralled, we couldn't stop the fun.

By the time we got rolling it was after lunch. There was still time to hit the Central Park Zoo but the traffic was something else. As we made our way to the Holland Tunnel and across into NYC we noticed many cars and folks with Puerto Rican flags. Then Heidi connected the dots, remembering that today was the NYC Puerto Rican Day Parade. Rather than get caught trying to get up to central park we decided to save our day in New York City for another time and headed up the Hudson Parkway on the west side of Manhattan and got on the road back to Boston. Bummer, I was looking forward to spending at least a few hours taking in the city.

The trip home was uneventful, kids were amazingly cooperative for having to be in the car for such a long period of time.

Posted by mike at 11:59 PM

June 10, 2006

Day at the Petfinder Ranch (10th Anniversary Party)

Last night we packed up the family and drove down to New Jersey to spend Saturday celebrating the Petfinder.com 10th anniversary over at the Petfinder ranch (also the home of the founders of Petfinder.com). I got to know some of the Petfinder folks a few months back when I was poking around for a new job and have kept in touch since. We'd been wanting to come down to spend a day in New York City for some time so the invitation to come down for the 10th anniversary party was just the excuse we needed to get us down here.

We left Boston around 5, driving almost straight through to NYC, across the George Washington Bridge and down to the hotel in Newark, NJ. With two short stops to stretch the trip was right around 5 hours. Hit some really crazy-heavy rain just as we got to New Jersey, enough to slow folks down to 5-10 MPH and turn on flashers. A little hairy considering we couldn't make out the signs very well and didn't quite know the lay of the land, but we made it through without incident.

Today's Petfinder celebration was really quite something. Those folks know how to put on an event. There was live music at the front of the barn, a catered BBQ (all vegetarian except for some free range chicken), a huge inflatable bouncer for the kids (in the shape of a giant birthday cake), lots of animals, three shows with World Class Trick Frisbee Performing Dogs from the Purina Incredible Dog Team, a slush machine, lots of free goodies, and more. We saw everything, but spent a good chunk of the party near the cake bounce watching the kids have a ton of fun. Saul was in his usual cheery state and made a lot of new friends. The trick-frisbee dogs were really cool, one could do backflips while catching a frisbee but my favorite was the one that could catch the frisbee in the air and then land on the back of the trainer who had crouched down.

The kids favorite part was the cake bounce and the dog show. My favorite part was catching up Jared Saul, the Petfinder.com founder who looks over all things technical. He's done some pretty cool things to be capable of scaling to the kind of traffic they get and has a good sense of what's happening in open source and technology in general (although his real job is being a doctor).

Amazing that In the last 10 years Petfinder.com has facilitated over 10 million pet adoptions.

Tomorrow were in NYC. We'll probably start by taking a good look at the Statue of Liberty from the New Jersey side and then go into the city to spend the afternoon in and around the Central Park Zoo.

Posted by mike at 8:45 PM

June 8, 2006

Better off with Donuts and a Big Mac

I don't know were I got this idea that a bagel is a healthy alternative for lunch. I think I heard someone say it once, but it could be all the fit business and yuppie folks I see down at Finagle-a-Bagel.

Yesterday for lunch I had a bagel with peanut butter and honey and was suprised to see it ring up at 680 calories when I got back to my desk to add things up. Shees, I should have gone out and gotten a Big Mac (530 calories) and felt good about making the healthy choice. In fact, there's only one sandwich that rings up higher than my bagel on the McDonalds sandwich menu, the Double Quarter Pounder with Cheese at 730 calories.

I thought maybe it's just my bagel source (local bakery) so I looked on Dunkin' Donuts nutrition information site to check the numbers. Again, I'm suprised to see that I'm better off choosing a custard-filled Boston Kreme than a plain bagel (or even worse a poppyseed). How can that be? Those numbers must be doctored.

Needless to say I had split pea soup for lunch today, glad I was prompted to start keeping an eye on what's going in.

Posted by mike at 1:06 PM

June 6, 2006

New MovableType Beta Available

MoveableType (the software that powers this weblog) has a new beta version available. Why get so excited? This line in the announcement is something I've been hoping for:

Vastly expanded template tag options for common content management tasks

There are a few things I'd like to do here on the weblog that just haven't been possible with the given software and the template tags it allows. Even though it's tempting to try it now, I'm going to wait until some of the known issues get resolved before moving over.

Posted by mike at 1:17 PM

June 2, 2006

Add Aux Input to (Hacking | Modding) the Bose SoundDock

Update: I have succesfully built an auxiliary input cable for the Bose SoundDock, a project that was requested by several folks. The sound quality is much better running auxiliary sound through the SoundDock without having the iPod attached (as required for this hack). You can also buy the cable at CableJive.

--

[[digg this]] Several months ago I was in a real quandry about what to do about portable sound for my iPod. I wanted something for my home office, but also something that I could take to the workshop or wherever.

I spent a lot of time thinking about it, and made several trips to more than one Apple store where they have all the options lined up. It boiled down to the Klipsch iGroove, Bose SoundDock and iPod HiFi. There's a lot of debate, but truthfully they are all very close. The iGroove had great sound, but I couldn't get used to the form factor so it boiled down to the HiFi and Bose. Listening in the store at pretty close range the Bose sounded just a bit better so I went with it, despite some of the missing features like battery power and aux input.

The Bose SoundDock has been great, I do really like the sound. It sits on my desk in my home office about three feet from where I sit. You can really hear the good audio quality at that distance (seems to be less quality with greater distances).

The one limiting factor that has haunted me is the fact that it doesn't have an auxiliary input, everything I listen to must be cone from the iPod. The iGroove and iPod HiFi both had an aux input feature. I spend a good deal of time at my desk listening to music, podcasts, audiobooks etc and it really has gotten annoying that if I want to listen to anything it has to be on the iPod and I have to use the iPod navigation to find stuff. It's good for on the go, but if I have iTunes right there I'd much rather use that to control what I'm listening to.

So I started thinking . . . and looking . . . and got an idea.

The first idea was to figure out the location of the pins on the iPod connector for line out audio and try to figure out a way to build something to plug into the iPod mount on the SoundDock. The wikiPodLinux has a great document on the iPod connector pinout. You can even purchase male and female adaptors (not sure they are Apple-authorized).

After thinking on that for awhile I decided to look at the SoundDock itself to see if there was a way to inject audio without using the Apple iPod connector. Turns out that you can see a bit of the circuit board on a fully assembled unit by just looking down in the slot where the iPod sits in the dock. The part you can see looks like a row of pins, which raised my curiosity enough to explore more and in the end led to a working aux input for the SoundDock.

It starts with pulling the two bottom covers off of the SoundDock. The first one is attached with four phillips screws, the second one is attached with three Torx screws (requires size 8 Torx). When I pulled off the first bottom cover (with phillips) there was a ribbon (about 8 inches long) folded over once. This connects the circuit board from the iPod connector to the SoundDock electronics.

When I pulled off the second cover the circuit board with the iPod connector could be pulled out. This circuit board is attached with a ribbon that is long enough to allow you to stretch the circuit board a few inches in front of the SoundDock to work on. When I initially pulled it out there was a black cover over the board, but it's only attached with some stickiness on the bottom of the black piece of thin plastic so was easy to remove. What's underneath is a circuit board that has the connections between the iPod dock connector and the SoundDock input ribbon. This board has the volumn adjustment controls as well.

Looking closely at the circuit board I could see that the connections on either side of the ribbon were numbered 1 and 24. At first I thought these would correspond to the iPod connector pinout, but it's fewer pins and when I connected audio to pins 1, 3 and 4 to match the iPod audio connector it didn't appear to do anything.

A little trial and error using some multitester probes revealed that the audio is sent into the SoundDock using connector 13 and 14 on the ribbon. 13 is for right audio, 14 is for left audio, and number 24 is ground.

At this point I realized that it's likely that the SoundDock is turned on and off by having the iPod attached. There's no on/off switch, so something about having the iPod docked turns on the SoundDock. Perhaps it's the 3.3 USB volt charge on pin 18 . . . as you'll see I never get to the point of making the SoundDock work with auxiliary sound without having the iPod docked. To put it another way, you must have the iPod docked in order for this aux input hack to work. Sending audio on pins 13, 14 and 24 isn't enough to trigger the SoundDock to come on.

Back to the hack. If you follow the connections on the board out about 1/2 inch from where the ribbon is soldered to the circuit there are spots where a wire can easily be soldered. I used unshielded, 24-gauge solid wire, but something even smaller would probably work better. I had to shave down the tip of the wire to get it to slide down into the circuit board. Perhaps 28 or 30 gauge would fit better. I soldered an 8" piece of wire for right (red), left (white) and ground (black) and send them to the left of the circuit board. In retrospect, if I had to do it again I'd get a shielded headphone cable or something similar to make the hack a little cleaner and ensure optimal audio quality (although I haven't noticed anything horrible about the wiring I used).

Before closing things up I tested by hooking audio up to the wires just to be sure that the wires were connected solidly and things were still working.

I then put the second cover back on (the one I removed second, with the Torx screws), pulling the wires through a small area near the screw base on the lower left of the cover.Then I put the first cover back on (the first one I removed, with the phillips screws). As I put the first cover back on I pulled the wires through the most obvious opening which put the wires running into the small cavity uner the left side of the SoundDock.

Again, I tested the SoundDock aux input by connecting an audio source just to be sure I hadn't disrupted something in putting the covers back on. I also tested the iPod sound to be sure that was still working as it should. Still looking good.

The last piece of the hack was to make a decent interface to the aux input. A quick trip to radio shack netted a 1/8" audio jack ($2.99 for a pack of 2). Another quick bit of soldering, drill a small hole, and use some serious glue to affix the body of the jack under the body of the SoundDock and I've got a nice place to plug in a 1/8" from my headphones out jack on any device.

Now I'm using the SoundDock to listen to whatever strikes my fancy, not just stuff from my iPod. This means I can watch movies on my laptop and listen using the SoundDock. Cool.

And the sound is good, I haven't altered the structure of the sound dock or the way it processes audio so I can get the same audio quality that I get with the iPod with other devices.

A Few Warnings (or things to note)

Posted by mike at 9:26 PM