Monday, February 27, 2017

Little Stories to be Told

1st Grade, Silas Wood.

42 years later, in the Hamptons.

Top: 1st grade at Silas Wood Elementary School.

Bottom: 42 years later I found myself polishing Brian Gerken’s shoes at a dinner party at Victoria’s home in the Hamptons. Brian literally gave me the shirt off his back as a “thank you.”

Photo credit: Our 6th grade teacher, Ms. Cooke, who had Brian, Vicky, and I as her students, snapped the shoe shining photo in the Hamptons.

Wednesday, February 8, 2017

Good Design is Apparent

That lip (red arrows) wrapping around the sink looks like styling, but it isn't.

Good design is apparent.
Great design is transparent. 
– Joe & Joe (Sparano & Moreno)

Styling is concerned with surface treatment and appearance – the expressive qualities of a product. Design, on the other hand, is primarily concerned with problem solving.
– "Design of the 20th Century" by Charlotte & Peter Fiell

One day, I plugged up the sink on the right with a stopper and stepped away while I left the water running to fill up the basin. I quickly forgot about it until about 20 minutes later. As I hurried back to the kitchen, I could hear the water spilling over before I could see the sink. In my mind's eye, I envisioned how much of a mess of water I'd have to clean up on the floor. Guess what? Not a drop spilled onto the counter or ground. I was floored when I saw that every drop of water had overflowed into the sink basin on the left; all thanks to the lip around the sink. For all these years, I simply thought that lip was styling; it turns out it's functional. It's a design element that solves a problem – the exact problem I created by leaving the water running until it overflowed.

Database Architecture

The most popular database is Excel. Knowledge workers use Excel spreadsheets as a simple, non-relational database more often than as an accounting worksheet. That's OK, because it works. The big boys (software engineers) use relational databases, which is like tying together each worksheet in Excel; the tying together of database tables is the relational part. And, about a decade ago, the cool kids started using NoSQL databases which operate more or less like a hash table for blazing fast performance sans the relationships.

In my computer science college classes I was taught that each row in a database requires a primary key. Just like each row on your Excel spreadsheet has a unique number: 1, 2, 3; each row in a relational database needs a way to find that row of data, quickly. In academia – in other words, in theory – I was frequently taught to use something like a person's social security number (SSN) as the primary key for a database table. But, in practice, that doesn't work nicely. In theory, there's no difference between theory and practice. In practice there is. One of the key tenets of primary keys is that they must never change unless every single reference to that primary key (relationship) is also updated which is not a trivial task

There are a few issues with using a person's SSN as a primary key. One issue is that it's a long number, much longer than a 1 – 5 digit integer typically used as a primary key, so it takes a database engine longer to compare numbers.

More importantly, what happens if a person's SSN changes? SSNs can change in domestic violence cases, identity theft, when two people are mistakenly issued the same SSN, etc. You may think, since these are such rare cases, that it's not a big deal for a database; but software systems have to be developed to handle every possible case to work effectively. So, to solve this, most databases issue a sequence of integers for each row. In the case where databases are in a cluster, each database might tag a digit on the end representing which database server issued a specific primary key. In other words, instead of 1, 2, 3; database server #4 in a cluster might issue 14, 24, 34, etc. as primary keys.

Database Best Practices

Having done a bit of database work, I've learned some best practices that are worth sharing.

