Tuesday, May 3, 2011

The Game of Mafia

My Scouts love to play a game called "Mafia" when we are sitting around the campfire. It is a guessing game where innocent players try to figure out who the mafia members are before getting eliminated from the game. When you are gathered around the campfire, a narrator has everyone close their eyes and he assigns you as mafia or innocent. There is generally a ratio of 5 innocents for every mafia. Once the players are assigned, everyone closes their eyes again and only the mafia open them. They then quietly decide who to eliminate using hand gestures and signals. The narrator then has everyone open their eyes, says who has been eliminated, and then allows the group to discuss who they think is mafia. Once a consensus is reached, that person is eliminated from the game.

In an effort to get people from the various groups in our department to talk to each other, we are playing mafia at work. It is a lot of fun and I highly recommend it. It takes a bit longer in the office because the mafia gets one vote per day as does the public. That means only two people get eliminated from the game each day. With over 30 players, that makes for several weeks of play time. All voting is done via e-mail and we have a score board in the cafeteria.

It is interesting to see players come up with elaborate algorithms and spreadsheets to try and deduce the bad guys. Coworkers will ask each other if they are mafia and then gauge if the other person is lying. I have to admit, I find myself talking with people I have only passed in the hallway. The goal of the game is working. If you find yourself at a job where nobody knows anyone else, see if you can't start up a game of mafia.

Wednesday, April 13, 2011

Sifting Through Data

Today I found myself looking at a large amount of information in a database. I wanted to limit the data returned and so I enlisted the help of the substring function. There were thousands of rows of data that contained the word "mapping." I didn't want to see those rows in my query. So I asked the database for all the rows that didn't contain the substring "mapping". That gave me the information I was looking for and I was able to move onto my next project.

I was busily working when a coworker came up and asked me to change the data in another database. She started describing the problem and it sounded like it was going to be a huge task until I realized that it could be simplified with the use of the substring function. Basically I needed to remove the first 4 characters of one database field and replace it with a 5-character word. As I had been using the substring function earlier, the syntax or way of using it, was fresh in my mind. The SQL command looked similar to this:

UPDATE the_table
SET the_field = 'abcde' || substr(the_field,5)
WHERE another_field = 'xyz';

Going through the statement, the first line tells the database what table to update. The last line says we want the update to occur where a specific field is equal to the string "xyz". The second line shows the use of the substring or "substr" function. I didn't care about the first 4 characters of the existing string and so I started at position 5 (SQL strings start at character 1 while C programming language strings start at character 0, which can be confusing). I then concatenate it with the replacement string of "abcde". The two vertical pipe symbols represent the concatenate function in SQL.

The statement worked fine and I was free to get back to my other task. Amazingly I have not had to worry about the substring function for quite a while and I found it interesting that I needed it twice today.

Wednesday, April 6, 2011

Unwanted E-mail

Every morning I log into my personal e-mail and have about 25 messages waiting for me. All but about 3 of them are daily broadcasts that I have signed up to receive. Lately I have discovered that I don't really read a lot of them and so I have started unsubscribing from a few.

My real job is dealing with computers and so I have about 10 different e-mails I get on a daily basis related to information technology. About 5 of those are duplicates and so I unsubscribed from half. The other half I find myself gleaming some level of information at least weekly and will continue to sift through them. There are one or two other daily e-mails from places where I purchased goods and so I have opted to be removed from their daily flood of specials.

The interesting thing to me is what I have decided to keep. One of my favorite daily e-mails is from Steep and Cheap. If you are into camping, hiking, skiing, climbing, and just generally hanging around outside, you should sign up for their daily e-mail. They have incredible deals on outdoor equipment and I have managed to get some great skis for a very low price. Furthermore, the guy that writes the daily e-mail is incredibly funny and worth two minutes of my day.

There are the usual messages related to scouting, ham radio, and skiing. Sometimes they are important and other times I delete them without even reading the messages. As I only have a limited time to spend reading e-mail, the fewer messages I get, the more time I have to devote to the e-mails I do read.

Thursday, March 31, 2011

Time to Update My Password

For the past couple of days, my Windows machine has been warning me that my password is about to expire. Today I finally decided to change it. I have three different passwords that I have used on this machine already and I was hoping to just recycle one of them. Unfortunately Windows keeps track of my last five passwords and so I couldn't. It was time to come up with something new.

