Friday, March 12, 2010

A time to reflect

My wife's uncle died last week-end and we went to his funeral on Wednesday. He was related to my wife by marriage and I'd never met his side of the family. I wish I'd have gotten to know him better. But we always say that don't we? We never seem to have the time to get to know someone while we have the chance and once they are gone, we've lost our chance. Oh, there are still stories about them. Their loved ones will be reminded of something that they hadn't thought about for years. But you can't go back and ask them, "Did that really happen?"

Funerals are a sad time but in a sense, you can be grateful that it wasn't you or someone closer to you. And in a sense, as Christians, we should be glad that the person who died is now at rest and with the Lord. They don't have the pain they had before. They don't have the problems they had before. But on the other hand, they won't have a chance to see new, wonderful things happening. They won't get to eat their favorite food again. They won't hear their favorite song again. I think we are right to be sad and somber at funerals. The people who have loved them and depended on them will miss them.

We just need to temper our sadness with hope. Remember:

He will take our weak mortal bodies and change them into glorious bodies like his own, using the same power with which he will bring everything under his control.
Philippians 3:21 New Living Translation

I have nothing profound to say, I guess. Everything I've said sounds trite. For as many funerals as I've been to and for as many times as I've thought about this, I have nothing new to say.

The picture here is just for effect. It comes from this site.

Tuesday, March 09, 2010

The lottery where everyone wins

I remember the furor when states first started thinking about the idea of having lotteries to generate income. That was something criminals did. Why would the state do it (other than the fact that some people see any government as a criminal activity)? Would the states no longer prosecute the bookies and the mob for running numbers games?