1. Primary keys: Never build intelligence into a primary key – a primary key is simply an artifact of the database and it should represent nothing more than a way to access a row in a database table (i.e., don't use SSN as a primary key).

2. Table Names: Database table names should be singular (Employee, Order, Transaction, etc); they should be named for what each row in the table represents, not the entire collection. The reason is that, typically, there's a one-to-one mapping between a row in a database table and an object used in code. For example, in code, an instance variable referencing an Employee object should represent a single employee from the database while an an instance variable that's plural, such as Employees, should represent a collection of objects such as an array or dictionary.

3. Lookup Tables: A lookup table is usually a simple static database table that's used to populate a list or collection. For example, a list of countries that your company ships to. Perhaps, your company only ships to the U.S. and Canada.; later, when you start shipping to more countries, how do you update the pop-up list of countries on your website or mobile app? With a lookup table, you simply add another row to the table with the new country that you ship to. Typically, a look up table also has a column representing a sort order so it can be displayed in a specific order with, say, the U.S. listed first, instead of Afghanistan, since most of your customers come from America.

Monday, January 30, 2017

Military Misconceptions

I had two misconceptions about military retirement when I was a young buck, probably because I’m not a military retiree.

My first misconception was that my four years attending a federal Service Academy (Annapolis, West Point, Air Force Academy) would be applied to my retirement when I reached 20 years of active service. It turns out that’s not the case. However, my four years on active duty at Annapolis would apply to retirement from a civilian federal job.

My second misconception was that I could retire at 20 years. Although retiring at 20 years (or a lesser amount for medical reasons) is effectively how it works for nearly all veterans, there’s a small nuance that’s often overlooked. The military (especially the Navy and USMC) technically calls “retirement” a paid retainer for a period of time, which means that they can still call you back to active duty, involuntarily. What happens if you don’t return to active duty for the call up? Well… the federal government knows where you live since they’re sending you a “retirement” check so they can simply stop paying you.

As we used to joke at Annapolis, NAVY stands for Never Again Volunteer Yourself.

The Beauty of Binary

Boolean algebra was invented by George Boole in the mid-1800s, long before binary numbers had any practical purpose. While binary, which is base 2, is not the simplest numeral system for humans, it's ideal for computers. It's a simple way to store and transfer information. As a matter of fact, you can think of DNA as binary since it only has two combinations (CG or AT) that store all the genetic information of our makeup.

(The simplest and oldest numeral system for humans is unary, which is base 1. Think: tallying numbers with four ones, 1111, while the fifth tally is a diagonal line striking through the four tallies to make one group of five. Actually, traditional tallying seems more like a cross between base 1 and base 5, but I digress.)

There is an elegant simplicity in binary in that each digit is either a one or a zero. On or off. No room for any gray area, even though fractions and negative numbers can still be represented in binary. Additionally, some numbers that can't truly be expressed in one base, for example, 1/3 in base 10, can be simply written in, say, base 3 as 0.13.

Since computers use binary, some integers operations are child's play to a computer, especially bit shifting. As humans, we can't easily figure out multiplication of large numbers in our head. For example, what is 123 x 45? That will require a pencil and paper or calculator. But, we can easily figure out the answer to 12345 x 100, even though the latter deals with much larger numbers because we simply shift the digits three places. But, for humans, this calculation only works for multiples of 10, since we think in base 10. Computers, however, get this luxury when they're multiplying by integers that are a multiple of the base. Multiplying a base 2 number by 2, 4, 8 is as simple as shifting the bits by one, two, three, or four places. For a computer, like a human, this is a much simpler task than working through the traditional arithmetic.

Monday, January 23, 2017

Simple Influences

Simplicity is the ultimate sophistication.
– Leonardo da Vinci

The Marines and Apple have been the biggest influences in my professional life... my way of thinking... my work philosophy.

At the end of the day, they both respect and seek simplicity. Simplicity of design in products. Simplicity of design in tactics. While both organizations are well respected leaders in their fields, they go about solving problems in different ways. One's procedural and the other's artistic. One creates and the other destroys.

But, there's nothing wrong with creating good and destroying bad.

Monday, January 16, 2017

Mental Health in America

How does someone end up on the streets? There are many different reasons such as abuse, drugs, loss of a job, and mental health issues. Over the past few months, I've watched the mental health of a  friend and former coworker from Apple, decline until he ended up living in his office, car, and then ended up on the streets. Help and love from family, friends, his church, and coworkers did no good since he wouldn't accept any aid.

Last time this happened to him, he ended up being arrested and committed. Unfortunately, until someone exhibits some harmful behavior – what authorities refer to as "fitting the profile" – there's not much that can be done by others. Sure, we tried talking to him, in good faith, but when one's brain can't accept reality, logic does no good. From his point of view, the entire world doesn't understand his genius and he things we're all squelching his creativity.

Today, a few of us, including his wife and mother, had to pack up his office, which he had been squatting at, for a couple of months, until his sympathetic landlord had no other choice. We wondered what street he was living on as we boxed up his computers, routers, books, marketing collateral, and training materials.

But, that's life in America. We're free until we harm.

Tuesday, November 22, 2016

Understanding Trump

Since the election, I've been trying to better understand President-Elect Donald Trump. What I heard as his promises on the campaign trail didn't make sense. It has taken me a little while to realize that much of his forward looking rhetoric seemed to actually be his opening bid in a negotiation rather than campaign promises. You're selling your home for $800,000; I show up and offer $750,000; that's not the end of the deal, only the beginning.

When Trump said, "Build a wall," he was actually pitching an idea. From his point of view, why not throw out ideas and see what sticks? At the end of the day, he got the results he wanted. He accomplished what no other candidate could; he was elected POTUS. People may be protesting the election, but no one is contesting it like the 2000 election. To bring up the point that Trump didn't win the popular vote is like rationalizing today's loss of your favorite baseball team in a close game, say 2 – 1, by arguing that your team won yesterday's game 10 – 1. You can't carry over yesterday's extra eight runs to today.

It's been said that the first person with a crazy idea isn't as crazy as the first follower of that idea.

Build a Wall

Something I couldn't understand, when Trump said he was going to build a wall, was why other people from Mexico and Central America would support him. How could they support that? Yesterday, I got an answer to my question from someone who employs an undocumented worker. It turns out that undocumented workers aren't seeking solidarity with other undocumented workers by supporting Trump. Rather, they're seeking to stop the influx of undocumented workers into the U.S. to limit their competition. Something I didn't understand before today now makes complete sense. This is a small epiphany, but I will continue to try to understand how people think while seeking objective truth.

Failing to understand your friends and enemies is failing to understand people.

Monday, November 21, 2016

Weak Stadium Security at NFL & College Venues

Only clear bags allowed.
Last night, I went to a basketball game at UCLA. Women were prevented from entering the arena with any opaque bag larger than a clutch. Women who showed up at security with a purse were sent outside the arena to leave their purse at check-in. Ladies had the option of transferring the contents of their bags into a clear plastic bag if they wanted to. It turns out this policy mimics the NFL's; the NFL says it has "unanimously" implemented the same poor security practices at their stadiums.

Here's the problem... the security metal detectors can't detect leather. The clear plastic bag policy is trying to mimic TSA security policies in form over substance. Why can't a woman bring an opaque bag into an arena? I don't know.

How can you defeat this security measure? Simply empty the contents of your purse into a clear plastic bag and then hide your empty leather purse anywhere on your body such as in the small of your back. After entering the venue, simply transfer the contents from the clear plastic bag back into your leather purse. This suggestion is a much safer option for women than leaving their purses with some college kid to guard. (Would it be far-fetched for a creepy college kid to go through your purse during a game?)

Security Theatre

What the NFL is accomplishing with this policy is known as security theater. Most people recognize that security is usually a trade off with convenience (although it doesn't necessarily have to be) so, if a policy is implemented at an institutional level that is highly inconvenient then it must be safer, goes the thinking. In other words, it's inconvenient security theater without making the venue safer – if anything, it puts added risk on their fans due to the hassle of standing in line in the rain (which is what happened last night) plus transferring stuff between bags, in the dark, while having a college kid watch your bag, etc.

Let's keep America scared. I think you see my point.

Wednesday, November 16, 2016

Protesting vs. Complaining

If every single one of your thoughts, posts, and comments are anti, anti-Clinton or anti-Trump, then you are not helping. You’re not even protesting. You’re complaining. You don’t like your lot in life, so you want to bring others down to your level by “informing” them through your biased view points.

You protest a cause to prevent or change it. You protest the war to end the war. You protest higher taxes to lower them. You protest evolution to promulgate the idea that Adam was made from dust and Eve was made from a rib; you do this to get your Creationist beliefs institutionalized.

For protesting to have an effect, it has to be organized as a group; it has to send a clear message that’s actionable. Venting really doesn’t help because it’s not as if you’ve discharged those negative feelings, you’ve simply amplified them.

I swore my life to protest your First Amendment. Never a regret there. But now it's my turn to exercise my freedom of speech; except I'm doing it in a positive way. Find a way to make it work or be miserable – that's your choice.

I'm not saying don't protest or demonstrate. By all means do that if you can make a difference.