Recently I purchased a new Ham radio. It isn't anything special, just an inexpensive hand-held unit used to help with local events or emergencies. This new radio has the ability to program 128 memory channels using a personal computer. The application runs on Windows and presents you with a spreadsheet-style interface. You fill out specific parameters for each of the memory locations and then upload the information to the radio through a USB cable. This is much simpler than entering all of the information by hand using the radio's cumbersome menu system.
I don't think the software to program my radio was ever fully tested. It took me a good hour to figure out how to use it. Now that I have figured it out, it is really simple to use. The problem was that you have to do things in a certain order. If you don't then the software freezes or refuses to communicate to the radio. It was frustrating while I was figuring it out and I almost sent back the radio.
Testing is very important and something that I have to do on a software project I am working on in my spare time. Since I spend most of my evenings away from home, I have three or four hours a night to work on the software and it is coming a long nicely. When I was home in Utah this weekend, I took the opportunity to show it to my wife. I noticed several problems during the course of my demo and was able to get them fixed immediately.
Most commercial software companies have formalized methods they use to ensure their products live up to expected levels of quality. One method is using someone who didn't write the software to test it. For smaller organizations, such as a guy working on software in his basement, garage, or boat, the demo to spouse or kids can serve a similar purpose. If only the company that wrote the software for my new Ham radio had been so careful. Then I wouldn't have blown a Friday evening trying to figure out how to get their software to work.
Tuesday, November 16, 2010
Monday, November 15, 2010
MySQL vs. PostgreSQL
The PostgreSQL community recently had PgWest, which is a conference where users and developers gathered together to learn from each other. It was held in San Francisco, near where I work and so I submitted a paper to present. The paper was accepted and I spent a day at the conference. I would have liked to stay for all three days but had a project back at the office that required my full attention.
One of the sessions that I missed was on the differences between MySQL and PostgreSQL. Both are database management systems and are freely available. MySQL was controlled by a single company and then was purchased by Sun, which was then purchased by Oracle. PostgreSQL is a community project with developers all over the world. I would have liked to attend the presentation as I use both MySQL and PostgreSQL for my job.
Looking at all of the online traffic generated by the presentation, I really wish I had been there. I get the feeling that it was a bit like watching a cat thrown into a room full of hungry dogs (MySQL being the cat and all of the PostgreSQL fans being the hungry dogs). I have to sit back and laugh at all of the contention the one presentation has caused. It reminds me of the movie, "Monty Python's Life of Brian." The movie takes place in Jerusalem during the time of Christ. There are several Jewish groups opposing the Roman occupation. One is the "People's Front of Judea" and the other is the "Judean People's Front." Instead of working together to rid themselves of the Romans, they fight against each other.
PostgreSQL and MySQL are both open source databases and can be used without any licensing costs. They may have different architectures and methods of development, but they allow users to run complex database management systems without the burden of heavy fees required to run Oracle, Microsoft SQL Server, or IBM DB2. Maybe someday the two camps will stop arguing long enough to figure out they are on the same side and stop trying to steal each other's users.
Then again MySQL is now owned by Oracle . . . who charges large sums of money to use their "other" database product . . .
One of the sessions that I missed was on the differences between MySQL and PostgreSQL. Both are database management systems and are freely available. MySQL was controlled by a single company and then was purchased by Sun, which was then purchased by Oracle. PostgreSQL is a community project with developers all over the world. I would have liked to attend the presentation as I use both MySQL and PostgreSQL for my job.
Looking at all of the online traffic generated by the presentation, I really wish I had been there. I get the feeling that it was a bit like watching a cat thrown into a room full of hungry dogs (MySQL being the cat and all of the PostgreSQL fans being the hungry dogs). I have to sit back and laugh at all of the contention the one presentation has caused. It reminds me of the movie, "Monty Python's Life of Brian." The movie takes place in Jerusalem during the time of Christ. There are several Jewish groups opposing the Roman occupation. One is the "People's Front of Judea" and the other is the "Judean People's Front." Instead of working together to rid themselves of the Romans, they fight against each other.
PostgreSQL and MySQL are both open source databases and can be used without any licensing costs. They may have different architectures and methods of development, but they allow users to run complex database management systems without the burden of heavy fees required to run Oracle, Microsoft SQL Server, or IBM DB2. Maybe someday the two camps will stop arguing long enough to figure out they are on the same side and stop trying to steal each other's users.
Then again MySQL is now owned by Oracle . . . who charges large sums of money to use their "other" database product . . .
Labels:
database,
IBM DB2,
Microsoft SQL Server,
MySQL,
Open Source,
Oracle,
PostgreSQL
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.
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.
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.
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.
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.
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.
Labels:
Hard Disk Crash,
Mac,
Mac OS X,
MacBook,
replace hard disk
Subscribe to:
Posts (Atom)
