Thursday, October 28, 2010

The High Cost of Windows

Now that my son has a much larger hard disk on his MacBook, he can put more stuff on his computer. One of his classes at school requires a program that only runs on Windows. I suggested he pick up a copy of Parallels which will allow him to run Windows at the same time as MacOS X. The only problem is that he would also have to purchase a copy of Microsoft Windows.

In full disclosure, I gave up on Windows many years ago. When I buy a new computer that isn't a Mac, the first thing I do is repartition the disk so that a small portion is devoted to Windows and then install Linux on the rest of it. I find Windows to be slow, boated, buggy, and susceptible to malware. On my latest computer, I haven't even tried to boot into Windows and I have had the computer for over a year. When my son informed me that he needed a Windows program, I wanted to help him find the best way to get it running without screwing up the rest of his computer and that is why Parallels makes sense.

In the process of upgrading his hard disk, my son decided to buy a new copy of Mac OS X. It cost him $30 and was well worth the price. The latest version doesn't take up as much space as the previous version and also seems to run faster. As a full-time student, my son can get a copy of Parallels for $30, which isn't too expensive. Then came the shocker: the high price of Windows 7. Since my son doesn't have an existing license for a copy of Windows, it will cost him $199. If he wants to upgrade a copy from one of my machines where I don't use Windows, it will still cost him $119. I guess Microsoft has to pay a lot of money to all those people who think Windows 7 was their idea.

My son is a pretty smart kid and decided that $119 is just too much money and will opt to use the computer lab at school. Sure it isn't as convenient as working on his homework in his apartment, but $119 buys a lot of pizzas.

Wednesday, October 27, 2010

Doing Things in Parallel

Yesterday I had a busy day at the office. I had to migrate data from one computer to another. It was a lot of data and I knew it was going to take all day. Unfortunately it couldn't all be done at once and had to be done in chunks. As I wanted to be as efficient as possible, I looked at how I could do things in parallel.

The first process was to export a subset of data out the database on the first machine. That took about 5 minutes. Next was to compress the exported data and that took a minute. The middle step was to transfer the compressed data to the new machine and that took the bulk of the time at 20 minutes. Once on the new machine, the data was uncompressed (another minute) and imported into the new database (another 5 minutes). If you add up the time for the entire process, it amounts to thirty-two minutes. Unfortunately there were about 20 data segments to move. Doing it 1 segment at a time meant I would be at it for over 10 hours.

Having done this once or twice before, I knew that I could start the process on future data segments before the earlier ones completed. Doing so would reduce the time to complete the job from over 10 hours to less than 7. Of course that meant I would be busy the entire time. However it was worth it to get the task done more quickly.

Now the question is: What does the process look like? Easy, the first segment requires that I export the data and compress it. That took 6 minutes. Then I needed to transfer it to the new machine. During that transfer, I could start the next segment and eliminate 6 minutes for each of the remaining segments. I could also start the data import of the first segment while the following segment was transferred. That eliminated another 6 minutes per segment for 19 of them. If you do the math, there are 6 minutes at the beginning and 6 minutes at the end. Then there are 20 segments at 20 minutes each to transfer. That amounts to 6 + 6 + (20 x 20) or 412 minutes, which amounts to 6 hours and 52 minutes.

That is a nice reduction but you can see that it is not 50% of the original 10 hours and 40 minutes. That is important to remember the next time that someone tells you a computer with two processors can do twice as much. While it is a good goal, it isn't always practical.

Thursday, October 21, 2010

Learning MySQL

I originally started today's entry with the title "I Hate MySQL." However I realize that I don't like it mostly because I don't know it very well. In an effort to be more fair to MySQL, I toned down the title a bit and publicly acknowledge that I have some learning to do.

For those that don't know, I prefer PostgreSQL to MySQL. I use PostgreSQL daily and it is my database of choice on any new project. I also know the Oracle database well and have used it in various production systems. Unfortunately it is rather expensive and PostgreSQL will do 95% of the things Oracle can for a lot less money.