It finally happened in 1964 in New Hampshire and, as we all know, almost all of the states now run lotteries and continue to prosecute anyone but themselves who do such a thing (unless it's for a good cause like a church or a youth organization). But once everyone did it, then people had many choices of where to buy their lottery tickets. So, the states made different lotteries with different advertisements and cards with different pictures on them. Every year it seems our state comes out with a new lottery that is even more fun than the previous lotteries.

So, a few years ago, when they were making a big deal about a new game and advertising it heavily, I noticed in the full disclosure section that only half the money would be paid out in prizes. The rest would be going to projects around the state (like picking up the litter of discarded losing lottery tickets). So, I decided to start a lottery of my own and sent an e-mail around our office (when we could still do that easily). It said,
Announcing a new lottery. In keeping with the traditions of the state lottery, I've come up with a scheme that will be fun and exciting for everyone. Just come to my desk and give me a dollar and I will give you fifty cents back! No waiting for a daily or a weekly drawing. Everyone is a winner. Don't forget, you can't win if you don't play.
No one took me up on my offer. It's a good thing, I guess, or the state would have had to arrest me.

Monday, March 08, 2010

Nearing the end - Part 2

As I said in my previous post, we are nearing the end of a large project that has gone on for over a year. But last week, after finding (at the last minute) a problem in my code and finding out that it was really a problem with some code we bought, I regretfully agreed to just disable the part of my code that showed the problem. There wasn't enough time to fix the problem. it was just a convenience feature and wasn't critical to the operation of our program. So, as unsatisfying as it was to leave it that way, I seemed to be off the hook for any further problems before we shipped - until someone had a problem reading the settings for my part of the program that he'd saved before. My first thought was that it was just a temporary problem and that just retrying the operation would fix it. But just before leaving for the day, he replied that no, it failed every time. Oh, no! How could that be happening this late in the project? The saving and reading of settings had been working for months. Why would it start failing all of a sudden - and only on one machine? I went home that night dreading the thought of the next day.

I couldn't duplicate the problem on my computer. So, I had to copy all the data from the computer showing the problem. I still couldn't see the problem on my computer (where I could run the program inside the development system and analyze it). So I tried different types of settings to save and read. I still couldn't see the problem. The pressure was on and I would have to fix this - even if it took a lot of work and a big change to the code. This was turning into a nightmare. I was looking for anything that would cause any kind of problem that I could imagine. One thing I noticed was that I was asking the screen to update more often than it really needed to. So, in the hope that this was taking time away from a more important part of the program, I reduced the number of times it updated - and it failed for me like it did for the guy who reported the problem! Finally I had something to work with!

The nice thing about modern programming environments is that they let you put Breakpoints in a program. It's almost like when your driving from one place to another and decide to stop for gas somewhere and you can check the tire pressure there, too. Then you decide to stop for lunch somewhere and you can look at the brake fluid while you're stopped. Likewise, in a computer program, when you are running the program from inside the development program, stopping at a Breakpoint lets you look at the state of the program at that point. And even better, but more time consuming, is Single-Stepping. This lets you execute your program one line at a time. You can examine the state of the program just before or after each line executes. But I noticed that the program would get to a certain part of the code and then would veer off into the code that handles errors. So, I had to adjust my Breakpoints until I got closer and closer to the problem. Finally, I saw what it was - I had been expecting a certain string of characters to either be a number (a combination of the digits 0 - 9) or a special word "Updating". Well, in this case it was neither. It was just blank. Because I wasn't updating the screen as often, the string of characters hadn't been initialized correctly. So, that was it. The string didn't say "Updating" so I had assumed it was a number and tried to convert it as a number. Well, the code that did that didn't know how to handle a blank space and gave up. It was simple to fix but I had to verify it on the machine where it first appeared. Maybe this wasn't the problem after all.

I rushed to make a new version of the program that could be installed on the problem machine and ran it and it worked! The computer that had shown the problem was running with so many connections and so much data that the initialization code I wrote was running slowly and wasn't setting up the strings of characters to either "Updating" or a number that could be converted. The slow machine hadn't had time to change the strings from their default "nothing" state before being asked for the data.

So after a night of tossing and turning in bed imagining what the problem could be, I'd fixed it in a few hours. I was exhausted. I felt like I'd been in a fight. It took me the rest of the day to calm down. But it felt great to have the problem behind me. Here's hoping no more problems crop up before we can release this thing.

Friday, March 05, 2010

Nearing the end - Part 1

Each person at our company works on a number of projects at any one time. We work on some small projects and usually one large project at the same time. The large project I'm working on has been going since February - 2009! It was originally supposed to be done by the end of the the summer of 2009. Then it was extended to just before Thanksgiving 2009. Now, we're looking at finally finishing it up in a week or so. Thank you Lord! I (and my family) need some time off.

But before we can get to the point of releasing the product, we need to do final testing and the product needs to run for a week with no major problems. My part of the project seemed to be going along quite well until someone tried something that you normally wouldn't do but should be allowed to do. Sorting the list of entries in a table while the table was being updated caused a terrible flickering in the table. You couldn't use it while the updating/flickering was going on and this could go on for minutes in some circumstances. So, it was deemed a problem of high importance and needed to be fixed before we could release.

Now, I'm used to fixing problems in code I've written. Some people estimate that you spend 2 - 3 times the hours fixing problems as you do writing the original code. I think that overstates it but you do end up spending a lot of your time fixing problems instead of adding new code. But I don't like fixing problems under pressure. Yes, it happens fairly often but I don't like it. Especially when everyone is waiting for me and depending on me so they can finish this thing! I worked over the week-end on it and couldn't solve it. Finally, after two days of trying, I had to admit defeat. There were ways to solve it but there wasn't enough time to do them and check for problems. So, we just disabled sorting for now. Yuck.

Then, when I had some time to work under less pressure, I found that the problem wasn't in my code but in the code by the company who wrote the code for the table itself. And, if we updated to the latest version of their table code, it solved the problem! Unfortunately, there wasn't enough time to do that update and check for the inevitable problems that would cause us. So, we were left with not being able to sort the tables for this version and then we would update the table code for the next minor release of the software. So, we were back to our waiting out the week to release the product. Onther small problems were found and fixed but they weren't serious enough to restart the "must run for a week" clock. We were getting close. And then another problem with my code was found! That story next time.

Monday, March 01, 2010

It's St. David's Day again

Happy St. David's Day! It's been a while since I posted a St. David's Day article.

My heritage is mostly Welsh. My father was born in Wales (in Monmouthshire where his family lived) and my mother's family is mostly Welsh.

St. David is the patron saint of Wales much like St. Patrick is the patron saint of Ireland. It is a time of singing and poetry reading and the staging of plays and the playing of rugby matches. I was going to cook up a big pot of leek soup and offer a cup to anyone interested but I just got behind in everything. Maybe next year.

Saturday, February 27, 2010

Yet another birthday

I'm 59 today. I feel a lot better than I thought I would at this age. When I was a teenager, 30 seemed old and 40 seemed ancient. Only grandparents got older than 50 and they could barely move. Now I'm getting close to 60 and in a lot of ways, I've never felt better. I'm definitely happier than when I was younger.

Being married and having children has definitely helped. When I was single, I spent 99% of my time trying to get women interested in me and worrying about my inability to do it. I spent the other 1% getting things done that needed doing. While there was a lot of free time to do whatever I wanted when I was single, I never found the "exciting" things I did as much fun or as fulfilling as the things I do now with my family.

We're not going to do much today other than go out to lunch at The Olive Garden. There will be cake, cards, hugs and kisses. There will be some presents. But nothing beats waking up this morning and seeing my wife next to me and having my kids wish me a happy birthday. My birthday wish is that everyone could be as happy and as fortunate as I am.

Friday, February 26, 2010

Why NBC bought rights to the Olympics

I was listening to a story on the radio on the way home tonight about how many people are complaining about the coverage of the Winter Olympics by NBC. Most events cannot be seen as they are happening. There is too much talking and analysis and not enough action. Many events are only partially covered. We see only the highlights. This was contrasted with coverage in other countries where, as one Norwegian said, if they didn't fully cover all the events there would probably be riots.

I was thinking that while one of the obvious strategies for NBC is to have the Olympics for their drawing effect so they could compete against what the other networks are showing during this time. But I think a another part of their strategy is to keep other networks from getting the Olympics. It's almost as if NBC feels it wins by the other networks not being able to use the Olympics to beat NBC in the ratings. It's like a chess match where one player will play to a draw just so they don't lose a game in which they are not doing well. They think they'll win another time. Is that what NBC is thinking? With the kind of coverage they are showing us, I find it hard to imagine when they might win.