Kip Hotlanta

Part of our Christmas gift from Stephanie’s parents this year was some time at a timeshare.  We decided we would use the time before the baby gets here, and so we spent the last weekend in Atlanta.  While we were there we visited Zoo Atlanta and the Georgia Aquarium.  I have put up photos from this trip for any who are interested.  A lot of the pictures from the aquarium turned out much better than I had expected.

A few comments

  • The elephant will hold a paint brush in its nose and create elephant art.  That was interesting to watch.

  • Apparently dried up Christmas trees are a part of the wallaby’s natural habtat?  Actually they had these in several of the exhibits, I guess some kind of recycling program or something.

  • The zoo had a baby panda, possibly God’s cutest creation.  The adult pandas must not appreciate this because they won’t breed even to save their species.

  • I have determined that Bowser King of the Koopa is in fact not a Koopa at all, but an alligator snapping turtle.  Apparently some Wikipedia editor agrees with me.

  • In the aquarium, they had this huge wall that was filled with jellyfish that was incredibly relaxing to look at.  It was kind of like a giant screensaver, only not annoying.

  • There were a couple of tanks that arced over head, and one tank that had a glass tube running through the bottom of it.  This allowed you a few places where you could look up and see sea creatures flying overhead.

  • The pictures of the sea turtle turned out surprisingly well.  I guess there was just plenty of light in the area.

Michael: Hey dude. I just got back from Jamaica.
Packer: Big whoop! I was in HOTlanta. That whole town is whack!

Kip Tagging

I’m thinking about implementing tags on this site, but I’m curious if anyone ever actually uses tags when visiting small sites.  The only time I use them is on a large blog like Joystiq, which publishes dozens of posts per day, far more than I care to read.  But maybe everyone else uses them and I’m just behind the times?  As far as I can tell, on a site like mine the only purpose would be to quickly find other posts similar to the one you just read.  A search feature would help in that regard too, and I’ve thought about using ZendSearch because it looks really easy to use.  But I just haven’t bothered to sit down and figure it out.

If I do implement tags, would I really need a tag cloud?  I happen to find them only slightly more useful than they are aesthetically pleasing.  And like I said, for a site like mine you probably wouldn’t use the tag cloud much.  But again, maybe I’m just behind the times?  Like when I launched this site and didn’t have an RSS feed for like six months because feeds are for hippies.  Then I started using feeds and decided I needed one too.

Kip The United States

For some reason this morning, I decided to see how well I could draw the continental United States from memory.

Continental United States, drawn from memory

I started with California and worked my way generally to the east and then north.  Michigan and New England are particularly atrocious.  I forgot that Maine comes off the side of NH/VT.  Which themselves come off the side of New York.  I guess those states are just so small that I felt bad for them, and drew them bigger.  Then Minnesota totally got embiggened.  But all in all I think it’s still a perfectly cromulent map.

Kip Doh!

I knew it would happen eventually.  I put in some code that broke our software, and it wasn’t discovered until nearly a month later, on the day the final build was scheduled.  This meant that the final build had to be delayed for a few days, which is kind of a big deal because it can affect ship date.  So lots of e-mails were circulated which featured my name—often in a red, boldface font—in various lists of actions.

Posted below is a paraphrased version of the code in question.  I’ve renamed or taken out anything that might refer to our internal codebase, and I’ve simplified a little, but not to the point that I look like a complete idiot for missing this.  The QueryInterface() and Release() stuff might look a little weird if you’re not familiar with COM+.  Or all of this will look weird if you’re not a programmer.  But odds are you’re about to stop reading if you aren’t a programmer.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
LIST(IUnknown) listObjs;
Session->GetModifiedObjects(listObjs);

const int nbObjs = listObjs.Size();

if (nbObjs > 0)
{
   ObjectID** listObjIds = new ObjectID*[nbObjs];
   for (int i = 1; i <= nbObjs; i++)
   {
      ObjectID* pObjId = NULL;
      
      IUnknown* pUnknown = listObjs[i];
      IPart* pPart = NULL;
      if (pUnknown != NULL)
      {
        RC = pUnknown->QueryInterface(IID_IPart, (void **) &pPart);
        pUnknown->Release(); pUnknown = NULL;
      }
      if (SUCCEEDED(RC) && pPart != NULL)
      {
        RC = pPart->get_ObjectID(pObjId);
        pPart->Release(); pPart = NULL;
      }
      
      listObjIds[i] = pObjId;
   }
   ...
   //process listObjIds
   ...
   for (int i = 1; i <= nbObjs; i++)
   {
      if (listObjIds[i] != NULL) { delete listObjIds[i];  listObjIds[i] = NULL; }
   }
   delete [] listObjIds;  listObjIds = NULL;
}

