Monday, July 23, 2012

The Perfect Woman

Yesterday my wife asked me to envision the perfect woman and then make a list of her virtues. She pleaded with me to have an open mind and not let it become a list of virtues she has or a list of virtues I wished she had. Here is what I came up with; order has no significance.
  • Loving, capable of being a mother to anybody, but not pron to spoiling
  • Faithful, spiritual, prayerful
  • Graceful
  • Intelligent in conversation, but not determined to win arguments
  • Humorous, but not raucous
  • Musical
  • Humble, but not shy or awkward
  • Confident, but not prideful
  • Capable of leading, but never desiring to [1]
  • Understanding of human emotions
  • Socially proper
  • Organized but no OCD
  • Capable of cooking every day without the family tiring of her food [2]
  • Frugal
  • Long hair [3]
"A virtuous woman is a crown to her husband" - Proverbs 12:4

[1] The wife in Legacy is the best example I can think of. She's able to take charge when she needs to.
[2] This doesn't mean she has to cook every day, just that she could if needed to.
[3] I added this after my wife pointed out that I didn't have any physical attributes in the list. I didn't think I needed any, but then I realized I always envision good women as having long hair.

Friday, July 13, 2012

My Mysterious Double Cron

One of the websites I manage at work has a cron associated with it that ran every Monday morning at 1:00 AM to process outstanding invoices.
0 1 * * 1 php cron_script.php >> cron_script.log 2>@1
The script worked beautifully until June 18 when everyone who was charged was billed twice. I first thought my script must have a bug, but further inspection proved that wasn't the case[1].

The output log only had one entry for June 18, so I was inclined to blame it on network errors[2].

But most signs showed that the cron had run twice, at almost the exact same time. I was reluctant to accept this because cron is a stable library, but the evidence was overwhelming. The order of the double-charge pairs was perfectly sequential.
11223344
If both executions weren't at almost the exact same moment you would see something more mixed.
12132434
We could see that from the responses we get back from our credit card processing company and store in the database, information stored in the eCommerce software to show customers when they were charged, and history that our credit card processing company keeps.

So the cron ran twice but logged its activity once. After much debate, the only plausible solution we could divine was that the NTP update script also ran at 1:00 AM and caused the clock to drift backwards a few hundred milliseconds and repeat 1:00 AM. We could explain the log file having on entry by assuming the first execution obtained an exclusive lock on the file.

But then I did some research and found out that NTP almost never drifts the clock backwards (especially not for such small intervals as we were expecting) and redirecting output in the shell to a file does not lock the file.

Our theory was sufficiently busted, and now we have no possible explanations for both anomalies:
  • How did the cron run twice at the same time?
  • Why did the output only get written to the log file once?
Surely it must have been cosmic rays.

[1] Technically my script did have a bug in that it allowed people to be billed twice if the script ran twice at the same moment. That has since been fixed by applying an exclusive lock to the logfile. But I realize now that the fix is insufficient. I have a better idea.

[2] We have had other problems related to network errors between us and our credit card processing company. My inclination to blame the network wasn't random.

Wednesday, April 11, 2012

The Innovator's Framework

The most shocking conclusion of Clayton M. Christensen's The Innovator's Dilemma is that good managerial practices can lead a company to failure when dealing with disruptive technologies. Good managers lead companies by pursuing high profit margins and delivering what their customers want. But Christensen proves that those methods only work for sustaining technological development and not for developing disruptive technology. That is revolutionary. Christensen clearly explains how to avoid the same failures that Sears, Woolco, and many other companies have experienced.

Christensen also offered an eye-opening explanation of the migration of capabilities within a company. It explains why resources are more important to a startup while process, values, and culture are more important to a mature company. I thought about my experience at a startup where I work. When I joined two years ago, there was no process -- for anything. The three programmers sat in a room next to each other and just coded. Now we have bug lists, version control, and development environments. Our values are also starting to coalesce into a company culture. I enjoyed being influential in the development of that culture. But it will be time for me to get a new job when this period of development ends and employees become just another programmer.


Friday, December 9, 2011

Gratitude

The youth activity following the First Presidency's message in the Ensign this month suggests making a list of 100 things that you are grateful. It even helps by suggesting 10 categories that you can list 10 things in. Here is my list.