Today I have to administer a MySQL database because of performance issues. I have about 8,000 rows that I need to move from one table to another. This involves inserting them into the new table and then deleting them from the old. You would think that given the rantings of many MySQL followers that such a task would be simple and quick. Unfortunately the application that I am using references two other very large tables which complicates things a lot. I started this move yesterday at 10am and it still hasn't completed. There are tools that allow me to see what is happening in the database and the delete seems to be running longer than one would guess. Unfortunately there doesn't seem to be anything I can do to speed things up.

During my frustrating morning, a friend sent me a link to a very funny video where two stuffed bears are discussing MySQL vs. PostgreSQL. The language is very crude and so I won't post the link here. However it did put a smile on my face.

Wednesday, October 20, 2010

Combination Locks and Passwords

Yesterday I got to do a bit of shopping and picked up a lock for my bicycle. Now I can use my bike to go shopping and not worry about leaving my bike in the front of the store. While I was making the decision, I had a choice between a combination lock or a key lock. I decided on a combination lock so I don't have to worry about always having the key with me.

When I was about 8 years old, I discovered that padlocks came in two basic versions: keyed or combination. I told my dad that I didn't ever want a combination lock because I might forget the sequence of numbers. He informed me that it was much more likely that I would lose the key. When I finally got to Junior High, I was issued my first combination lock and quickly overcame my fear of using random numbers to open doors. I still have a padlock that I got during that era of my life and have not forgotten the combination even though it can be years between uses.

Several months ago, I was headed to the airport in Salt Lake when I realized that I left the keys for my California car at home. I had to rush home, get the keys, and return to the airport. I made my flight with only minutes to spare. Had I forgotten my keys, it would have been impossible to get my car out of long-term parking. I would have had to get my wife FedEx them to my office and paid for an extra day of parking. I would have also had to find an alternative way to get from the Oakland airport to my office in Foster City. I now have a spare car key that I keep on the boat in case something similar happens again.

Thinking about my new bike lock and why I chose the one I did, reminded me that we use combination locks all the time. Every time I use an automatic teller machine to withdraw money from the bank, I use a 4-digit combination or password. Every time I log into one of my many computers, I am forced to use a password which is a type of combination lock. That gives me an idea for a new password: thirty-0-twenty4, my old combination lock from Junior High.

Tuesday, October 19, 2010

Back From the Dead

This weekend my son and I worked on getting his computer back from the dead. He has a MacBook and so the first thing I did was try to boot the machine. That didn't work, which was expected and so I booted from a CD. On a Mac, that is done by inserting the disk that comes with the computer and holding down the "C" key while turning off and on the computer. The computer came up and looked like it wanted to install the operating system. Fortunately you don't have to proceed any further. There is a menu across the top of the screen and you can just go into Utilities and select Disk Utilities. That brings up a program that can be used to fix certain problems.

At first, the only drive that registered was the CD/DVD drive. Then I needed to move the computer for some reason and that act caused the hard drive to show up in the menu. Unfortunately, I couldn't do anything with it. My hope was that the "Repair" button would activate, but that didn't happen no matter what I clicked on or selected. My suspicions were confirmed and the drive was toast.

It was now up to my son to make a decision. He could buy a new hard drive, rent a new computer, or buy a new computer. When he calculated how much money it would cost to rent a computer, he decided that the better option was to buy one. I disagreed with his logic because a $300 laptop is not the same quality of machine that he would have been renting, but didn't say anything. I had to go down to Best Buy to replace a hub I use for the network at the house and so he came along with me to see how much a new hard drive would cost. It was only $50 to get a 250 GB drive and so he picked one up.

My son brought home a friend from school who claimed to take apart Mac computers all the time and so I let the two of them figure out how to open the machine. They removed every visible screw on the outside but still couldn't pull off the cover and asked me for some help. There were three screw inside the battery compartment that I was able to remove. Once I did that, a bar came out, revealing a pull tab for the hard disk. I simply pulled the tab and the disk drive slid out. There was no need to remove all those other screws and so I had the boys put them all back. Meanwhile I pulled the old disk off the mounting tray and put the new one on it. We slid the new drive back in place, replaced the aluminum bar, and screwed in the three screws.

