I have decided that I no longer need a car in California. At least not for the summer. My boat, where I sleep is only 4 miles from the office and I need to ride my bike daily as I am getting too fat. I don't really go anywhere else and so cycling is a perfectly acceptable form of transportation.
Yesterday I used a frequent-flyer ticket and flew my 17-year-old daughter from Salt Lake to San Francisco to help me bring my car home. It was her first time flying alone and she was a bit apprehensive. When my wife dropped her at the airport, my daughter's fear was gone and she jumped out of the car at the curb-side-drop-off area. She then got to visit both Los Angeles and San Francisco airports.
I picked my daughter up at SFO and we headed the short distance back to my office where I finished up a few things before our long drive home. The last thing I did was a quick search of traffic using traffic.com to help me determine the best route out of the Bay Area. I'm glad I did because the San Mateo bridge was a parking lot. Using the Bay Bridge instead saved me lots of time.
As we head into this summer driving season and you find yourself starting from a major metropolitan area, take a look at traffic.com. You may find that the shortest route from home, isn't the quickest. It sure saved me a lot of grief.
Thursday, June 30, 2011
Monday, June 27, 2011
Relearning C
The first computer language I learned was BASIC and I was in the 8th grade. It was fun to get the computer to do various things but I really enjoyed my next class which taught me Pascal. When I got to college, I learned a few more computer programing languages including C. I would have to say that C remains as my favorite language for a number of reasons.
Recently I started a new personal project and have chosen to do it in C. I thought about using something a little more modern like Python or Perl but need something that compiles to an incredibly fast program. The tradeoff is that I will have to spend more time writing code. It also means I will have to relearn many of the things I have forgotten about C.
C is one of those languages that has a lot of flexibility but also has a lot of pitfalls. Today I was working with pointers and made a minor mistake on the syntax. Because pointers are so flexible, the syntax was correct, I just wasn't getting the results I was expecting. I used an Internet search engine to look up various examples with no success. It turns out, I needed to include some parenthesis around one small section of code. I came up with the solution after thinking about the results I was getting for a while. Then things started working correctly.
Some might be discouraged by such an experience, but not me. I just realized that I need to do some relearning and that is one of the reasons I started this project. It is my understanding that colleges and universities have moved towards teaching Java instead of C and I think that is a mistake. If it was up to me, everyone would learn C as their first computer programming language. There is something about having to work hard to get your program running. It has a bit of a learning curve, but allows you to write complex programs that run really fast.
Recently I started a new personal project and have chosen to do it in C. I thought about using something a little more modern like Python or Perl but need something that compiles to an incredibly fast program. The tradeoff is that I will have to spend more time writing code. It also means I will have to relearn many of the things I have forgotten about C.
C is one of those languages that has a lot of flexibility but also has a lot of pitfalls. Today I was working with pointers and made a minor mistake on the syntax. Because pointers are so flexible, the syntax was correct, I just wasn't getting the results I was expecting. I used an Internet search engine to look up various examples with no success. It turns out, I needed to include some parenthesis around one small section of code. I came up with the solution after thinking about the results I was getting for a while. Then things started working correctly.
Some might be discouraged by such an experience, but not me. I just realized that I need to do some relearning and that is one of the reasons I started this project. It is my understanding that colleges and universities have moved towards teaching Java instead of C and I think that is a mistake. If it was up to me, everyone would learn C as their first computer programming language. There is something about having to work hard to get your program running. It has a bit of a learning curve, but allows you to write complex programs that run really fast.
Labels:
C,
Computer Programming,
programming languages
Friday, June 24, 2011
I Hate Foo Bar
The other day I was reading through a computer coding example and was confused by the words "foo" and "bar." I'm not sure how those two words crept into our vocabulary, but they are fairly ubiquitous and I don't like them. I know they are two words that don't really mean anything and are meant to be placeholders for other information, but I wish authors would stop using them.
If I was to write an example SQL query and wanted to use foo bar, it would look like this:
SELECT foo
FROM bar
WHERE gobblygook = 'more gobblygook';
While it is an example that shows the proper syntax of a SQL query, it is not nearly as easy to understand as the following:
SELECT employee_names
FROM employee_table
WHERE salary > 100000;
I don't have to translate that "foo" could also be something concrete like an employee name or that "bar" represents a table of employees. Simply by using examples that everyone can understand greatly improves readability and makes things much easier to understand.
In this age where everyone can be a published author (like with this blog) and you find yourself creating examples. Don't use "foo" or "bar." Instead, use real words that everyone will understand, even if they are just supposed to be placeholder words. Oh, and don't use "gobblygook" either.
If I was to write an example SQL query and wanted to use foo bar, it would look like this:
SELECT foo
FROM bar
WHERE gobblygook = 'more gobblygook';
While it is an example that shows the proper syntax of a SQL query, it is not nearly as easy to understand as the following:
SELECT employee_names
FROM employee_table
WHERE salary > 100000;
I don't have to translate that "foo" could also be something concrete like an employee name or that "bar" represents a table of employees. Simply by using examples that everyone can understand greatly improves readability and makes things much easier to understand.
In this age where everyone can be a published author (like with this blog) and you find yourself creating examples. Don't use "foo" or "bar." Instead, use real words that everyone will understand, even if they are just supposed to be placeholder words. Oh, and don't use "gobblygook" either.
Thursday, June 23, 2011
Internet Learning
Yesterday I was riding home from the office when I got a flat tire on my bicycle. I have changed countless flat tires, but last night was one of the worst.
Wednesday is the day of our weekly office ride. We do an 11-mile loop around Foster City. To make it harder for myself, I do it on a mountain bike. Otherwise it would be too easy. After last night's ride, I did a bit of work at the office and then started the ride home. I had a wonderful meal planned as soon as I got back to the boat because I was very hungry. I was so hungry, I thought about raiding the vending machine before I left the office. Once I got the flat tire, I regretted not spending a few quarters.
One thing about fixing a flat tire is that you want to have a nice place to sit down. I walked a ways and found a park bench in the shade. Once I was comfortable, it didn't take long to patch the tire. I was amazed at how quickly my tire-changing experience returned even though I haven't had to patch a tire in over a year.
On my ride into the office this morning, I was glad to see that my patch was good and the tire was still holding air. I also thought about how there is no substitute for practicing what you learn. The Internet is a wonderful tool that provides all sorts of teaching tools. You can learn how to adjust the gear-shifting mechanism on your bike or how to repair a flat tire. Just remember to practice what you learn.
Wednesday is the day of our weekly office ride. We do an 11-mile loop around Foster City. To make it harder for myself, I do it on a mountain bike. Otherwise it would be too easy. After last night's ride, I did a bit of work at the office and then started the ride home. I had a wonderful meal planned as soon as I got back to the boat because I was very hungry. I was so hungry, I thought about raiding the vending machine before I left the office. Once I got the flat tire, I regretted not spending a few quarters.
One thing about fixing a flat tire is that you want to have a nice place to sit down. I walked a ways and found a park bench in the shade. Once I was comfortable, it didn't take long to patch the tire. I was amazed at how quickly my tire-changing experience returned even though I haven't had to patch a tire in over a year.
On my ride into the office this morning, I was glad to see that my patch was good and the tire was still holding air. I also thought about how there is no substitute for practicing what you learn. The Internet is a wonderful tool that provides all sorts of teaching tools. You can learn how to adjust the gear-shifting mechanism on your bike or how to repair a flat tire. Just remember to practice what you learn.
Wednesday, June 15, 2011
Where Am I?
It is nice to finally have summer here in the Bay Area. I rode my bike to work yesterday and then again today. With the high prices of gasoline, the bike is a huge money saver.
I was about a mile into my journey this morning when I came across a guy sitting on the ground with his really nice racing bike next to him. As I passed, I noticed there was a lot of blood on the pavement. It didn't take too long for my brain to register that the guy had been in an accident and probably needed some help. I stopped and turned around. When I rode up to the guy, I noticed that he had a huge gash in his chin and was on his cell phone trying to get one of his buddies to come pick him up.
The accident victim seemed glad that I came back to help and had me talk to his friend. While I knew where I was, I didn't know the names of any of the cross streets in the area. I pulled out my iPhone and pressed the "Where Am I" button in the map application. Then I zoomed in to read off the nearest cross streets. As we were on a bicycle path, we had to walk down a small path to get to the nearest road. We waited a couple of minutes for the friend to arrive.
Lately I have thinking that I don't need all of the features of the iPhone and could probably get by with something much simpler. However, today I was glad I had it and the simple "Where Am I" feature came in really handy.
I was about a mile into my journey this morning when I came across a guy sitting on the ground with his really nice racing bike next to him. As I passed, I noticed there was a lot of blood on the pavement. It didn't take too long for my brain to register that the guy had been in an accident and probably needed some help. I stopped and turned around. When I rode up to the guy, I noticed that he had a huge gash in his chin and was on his cell phone trying to get one of his buddies to come pick him up.
The accident victim seemed glad that I came back to help and had me talk to his friend. While I knew where I was, I didn't know the names of any of the cross streets in the area. I pulled out my iPhone and pressed the "Where Am I" button in the map application. Then I zoomed in to read off the nearest cross streets. As we were on a bicycle path, we had to walk down a small path to get to the nearest road. We waited a couple of minutes for the friend to arrive.
Lately I have thinking that I don't need all of the features of the iPhone and could probably get by with something much simpler. However, today I was glad I had it and the simple "Where Am I" feature came in really handy.
Subscribe to:
Posts (Atom)