Archive for January, 2009

Slight Confusion with Google Group Invitations

Thursday, January 22nd, 2009

GoogleGroups.jpg

In joining the Mac OS X open source graphing package (CorePlot) group on Google Groups today I ran into something I've hit a few times before - people invite me based on my email address, which makes sense, but most of the time that's my "transient" email account - currently Comcast. What I ended up with was an invitation on my Comcast email account and not on my Gmail account where all my Google Groups are registered.

The problem is, I want them all on the same Gmail account. What I've had to do in the past was manually join the group, or have the owner send a new invitation to my Gmail account. While I sent an email to the group owner, I decided to try and fix this once and for all - by creating an account for my Comcast email account.

It wasn't all that hard - I basically did it in about 15 mins and in the end, I had my Comcast email as one account, and I'd unsubscribed to the CorePlot group. I'd then put all my other email addresses on my main Gmail account, so that should a new invitation come in, it's possible to have all them routed to the one main Gmail account. At least that's how I'm guessing it works. If not, I'll create another and then deal with that.

While it was a pain to have to go through all this, I have to say that the UI for the Google Groups is pretty nice. It's about as good as I could expect for a web-based app - even Google. There are a lot of screens, and it's easy to get lost in the maze of forms to set up the account and profile. It's something to get used to, but once you get the idea of where things are, it's a decent interface and gets the job done.

I'm glad to have cleared this up, anyway. Going forward, I shouldn't have any more issues of getting invitations under one email address and not having an account on Google Groups.

UPDATE: I will say that the support for Safari in Google Groups was far better than Camino and Firefox. I'm not sure why that is, maybe it's just because they have more Safari guys and they wanted to be supported well, or maybe it's the feature set in WebKit - hard to know. But things are much nicer in terms of uploading images and such in Safari. Gotta love that!

Apple Updates Quicktime to 7.6 in Software Update

Thursday, January 22nd, 2009

Leopard.jpg

This morning I saw that Apple had released Quicktime 7.6 in Software Update and the notes said it fixed 7 security holes/bugs and then added additional audio and video support. Since it's a part of the OS, or at least loaded on boot, it's a reboot to install it. Not bad, I still think it's a pretty amazing piece of work.

I can remember using RealAudio (this is pre-Real days when all they did was audio) and setting up a streaming server on a Sparc 20 at my old place. I'd tape record a monthly meeting we had and then digitize and encode it into ra files and put it on the web server for anyone to listen to. It was all there was, and a massive jump in capabilities at the time.

Then came Quicktime and video was on the web. It's come a long way since then, but the effect is still just as impressive - video and stereo audio on the web. Yeah, it's pretty amazing stuff.

Carefully Working with Six-Sigma People

Wednesday, January 21st, 2009

cubeLifeView.gif

I have worked with some very unusual people. I've worked with some very smart people as well. Sometimes they are the same people, and when that happens you need to deal with them very carefully. Why? Because they are smart enough to be curious, and smart enough to be dangerous, and not careful enough to stay out of trouble. Many people don't realize this until it's too late - they give a little too much information to someone like this and then they are constantly cleaning up the carnage that the smart, unusual person creates.

This happened today, and the key to controlling the situation is early detection. Make sure you see that this is a potentially dangerous situation as soon as possible and take steps to mitigate the damage. For instance, if the new linux user asks for root on their box, the answer doesn't have to be "No", it's better to say "What can I do for you?" Make it seem that you're more interested in doing this for them than having them waste their precious time on such mundane things.

The effect is the same. You don't need to let this person have complete control of a machine and then have to rebuild it because they decided to remove a few "offensive" libraries and the machine becomes unusable. You can help them, do the things for them that are liable to cause problems, and then all they need to do from there is to use the programs - editors, compilers, etc. that you have placed there. Simple. Disasters averted.

If you fail to do this, then it's either a constant game of catch-up and clean-up, or you have to be firm and say "We're taking this away because it's not safe at this time for you to do these things." This, unfortunately, never goes over very well. There are hurt feelings and problems, and then there's the turf wars... it's ugly and it takes months to recover.