Now it was time to see if our hard work had paid off. We turned on the computer, inserted the Mac OS installation CD and waited for the installation program to start. When it did, we just followed the instructions to format the hard drive and install the operating system. That took about an hour and then it was time for my son to head back to school. I sent him with the installation CD's for a number of other programs that were previously on the computer (like Microsoft Office). My son then spent the rest of the weekend finishing the task of getting his computer back in working order.

Yesterday I got a call from my son. He has his computer back but isn't happy with the version of the operating system. I installed the version that came with the original computer and it is a bit out of date. He wanted to install the version that I have on my Mac, but that would be a violation of the software license agreement. It is only $30 to get the latest version of the Mac OS and so he decided to spend the money. It is amazing how much more thought goes into spending money when it is my son's own cash instead of Dad's.

Thursday, October 14, 2010

To Bike or Not to Bike

Last weekend I drove my car back to Salt Lake from San Francisco. I only got pulled over once, when I stopped in a small Nevada town to get gas. The officer was nice enough when he realized I was just trying to get gas and use the restroom. He let me off with a warning. Otherwise the drive was mostly uneventful.

I drove my car back because it is time for the annual smog and emissions check. I could license the car in California, but I don't have a mailing address there nor do I want to pay the massively larger licensing fee. My plan was to drive the car back to California this weekend once the licensing is taken care of.

Now the question is if I want to bring the car back at all. I ride my bike to and from work so I really only need the car for two reasons: trips to the airport and trips to Scout meetings on Mondays. The airport problem can be solved with public transportation. It really cuts into my days, but it works. The only remaining issue is getting to Scouts.

In an effort to promote a "greener way of thinking", Google maps now has the additional options of getting directions using public transportation, walking, or riding your bike. I did a quick search to see how difficult it is to get from my office to the Elks Lodge in Redwood City, where we have our Scout meetings and it is only 10 miles. Amazingly, taking public transportation takes the same amount of time as riding my bike. I might as well ride my bike.

Several years ago I used to ride my bike 18 miles each way to work. That amounted to 36 miles of cycling every day. I loved it because I could eat as much food as I wanted. I never had to worry about being on a diet because I was constantly burning more calories than I could take in. The only problem was when we moved offices, I continued to eat as much as I wanted. In an effort to drop a few pounds, I'm thinking it is time to leave the car in Salt Lake and use the bike as my sole means of transportation in California. Maybe it is my starving stomach talking, but I think I could get used to eating more than I am right now.

Wednesday, October 13, 2010

Another One Bites the Dust

This morning I got a call from my son in college. I could tell by the stress in his voice that something bad had happened and I waited for him to let me know what it was. He was working on his laptop computer when it froze. This was very unusual as he uses a Mac. When he rebooted, he got the icon of a disk with a question mark on the screen and immediately knew that he had lost his hard drive. Then he called me.

My first question was what assignments he had due that were lost on the computer. Luckily there was only one and it isn't due until tomorrow. I informed him that he would probably have to redo it and he wasn't keen on the idea of taking another four hours to complete an assignment he had done before. He was also halfway done with a computer programming project that would need to be started again.

I was glad this was my son who likes to get things done early and not my daughter who waits until the last minute. Furthermore, he had gotten ten hours of sleep last night and is rested enough to pull an all-nighter this evening if it becomes necessary.

The next task was to assess the best way to get a temporary computer until we could get together on the weekend and see about fixing his current one. The university where he is attending school rents laptops for $35/month. The government just awarded my son an extra $2,000/semester scholarship because of grades and his math/science major. So $35 is not going to put too much of a strain on his finances.

Our final step was to figure out the timing of everything. While a new computer is nice to pick up, you can spend countless hours configuring it which can distract even the most disciplined student from getting more important things done. My son had an hour before his next class and so he was going to assemble his notes for the paper that disappeared. He would then go to class before heading to a computer lab where he could work on getting his assignment in. Finally, he would pick up a rental computer.