For those of you still with me, maybe you already see the problem.  The LIST() macro in our infrastructure behaves pretty similarly to a Vector in Java: it will resize itself dynamically, check array bounds, and automatically free memory when it is destroyed.  However, because this was written long ago by guys with a Fortran background, the items in the list start at 1, whereas a C++ array starts at 0.  Also, it only works with components implementing IUnknown; plain-old-C++ objects must be handled with plain-old-C++ arrays.  In the code above, this meant I could not declare listObjIds as an object of type LIST(ObjectID*).  So I had a LIST(IUnknown) and an array of ObjectID*s, but I treated both as LISTs!  In fact, I have gotten so used to using LISTs in C++ that I completely forgot that listObjIds was an array (I guess a better variable name would have helped too).

The line listObjIds[i] = pObjId; should instead be written listObjIds[i-1] = pObjId;, since i loops from 1 to n, rather than 0 to n-1.  (Note that the line IUnknown* pUnknown = listObjs[i]; is still correct.)  So I was writing beyond the memory allocated to the listObjIds array.  And amazingly, it worked just fine in all my testing.  Most of the time, the next sizeof(void*) bytes on the heap aren’t going to belong to anyone.  But there is a chance that they are used for some other variable, whose value you would be overwriting.  This is especially more likely if memory has become very fragmented.

We run unit tests on all four operating systems we support, but only one operating system (HP-UX) was affected by this.  And since we don’t currently have any customers using that OS, it was a while before anyone looked at the traces very closely.  Unfortunately, it happens that this code was implemented in a listener that is called every single time the user saves.  So when it was discovered, it was something that had to be fixed before the final build.  We could have delivered it as a patch, but some customers are reluctant to deploy patches because that can mean shutting down production for a few hours.  Plus it doesn’t instill confidence to say we shipped broken code.  So delaying the final build for a day or two was the best option.

The worst part of it all is that it happened just before year-end performance reviews.  Doh!

Kip Games in review

I’ve played a lot of games lately, so I thought I’d post some quick mini-reviews for anyone who cares.  Without further ado...

Metroid Prime 3: Corruption
Metroid Prime 3: CorruptionAll in all a pretty fun game, although something just doesn’t feel quite right.  Looking back on the Metroid Prime games, I think that the first one was the best.  But I’m not sure why, because I played 1 & 2 back-to-back last summer, and I thought 2 was far superior when played that way.  But when they aren’t fresh on my mind, I think the first one was better!  I can’t figure out why, since those thoughts contradict each other.  Some other thoughts: this is also the easiest of the Prime games, and the presence of voice actors was a little weird to me.  Finally, I have to mention the two super-cool unlockables.  One is ship bumper stickers, which means it looks at games saved in your Wii system memory and puts their logo on your ship.  So there’s a giant Zelda triforce on the top of my ship, and a Paper Mario head on the side of my ship.  And the other cool unlockable is a Samus bobble-head doll with your Mii’s head on it.  Normally I wouldn’t think seeing my head on a woman’s body was very cool, but I’ll make an exception in this case.  You can see both of these unlockables on your tubes.

Super Mario Galaxy
Super Mario GalaxyThis game was just great.  I’m not sure how else to say it.  As you probably already know, the game takes place on micro planets that you can run around.  Playing around with gravity is incredibly trippy.  There are even a few places where a planet is small enough that a long jump can literally put you into orbit!  I wonder what Isaac Newton would say if he were alive to see this game?  Stephanie also enjoyed the commitment-free 2-player co-op.  She was able to help sometimes by freezing enemies.  In fact this was so helpful it felt like cheating sometimes, especially because she could just hold bullet bills in place, then I could take my time.  The game does have a few bad points.  Namely, Spring Mario.  Fortunately, you only have to use Spring Mario about 4 or 5 times in the entire game (in fact, I don’t think I ever used it until after the first time I beat the game).