The item are not listed by priority. Absence in the list does not denote ingratitude (there's only room for 100 things).

10 physical abilities you are grateful for
  • Clear mind and intellect
  • Hearing
  • Eating
  • Speaking
  • Seeing
  • Smelling
  • Walking and running
  • Eating
  • Laughing
  • Singing
10 material possessions your are grateful for
  • Apartment (not technically mine though)
  • Clothes
  • Food
  • Computer and printer
  • Books
  • Money
  • Car
  • Journals
  • Wedding ring
  • Tupperware
10 living people you are grateful for
  • Wife
  • Daughter Christine
  • Dad
  • Mom
  • Brother
  • Older sister
  • Younger sister
  • Mother in-law
  • Father in-law
  • Grandma York
10 deceased people you are grateful for
  • Grandpa Clark
  • Grandma Clark
  • Grandpa York
  • George Washington
  • John Adams
  • Joseph Smith
  • Abraham Lincoln
  • Ezra T Clark
  • Edward Moroni Thurman
  • Gordon B Hinckley
10 things about nature you are grateful for
  • Sunshine
  • Snow
  • Mountains
  • Trees that provide shade and clean air
  • Fall foliage
  • Rivers
  • Waterfalls
  • Four seasons
  • Green grass
  • Colorful flowers
10 things about today you are grateful for
  • Snow
  • Fasting
  • Church
  • First Presidency Devotional
  • Family
  • Food
  • Testimonies in church
  • Reading the Ensign
  • Home Teaching
  • Naps
10 places on earth you are grateful for
  • Home in Sterling
  • Provo Temple
  • BYU
  • Chile
  • Wife's home
  • St Louis Temple
  • Apt N201 in Campus Plaza
  • Washington, DC
  • LDS chapel in Sterling
  • Our current apartment
10 modern inventions you are grateful for
  • Plumbing and running water
  • Electricity
  • Cars
  • Cell phones
  • Microwave
  • Dishwasher
  • Washing machine
  • Electric razor
  • Planes
  • Trains
10 foods you are grateful for
  • Water
  • Milk
  • Bread
  • Cheese
  • Macaroni and Cheese
  • Citrus fruit
  • Meat
  • Pineapple
  • Ice cream
  • Lo mein noodles
10 things about the gospel you are grateful for
  • Christ's Atonement
  • Eternal Families
  • Priesthood
  • Blessings of the temple
  • Book of Mormon
  • Character building
  • Leadership
  • Friendship
  • Scriptures
  • Mission

It Still Isn't Easy


The following is a short essay I had to write for a class.

Its common for people to say that the level of entry into the field of software development has never been lower. Development tools have never been cheaper and easier to use, there is an infinite supply of programming tutorials on the internet, and the growth of the development market is rapidly outpacing the supply of software developers.

When we say that the level of entry has never been lower, it sounds like we're saying its easy to get started. But it we are strongly something much more than that. We are implying that the possibility of an average person becoming successful in the industry is approaching the possibility of success for a person who has been formally trained and educated; we are saying the Ubuntu, Eclipse, W3Schools, and StackOverflow are a worthy replacement for a bachelors degree in Computer Science. That is just as ludicrous as proposing that you could train to be a surgeon by watching YouTube videos and practicing on rats.

I don't mean to say that a getting a degree in Computer Science is a requirement to be a good software engineer. It is possible for a programmer without a degree to be better than a programmer with a degree. There are plenty of terrible programmers who earned a BS degree. But there aren't as many stellar programmers that don't have CS degrees. Why? Because software development isn't easy!

I recently attended a university job fair where multiple companies told me that they will no longer hire Electrical Engineers for software development positions because they just can't manage the advanced programming techniques and theories. But those can be learned with experience, right? Not easily. I know a guy who has been freelancing for 20 years but can't code a recursive binary tree traversal.

Large tech companies understand the difficulties of software development. Google is much more willing to hire someone with a masters degree than with a bachelors degree, even though they have to pay him more. The assumption is that he has received more education concerning advanced topics and is therefore closer to being an expert programmer; and they're usually right.

The trend of outsourcing programming to India is also ending because people are realizing that talent does not come cheap, but coding monkeys do.

A contributor to Forbes recently wrote an article titled “The Rise of Developeronomics” which states that demand for good developers is quickly outpacing supply which is causing the rise of what he calls developeronomics. Companies are acquiring other companies purely for talent (not necessarily for products or technology) and investors are keeping talented developers busy on fluff projects just to keep them around. If the level of entry were low and the promise of success were high, then the supply of good developers would not be a problem.

But the shortage of talented software developers is a problem because the level of entry isn't low. It will remain that way until there is a fundamental change in the field; new tools, resources, and languages cannot make this happen.

Thursday, October 7, 2010

My Land Full of Idols

A short time ago, my wife and I were reading together in 2 Nephi. In chapter 12, Jacob is quoting a prophesy of Isaiah about our days. Verse 8 reads, “Their land is also full of idols; they worship the work of their own hands, that which their own fingers have made.” As I read that, my heart dropped. He was talking about me.

Immediately I remembered how proud I have felt about accomplishments at work; I remembered how I feel more talented than others in my CS classes because of what I do; I remembered how it makes me feel like I’m somebody that’s worth something.

Even Hobbes understands how ridiculous this is:

Of the passions that most frequently are the causes of crime [or sin], one, is vain glory, or a foolish overrating of their own worth; as if difference of worth, were an effect of their wit, or riches, or blood, or some other natural quality... (Hobbes, Leviathan: Pt. 2, Ch 27)

He’s right. I was foolishly overrating my own worth.

As my wife and I continued reading, I learned of my plight:

“For the day of the Lord of Hosts soon cometh upon all nations, yea, upon every one; yea, upon the proud and lofty, and upon every one who is lifted up, and he shall be brought low.”

That prophesy was quickly fulfilled in my own life. First, weaknesses in my talents were exposed. For a week I had been trying to fix a bug in a program I was writing for one of my classes. Finally the due date came and I still hadn’t figured it out. So much for programming talent.

Then General Conference began and Elder Uchtdorf threw me down even lower as he spoke of the evils and dangers of pride.

Pride is sinful... because it breeds hatred or hostility and places in opposition to God and our fellow men. At its core, pride is the sin of comparison. For though it usually begins with ‘Look at how wonderful I am and what great things I have done’ it always seems to end with ‘therefore I am better than you.’ When our hearts are filled with pride we commit a great sin, for we violate the two great commandments. Instead of worshipping God and loving our neighbor, we reveal the real object of our worship and love: the image we see in the mirror.

I stood chastised, repentant, and humbled. My vision was corrected. I remembered how I had previously thought: I was grateful for talents and work that allowed me to provide for my family and focus on things which mattered more. Hopefully I can maintain that perspective for a prolonged period of time.

Sunday, September 5, 2010

Why I Believe in God

Last summer I volunteered at a special daycare center for children from troubled families. In the back they had a playground and sandbox that the children loved to play in. One day while in the sandbox with the kids, a little girl walked up (so young that she couldn’t talk yet) who seemed very hesitant to play in the sand. She stopped right at the edge of the sand and look around with trepidation. I soon realized she probably had no idea what sand was and must not have been the adventurous type. I picked up some sand and showed it to her. She hesitated, then touched it a little. After prodding at it for a few moments, I slowly poured it in front of her and grabbed some more. Her fear began to dissipate. Soon she walked slowly into the sand and began to pick up handfuls of it for herself.

I was once like that little girl. I didn’t know who I was or what the purpose of life was. It brought fear, trepidation, and sorrow into my life. Once when I was around the age of 11, while riding my bike home from a neighbor’s house, I began to cry because I wasn’t happy. I didn’t know what life was about and so I most certainly wasn’t doing anything to fulfill its purpose. Sometime thereafter I began to search for answers, for something that seemed to fulfill and teach of my purpose. I looked in many places. Prestige among friends didn’t work; video games, movies, and music didn’t work; neither did K’NEX, Legos, the great outdoors or rebellion against my parents. At last I was left with the most obvious choice, one that had been staring me in face my entire life: God.

One day I realized that there were two boys at church, who a year or two older than me, that appeared to have what I was searching for. I also noticed that they were the most faithful in following the teachings of Christ. Perhaps, then, I should do the same. At the pivotal moment in my life I also had the most excellent Sunday School teacher (who was also the father of one of the previously mentioned boys). For the first time I felt anxious to be taught. What I remember most is how frequently he exhorted us to read the scriptures and pray consistently, and that he always testified of how much it blessed his life. Eventually I decided to try it.

I wish I could remember the day that I first began, but in the end its rather insignificant. What matters is that it was the most important decision I made in my youth. I began to read the scriptures and pray every morning and then pray again at night. After realizing how much of a difference it made, I also began to read at night. Once in 8th grade I went on a day trip with my father to some convention. We got back in the early hours of the morning on the next day. We were both dead tired, but I still picked up my scriptures and read a chapter before I went to bed. My desire for truth and guidance from God was more important to me than sleep. I was only 13 then.

I didn’t do it because my parents told me to or because I was just following everyone else (for 95% of the time I spent outside of my home, there wasn’t a single Mormon present). I did it because something deep inside yearned for truth and couldn’t be satisfied with anything else. There was something beyond what the world would have me believe. I felt it when I knelt down and prayed to God, when I peacefully studied the scriptures in the seclusion of my own room, when I listened attentively to things I was taught at church, and when I obeyed the commandments of God. It was as though God were picking up handfuls of sand and teaching me.

“This is who you are...”
“This is who I am...”
“This is your purpose...”
“This is what you should do...”

There have been times since then that I consciously choose to take a path against the counsel of God. I have regretted it every time. He is the only one whose answers have never failed me.

I am reminded of the hymn “When Faith Endures.”

I will not doubt, I will not fear;
God’s love and strength are always near.
His promised gift helps me to find
An inner strength and peace of mind.
I give the Father willingly
My trust, my prayers, humility.
His Spirit guides; his love assures
That fear departs when faith endures.

Today, my prayers are still answered, my wisdom continues to increase, my happiness is at greater levels than it has ever been in my life, and I am convinced more each day of God’s existence.

I know God lives.