Wednesday, March 31, 2010

Not a trend setter

I was reading an article today about a phrase that someone had heard in their office and how everyone was latching onto it (like "moving forward" (meaning "we should have done this before and promise to do it in the future"), or "we're being proactive about that" (meaning "we're afraid that someone might sue us over this so we're going to have to do it"). While I've never liked those phrases and wish people would just say what they mean, I've always thought it would be fun to coin a new phrase.

I have always liked Woody Allen's movie Sleeper. The main character, played by Woody, has been put in a state of suspended animation in the hopes that some time in the future they will find a cure for his illness. When he is finally brought back to consciousness, 200 years later, the country is a totalitarian state and he is being asked by the rebels to infiltrate the government. They find out that the dictator has actually been killed and all that remains of him is his nose. After Woody is captured and escapes, he is mistaken for a doctor and asked to use the nose to clone another copy of the dictator. The scene that follows, with Woody and Diane Keeton playing for time as they try to get away, is hilarious. Of course, they have no idea what they are doing and they put on more of a song and dance routine than actually doing anything medical. Throughout the procedure they keep saying they are cloning the nose.They never do.

Their little skit reminded me of some people I knew who, when they were trying to explain what they were doing or trying to get the higher-ups to accept their project, obviously had no clue about what they were doing. I started classifying this as "Cloning the Nose". I thought it was hilarious and and I used it all the time. I still chuckle when I think about it becuase it reminds me of that funny scene in the movie. But I could never get it to catch on. Oh well, moving forward...

Thursday, March 25, 2010

Small Basic

I've been looking for a way to teach my children a programming language for a few years now. I keep changing my mind from teaching them a simple, easy-to-use language to using something that will be useful even if they decide to do it for a living. This has gone of for a few years and now that our son Evan is 13, it seems like it is time to stop messing around and pick one to get started.

I've decided to start with something simple and fun. It will teach the fundamentals and will be easy to get started with. One of my criteria for the language (and the tools you use to create programs with it) was that it could be used to make simple games. Just writing programs to sort numbers or edit text is not going to engage a young person. They want something they can use right away and that will be fun. I also wanted something that will help them along as they go. So, I decided to start them with Small Basic from Microsoft. It is indeed small with few commands to learn before you start in with programming. It comes with a nice way to write the programs and test them and the help system is not too bad. As you type commands, it attempts to figure out what you're looking for and offers information on the command you are typing. There is also a way to share your ideas with other people. And it's free!

This is going to be another of my irregular post series. I'll be posting any interesting things we find as we learn this new language. I'll try to add a few examples to make it easier to understand certain concepts in software engineering. But mostly, we're just going to have some fun.

Monday, March 22, 2010

Sad day for a mug

My parents bought me a mug like this back in the 70's. I don't remember if they got it for me while I was in college or when I got a job and moved away. But it was at least 30 years old. I liked it because it was small and I couldn't drink too much coffee or tea during the day. It was also a conversation piece.

There had been a commercial for Nescafe on television back in the late 60's or early 70's that showed a much larger, rounder globe that was really impractical for drinking because the hole in the top was too small and hard to get to your lips. But Nescafe must have had a lot of requests so they made this more practical version.

Well, today I was heating up my cup of tea in the microwave and wasn't watching what I was doing and I dropped it. It shattered into a million pieces - well beyond hope of gluing it back together. I didn't have much chance to think about it and lament because people were coming in for coffee break and I needed to clean the mess up. It wasn't until I got back to my desk (tea-less) that I started to feel sad about it. But now I have the opportunity to bring in one of the mugs my family has bought me over the years to use here. I hope I can be careful and make it last another 30 years.

Thursday, March 18, 2010

Some old pictures worth showing

There used to be an Air National Guard airbase near us. The squadron was moved about a year ago but when they were here, there was an air show at the base every year and sometimes the famous US Air Force Thunderbirds would be there. I never got to the air show itself but, with them flying at nearly the speed of sound,  it was hard to keep that kind of action in a small area. We would see them practicing or flying over us as they turned to make another pass over the grandstands at the show. So, one clear and sunny day, we saw them practicing for the upcoming show. I snapped these pictures as they flew near our office. These pictures are from August, 2007.

The top picture shows them at my camera's maximum zoom level as they made a turn over the parking lot. The next picture (to the left, also zoomed way in) shows them flying straight down toward the ground. Of course, with me cropping the pictures to fit in this space, it's hard to tell if I didn't just turn the picture 90 degrees to make it look like this. I guess you just have to trust me! I wouldn't do that. I can't imagine going that fast and seeing the ground coming up on you quickly. They weren't that far off the ground at this point. Too bad I didn't get this picture with the ground included so you could see how close it was. Believe me, I tried but they were moving so fast it was tough to just get the pictures I did.

The next picture does show how close they flew over the trees. Besides being so close together, they also had to worry about their altitude. I couldn't even do this as a passenger. I've seen various news stories where the reporters fly along with the Thunderbirds or the Blue Angels (the Navy and Marine Corps' precision flying squadron). So, they did it while holding a camera, too. Amazing!

There were actually five planes flying that day. I don't know where the fifth guy hung out. He would come and go and I never saw just one plane flying by itself. We'd just see five planes and then we'd see four. It was like magic. The next picture shows a five plane formation in the form of a cross. In this picture, they flew right over my head but this is, again, zoomed way in so they weren't right over my head :-) I think the noise would have deafened me.

The final picture at the bottom was a lucky break. I happened to get another picture of the cross formation as they passed over our flag. I had to zoom out to fit the Thunderbirds in with the flag but it's still obvious they are in the cross formation. The planes are in the upper left and if you click on the picture, you'll see it larger.

Tuesday, March 16, 2010

Yet another missed opportunity

I continue to walk in the woods behind our office at lunch time but the opportunity for pictures of wildlife certainly diminishes in late fall and doesn't increase until spring. So, it is with regret that I have to tell you about another missed opportunity. I wrote about missing a good picture of a squirrel here and of forgetting to take a video of large snow flakes falling slowly and vertically here. Well, I have to admit to another great shot that I missed; all because I didn't question why something was happening.

You can see from the picture here that there were a lot of crows flying around when I was out on my walk that day (Friday, March 12). If you click on the picture, you can see at least seven crows with some of them perched in the tree. They were agitated, making a lot of noise and not staying in one place for long. So, I tried to get close enough to them to get some pictures of the individual crows. But they were too fussy. I should have thought about why. I've seen this behavior two or three times before and should have realized that a hawk was probably in the area. The crows will get together to chase a hawk out of their area.

As I crept up on the crows, I noticed some fluttering of leaves at the top of a tree but ignored it. Too bad. It turned out that the "fluttering leaves" was a huge, beautiful hawk at the top of the tree and it took off before I could get my camera pointed and focused for the shot. It was gone in a few seconds with the crows chasing and calling after it. Maybe one of these days I'll put all my missed opportunities in an album :-)

Monday, March 15, 2010

Why I went to college

When I worked for the US Geological Survey, I went to sea many times as we collected data about the ocean floor. We would go out for a month or so at a time and trace large grids as we mapped what the bottom and the layers of rock underneath looked like. Back and forth. Up and down. In good weather and bad. It all sounded so exciting at first but ended up being pretty boring most of the time. We'd put some equipment over the back of the boat and tow it around and bring the equipment back in again. Rain or shine. Ship time was expensive and you didn't want to waste a minute of it. One of the ships we used was the R/V Gyre run by Texas A & M University. It's pictured at the right.

One day as I was helping out on the deck in the rain, I thought, "What we need is some background music. Wouldn't it be more fun to work out here if we had a pleasant song playing?" So I decided to try it on my own. I always brought a tape player with me and when it was my turn to work in the lab, I'd play some music. I taped the song Singin' in the Rain (the version from the movie with Gene Kelly singing) and thought I'd play it the next time I saw people working out in the rain on the deck.

Finally, one day, when I was on watch in the lab which looked out over the back deck, it started to rain gently while people were on deck working on some of the equipment. It was time to make their work more enjoyable. I started up the tape player and held it up to the intercom and held down the Talk button. Unfortunately, when you were talking into the intercom, the speaker was turned off (so you didn't just hear yourself echoing in the unit) and I couldn't tell if the music was loud enough. So, I turned the volume up a little but I still couldn't hear anything coming from intercoms in other places. So, I held the tape player a little closer and turned the volume up a little louder. Finally, I could hear the lovely, soft sound of the song coming from an intercom down a passageway. What I failed to realize that the loud noises of fans and blowers in the lab and the fact that the doors were closed to the lab made it very hard for sound to penetrate to where I was.

I looked out the porthole to see how the guys on the deck were enjoying the music. But before I could see anything, the Captain of the ship came bursting into the lab and started yelling and swearing at me to "stop that noise". I had never seen him so mad (and never saw him that mad again). I was horrified. What had I done to make him so angry? I found out later that my "lovely, soft" music was actually incredibly loud. Apparently, the Captain was sitting in the galley (I think they called the area food was prepared and where we sat to eat it by the same name) to eat. They said my first attempt to get the music on the intercom was extremely loud and my later attempts to increase the volume only made it worse. My friends pointed out that the Captain's seat was right by the intercom and he jumped a foot when the music first blasted out of the intercom. Then he started running around trying to find out who was making the noise. As he went in and out of the galley as he looked different places, the noise increased in volume and the Captain got redder in the face.

He decided to punish the whole scientific party for my mistake by not showing a movie that evening which made me feel even worse. Now, my stupid act was affecting everyone. I went to the bridge that evening during the Captain's watch to apologize. He had finally calmed down and he accepted my apology. After a little more talking he relented and reinstated the movies for the next night. He still couldn't understand why I would do such a thing, though. He ended with, "You went to college didn't you?" The incongruity of this struck me and I was lucky to keep from laughing and enraging him again. I just had to get out of there before I broke.

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.