Best to be proactive and simply avert the problem. If you find that someone who doesn't recognize the danger inadvertently "spills the beans" you need to step in quickly and offer to "help" this person - kindly explaining the problems with, say, RedHat package management. Then there's the inevitable "scary talk" about what could go wrong, and lots of offers to do things for them.

I've found this plan to be quite effective in the vast majority of cases. Today was no exception.

Throwing my Name into the Hat for a Good Project

Wednesday, January 21st, 2009

xcode.jpg

I was reading the RSS feeds the other day and came across this in my reading. It was a "call to arms" for an open source Mac OS X plotting framework. Something I've always wished there were, but nothing seems quite right.

So I decided today to shut up and do it. So I sent Drew my name and a brief description of what I was looking for, and explicit instructions about what he wanted me to do. I'm no fool - one chief, lots of braves. I'm a brave on this guy.

That's OK. If I can get this to a point that it does all I need from VantagePoint or DataGraph and it's something I understand and can work with, then that's fantastic. It's certainly something to get involved in and see if I can make it better.

I'm hoping this turns out to be a good thing to do. I think it is.

The Best Debugger is Sitting Right Between Your Ears

Wednesday, January 21st, 2009

SwissJupiter.jpg

Last night on the way home I was thinking about the locking problem I had battling during the day and was just rolling it around in my mind. As so often happens, the solution came to me in a little question leading to a little insight, and then as I ran it through in my mind I was convinced that I had figured it out.

The problem was that I wasn't considering a hidden thread and a hidden mutex. Had it been one or the other, I might have seen it sooner, but the fact was it took me that long to have my mind "fan out" from the initial problem and see what else was happening in the system.

The message broker API is not thread-safe. So in order to make sure we don't mess it up, we have a global mutex on it. One one thing can be going through it - in or out. Seems very reasonable. Since we need to receive messages we have a polling thread in the API wrapper classes that uses poll() to see if there's anything at the socket, and if there is, it locks the API and then processes the incoming message, and unlocks the mutex.

We also have the sending thread. That guy is based on the fact that a price comes from the ticker plant and there may be several instruments that this price matches, so I have to lock the list of instruments, get all those that are driven by this price, and then send each one in turn. Finally, I unlock the list of instruments.

These would all be OK if it weren't for a few facts:

  • the incoming messages can cause me to add a new instrument
  • the locking on the instrument list on the sending thread encompasses the entire loop

What would happen is that I'd be sending an instrument with price to the message broker and an incoming message would arrive. That incoming message would block until the sending was done and then it would obtain the mutex on the API and start the processing of the incoming message.

If that message ended up requesting me to add a new instrument to the list by calling addInstrument() then I'd try to get the lock on the instrument list. Bingo! The sending thread is not done, and can't send again because the incoming thread had the API mutex locked, and the incoming message can't add the instrument because the sending thread has the lock on the instrument list. Deadlock.

The solution was simple: Never leave anything locked when sending a message. Simple. When I copied the instruments to a temp list in a thread-safe manner, and then processed the copy without a lock on the instrument list everything worked.

I have to say, this is one of the fun times to write code. The best debugger is the one between your ears. You have to understand what is happening and then think about the parts. To have figured this out with a debugger would have been very lucky to say the least. Timing was critical to the deadlock. I'm really surprised that it happened as often as it did.

Anyway... that was the biggie for the day. I'll track the code for the rest of the day and make sure I'm right, but it's gotta be the problem.

Making Code Deadlock-Proof

Tuesday, January 20th, 2009

SwissJupiter.jpg

I had another lock-up in my tick injector that uses the Vendor library that I've had so much trouble with in the past. It appeared that it was in my code this time, and that surprised me quite a bit because I was convinced that there was no way I could have a deadlock because there was no section of code that had both locks in place at one time. If you don't have a thread that holds two locks then there's no way you can have a deadlock. Delay, sure, but no deadlock.