Previously I mentioned using an old locker combination and this crossed my mind. I wanted to do something a bit different and so I decided to try something else. I am sure others have the same issue and so I thought I would write about some ideas for coming up with memorable passwords.

Passwords should be a word or phrase that you will remember but are impossible to guess. You should also never use a word found in a common dictionary. So how are you supposed to remember your password if it is not in a dictionary? This is where you get creative.

First, I like to come up with a hobby or interest such as football. Then I choose a word or phrase longer than six letters associated with that interest such as:

touchdown

Next I replace certain letters with numbers that look like letters. I am always confusing the letter O and the number zero and so that is a good starting place. You can also replace the letter E with the number 3 or the letter L with the number one. Doing this leads to:

t0uchd0wn

I also like to capitalize at least one letter in the password. This leads to:

t0uchD0wn

I also like to include at least one special character. The "at" sign or @ is always a good replacement for the letter A, but I don't have any of those in my example. We could add an underscore between "touch" and "down". My personal preference is to add an exclamation point after such an event and so my password might look like this:

t0uchD0wn!

Now if I was to go back and create a password cracking program, it would take a lot of different permutations to guess this one. That makes it a good password. Throw in that it is easy to remember and I am ready to use it.

Now comes the full disclosure. I do like football, but not enough to use "touchdown" as my password. So if you ever try to break one of my passwords, it won't be this one.

Monday, March 28, 2011

Tax Preparation Software

Last week I was able to carve out some time and complete my federal income taxes. As I work in California but live in Utah, I have to file in both states and got them done as well. That makes for a lot of paperwork.

A lot has changed since I first started doing taxes several decades ago. I used to fill them out by hand. Then a little company created a software package to help make the job easier. I continue to use Turbo Tax to this day. It is a great piece of software and I recommend it if you prepare your own taxes.

The beauty of tax software today is that it immediately files your paperwork with the appropriate agencies and dramatically reduces the time it takes to get your return. This is great for someone like me who will be getting money back from the Feds and the state of California. The sooner I get my money, the sooner I can use it to pay the money I owe to Utah. One week after filing, I received my first of two refunds. Now that is fast.

Thursday, March 24, 2011

Technical Support

I have had a busy week at the office. There was a problem with our data warehouse and it was up to me to fix it. I knew I must have changed something but couldn't figure out what I did. So I called technical support.

Not all technical support departments are created equal. When I worked in Oracle's technical support many years ago, I got a feel for just how tough that job could be. You have to know the product intimately and for a product like our data warehouse, that can be a daunting task.

Amazingly, I got a live technical support representative on the phone and he stayed on the line until the problem was solved. His first questions was the same one I had been asking myself: What changed? I couldn't think of anything I had done that would cause the problem we were having. The rep set up a WebEx session so he could see what I was describing and we then started running through one or two exercises. It didn't take me long to remember that I had added something to the database earlier in the previous week and it took 5 days for that change to manifest itself. 30 seconds later the problem was corrected and the data warehouse was fixed.

The technical support rep never solved my issue. I was the one that discovered my mistake and was glad to figure it out as quickly as I did. However It sure was nice having someone else on the other end of the phone with which to discuss my problem. I'm sure it would have taken a lot longer to figure out if I was on my own.

Thursday, March 10, 2011

Too Much Data

Yesterday I started a database report and let it run all day. When I was ready to leave work and the report was still not done, I let it run overnight. I figured if I came in this morning and the report was still running, I would try to figure out what the problem was and see if I could fix it.

I got into the office this morning and the report was still running. I had to have the report done this afternoon to send to management. I had no faith that the report would complete by the time it was due and so I started looking into other methods of creating it. On the off chance my report was going to eventually complete, I let it run.

Most modern databases are fairly smart, have efficient algorithms, and are pretty good at figuring the best way of doing things, but they are not perfect. I was able to come up with another way of getting the information and discovered an assumption I had made about the data was false. Instead of asking for a subset of the data from a single source, I was asking for all the data from multiple sources joined together in such a way that was overwhelming. Discovering this problem allowed me to finish the report and get it out on time.

This whole experience underscored the importance of not making assumptions.