Guitar Hero 3: Legends of Rock
Guitar Hero 3: Legends of RockI’ve played Guitar Hero games a few times, but this was the first one that I actually owned and spent significant time on.  I think my skill might have plateaued at can-beat-nearly-everything-on-hard-and-a-few-things-on-expert.  Unfortunately the Wii version of this game had some problems, like the fact that it only outputs sound in mono.  This is a music game, how did that get past the QA process??  Another annoyance is the lack of co-op quickplay feature (not that this is a huge deal to me, personally, since I only have the one guitar).  For the 360 and PS3 versions of the game, a patch was released to add that feature, but of course the Wii isn’t quite that capable.  Oh well.  I just put my disc in the mailbox this morning to get a replacement disc that does have stereo sound, but they said it could be 3-4 weeks, and I might be quite busy with other things in 3-4 weeks, so it may be a while before I get time to play GH3 again.

Prince of Persia: Rival Swords
Prince of Persia: Rival SwordsAs you may know, this is the third game in the Prince of Persia: Sands of Time trilogy.  (Well technically Two Thrones was the third game, and this is a port of the third game.)  The first game in this trilogy was just amazing.  One of the best video games I’ve ever played.  Unfortunately Ubisoft rushed out the sequels without giving them the same love.  The Warrior Within was a train wreck of a game.  In this game they’ve gotten back on course a bit, but it still seems to fall short of the first game.  But I have to admit I’m only partway through the game.  The Wii controls are a little tacked on, but they aren’t really bad.  They are comparable to Twilight Princess (where Wii controls were also tacked on).  Somehow the graphics seem worse to me than they were in the original game, but maybe I’m just not remembering it correctly.  I’ll have to go back and see sometime.

Okay I guess that’s all I’ve been playing in the last several months.  Until next time, take care America.

No Comments
Kip Lunar eclipse of aught-eight

Lunar eclipse, 45 minutes prior to totalityAs you probably know, there was a total lunar eclipse last night, visible from most of the continental United States.  I tried my hand at photographing this event, and I think I got reasonably decent results, given my lack of a telephoto lens.  I used a tripod and the delayed-shot feature on my camera1.  I got half a dozen photos out of the event, which you can find on our photos page.  You can also see in all the pictures Saturn (down and to the left of the moon) and the star Regulus (above and slightly to the left).

While I was looking for information on the eclipse yesterday, I found NASA’s solar eclipse website, which has maps of every solar eclipse from 2000 BC to 3000 AD, in 20-year blocks.  It looks like I only get three chances to see a solar eclipse in my lifetime, assuming 1) I live in this general area of nation for my whole life; 2) I don’t want to travel more than 3-4 hours to see one; and 3) I live to be at least 96 years old.  There was a partial solar eclipse on May 30, 1984 which passed right over my hometown, but I guess I was too two to care at the time.  (See the map of 1981-2000 eclipses.2)  However, on Monday, August 21, 2017, a total solar eclipse will pass by very close to where I currently live.  I’m thinking on that day I’ll take the day off work and head out to somewhere in the western North Carolina mountains to see the eclipse.  If anyone wants to join me then go ahead and mark your calendars.

Path of August 21, 2017 total solar eclipse

The third opportunity for me to see an eclipse will be May 11, 2078.  I will be 96.5 years old then, so I’m not sure if I’ll still care (assuming, of course, that I’m still alive, which is statistically improbable).

One last thing that I couldn’t think of a way to segue into: there is an interesting story about how Christopher Columbus used a lunar eclipse to save his life.  Proof once again that sufficiently advanced technology is indistinguishable from magic.

1 That was a tip from someone I work with for getting clearer pictures out of a mediocre camera.  With a delayed shot you don’t have to worry about the camera shaking, because you won’t even be holding the camera during the exposure.
2 I seem to recall an eclipse happening when I was in middle school.  I know it didn’t get dark or anything, but I think it got a little bit dimmer outside.  This must have been the May 10, 1994 partial solar eclipse, although the path of the eclipse was several hundred miles from North Carolina.
No Comments
RSS feeds: Kip's - Stephanie's - Both