I then had my son call my wife to see if she could help out with anything. She decided to give up her computer for the rest of the week as she can use the family computer until my son can come home and we can work on fixing his. She then drove the hour down to my son's university to deliver the computer. She also took my son out to dinner. What a nice Mom.

Last weekend I got to relax and go sailing. It looks like this weekend I get to fix my son's computer. That's OK, I get plenty of time to relax during the week when I am out in California.

Monday, October 11, 2010

Help or Hurdle

Last week I attended a district roundtable in the Pacific Skyline Council for the Boy Scouts of America. Roundtables are monthly meetings were adult leaders are given instruction and help on how to run the various scouting activities. It was my second Roundtable in this council and was very different from the ones I am used to attending in the Great Salt Lake Council. Thursday night I came away feeling like the adult leaders here in California create hurdles for the boys while in Utah they try to help them.

Baden Powell, the founder of the worldwide scouting organization believed that the Scouts should be run by the boys and not the adults. Thursday's meeting underscored why: because adults will only screw it up.

The topic of this month's roundtable meeting was on the Eagle Scout project. Eagle is the most difficult rank advancement in the Boy Scouts of America and is made so by a leadership service project where the scout is required to propose, plan, and carryout a significant project to benefit the community. The reason behind the project is for the scout to demonstrate leadership. It is a big deal and should not be taken lightly.

There were two people at the meeting that are responsible for approving projects and helping the boys attain the rank of Eagle. One of them posed the question about where to go for project ideas. A few ideas got tossed out with some being shot down for various reasons. I suggested they take a page from the Great Salt Lake Council's playbook and set up a website where scouts could go for ideas. My idea was shot down because it made selection of a project too easy for the scout. I bit my tongue as the discussion continued. It was only my second meeting and I didn't want to be known as the troublemaker. In the end, they decided that it would be a good idea to have a list of previous Eagle Scout Projects.

I suppose I should be glad that the group saw some merit in my idea, however I think they missed the point. The adults in the Boy Scouts of America should be constantly asking themselves how they can help the boys succeed as well as the scouting program. While the proposed solution does make one step in that direction it misses on one very important aspect: attracting new members. The beauty of my proposed solution is that it provides an outlet for schools, cities, and other community organizations to list projects where they could use the help of a service oriented group. Imagine the difference it would make if everyone saw the Boy Scouts of America as an organization that made a difference in the local community as well as created leadership and strong ethical values in today's youth.

Tuesday, October 5, 2010

Using The Tools You Have

Last week I started a new diet. Recently I stood on the scale and it gave me a really big number. I had slowly been watching the number rise and knew my current diet and exercise plan wasn't working. It was time to do something else. About a year ago, I wrote about an application for my iPhone called Lose It. I still think it is a great tool, I just happened to get lazy and stop using it. Unfortunately, it shows.

I would not recommend my diet for anyone. It is awful and I hate it. Fortunately it is working or I would stop it right now. The diet is one of those cleansing diets where you drink two shakes a day and then enjoy a sensible 400 to 600 calorie meal. Then one day a week, I go without food and drink this nasty concoction that tastes like a cross between apple cider and the dead skin between your toes (or at least how I imagine that would taste). Yesterday was my first cleansing day and my only salvation was that raspberries went on sale at the supermarket next to my office. I know I cheated on the diet, but I figure if you are going to eat something, raspberries aren't going to hurt. It is the only thing that got me through the day.

So far I am down 5 pounds after the first week and I should be able to continue that rate. The only reason I can continue with the diet is because I know there is an end in sight. Three weeks from today I will be done and can go back to eating real food.

The reason I gained weight is because of my ugly travel schedule. I spend 5 days a week in San Francisco and then 2 back home in Salt Lake. I am good about watching my weight in San Francisco but then binge eat when I am home. Being on this diet showed me where I have eating problems and now I know how to fix them. In 3 weeks, I will start using "Lose It" again, which will help with my portion control and regular exercise. Until then I am counting down the days.