So I started going through all the code and checking to see if I missed anything. Well... sure enough, I had a little section where I had a stack locker active and then called a method that grabbed the other lock for a bit. I was able to clean this up, and I'm hoping this had to be it, but in truth, I'd have to have another section with two locks to have a deadlock. And I didn't find that section section.

I did, however, find a few places where I thought that encapsulation was a better plan, and so I made methods that were, themselves, thread-safe, and then put those into the code where I had originally had the locks. These should be essentially "no-ops", but in fact the locking will be slightly different and in that I may have helped myself even though I hadn't seen a section of code with two active locks.

I've also added in some more logging into my addInstrument() call - where it appears the lock-up was, just to see what happens next time. I'll run with this and we'll see if and when it fails what the logs tell us.

We Have a New President

Tuesday, January 20th, 2009

PotUS.jpg

Today was the inauguration of President Obama, and Liza was lucky enough to be able to watch it on TV. I missed it being at work. Not horrible, but it would have been nice to see it live. I hear it was very nice. We both watched the televised program on the steps of the Lincoln Monument on Sunday. Tom Hanks, U2, "Kumar", it was amazing to see all the personalities that were there. Fantastic show for the new President.

Amazing that once again he made it not about himself, but about all of the people that put him here he was at that instant. Amazing humility. The more I see and hear this guy the more I'm convinced that we have a chance at turning this country around. We need to restore confidence in each other, in the world, and our image. But I honestly believe this guy can lead us to make those changes.

I'm so very glad to be alive to see this come to pass.

Went to the Apple Store and Got iWork ’09

Sunday, January 18th, 2009

Numbers.jpg

I've found iWork '08 to be exceptional, and knew after the keynote, that I'd get iWork '09 for the updates to Numbers and Pages, for sure. I've found Numbers to be certainly on par with Excel, and a lot easier to understand. I've been able to make pretty complex spreadsheets with Numbers '08, and I know Numbers '09 is only going to be getting better.

Plus, it's Apple - come on! It's gotta be the best stuff. Period. Love it.

Fantastic Music from 20 Years Ago

Friday, January 16th, 2009

iPodTouch.jpg

I've been listening to a few different playlists on my iPod in the last few days and I have to say that I really love the work Al Jarreau has done over the years. Incredible songs, great vocals. Just plain good stuff.

Also Lionel Richie - from his days with the Commodores to his solo career. Pretty great stuff. I can remember picking up these guy's CDs when I had less than 20 CDs in my entire collection. I heard them, and thought this was just the find of music I liked. Probably the last time I bought "popular" CDs.

Yup, I'm that old.

Somedays I’m Convinced that My Laptop Bag is My Purse

Thursday, January 15th, 2009

smiley.jpg

I've been carrying a decent laptop for a lot of years. I've come to rely on it not only for electronic documentation (which was the first use I had), but also for staying connected, using online docs, keeping my calendar... just about everything. And my backpack is like a purse. There's everything in there I'd possible ever need.

I have a flashlight... and spare batteries... and a spare batter for my cell phone... and a PSP for games if I get bored on the train... and my Kindle... and a magnetic screwdriver... and the train schedule... and band-aids... and my iPod Touch... and my paper documents from work. You name it, I've got it. If I need it, I can reach into that guy and pull it out.

The same is true for my laptop. Just this afternoon, a friend chatted me asking me what I had planned for the long weekend. Long weekend? I had no idea what he meant. Why? Because I hadn't put in the holiday calendar for the year (2009) yet. When I pulled that up on the corporate web site and checked - sure enough, Monday is Martin Luther King Day, and we have off! Sweet!

So I put in the Holiday calendar and away I go - good for another year.

Of course, iCal is about the best little free calendar app I can imagine. I can move individual events in a series around if I need to - without interrupting the series. That's great for holidays on Monday when I need to send in my weekly hours on Friday because that Monday I'll be out. It's just a fantastic little tool. Love it.

It's just funny to realize I would have come in without knowing this. Silly me.