28 July 2011

Quote of the day: "Happiness is your own responsibility"

Jennifer Garner, who played Sydney Bristow on the TV show Alias, is an amazing actress and (from what I've read) sounds like an equally amazing person -- classy, professional, wise, and grounded. She has been quoted in many places on the internet (I couldn't find a reputable source, but I assume she really said it), saying that her mom always told her:
Happiness is your own responsibility.
A good thing to remember.

27 July 2011

Link of the day: Schedule time to worry

Exactly what the title says. An interesting idea is to schedule time to worry (originally mentioned on MSNBC). Scheduling a specific time to worry may actually reduce stress and anxiety. I've personally postponed strong feelings, but I know that only comes back to haunt me because I'll just experience it later at some inconvenient time. I should try scheduling worry time.

26 July 2011

A River Runs Through It

I recently read Norman Maclean's novella A River Runs Through It. The story is famous for its detailed and beautiful descriptions of fly fishing. Yet, the fly fishing in itself is not the main message. I think the story is about how difficult it is to understand and help people, even your own family. The fly fishing is a metaphor for this theme.

Norman is the narrator. His brother Paul gambles and gets into fights, but happens to be an outstanding fisherman -- way better than Norman. The two brothers were taught fishing by their minister father. Paul is not the only young man in constant trouble. Norman's brother-in-law Neal drinks and whores. Norman and his father don't know how to help Paul. Norman's wife's family don't know how to help Neal.

Norman and his father worry about Paul's troubled nature.

"You are too young to help anybody and I am too old," he said. "By help I don't mean a courtesy like serving chokecherry jelly or giving money.

"Help," he said, "is giving part of yourself to somebody who comes to accept it willingly and needs it badly.

"So it is," he said, using an old homiletic transition, "that we can seldom help anybody. Either we don't know what part to give or maybe we don't like to give any part of ourselves. Then, more often than not, the part that is needed is not wanted. And even more often, we do not have the part that is needed. It is like the auto-supply shop over town where they always say, ' Sorry, we are just out of that part' "

I told him, "You make it too tough. Help doesn't have to be anything that big."

He asked me, "Do you think your mother helps him by buttering his rolls?"

"She might," I told him. "In fact, yes, I think she does."

"Do you think you help him?" he asked me.

"I try to, " I said. "My trouble is I don't know him. In fact, one of my troubles is that I don't even know whether he needs help. I don't know, that's my trouble."

"That should have been my text," my father said. "We are willing to help, Lord, but what if anything is needed?"

"I still know how to fish," he concluded. "Tomorrow we will go fishing with him."

Part of the problem, Norman says, is that he doesn't understand his brother. His father agrees, but points out that they have fishing as a common bond. They have some level of understanding when they all fish together.

It turns out that is the last time they go fishing with their brother. Shortly thereafter, Paul gets into a fight and is killed. The father is heartbroken and struggles to find meaning in Paul's death.

For some time, though, he struggled for more to hold on to. "Are you sure you have told me everything you know about his death?" he asked. I said, "Everything." "It's not much, is it?" "No, I replied, "but you can love completely without complete understanding." "That I have known and preached," my father said.

Sometimes, it's just not possible to understand someone, to reach them. Norman explains that his brother was a great fisherman because he partly understood where the fish would go and how the fish would behave. After landing a fine catch, Paul says, "I'm pretty good with a rod, but I need three more years before I can think like a fish." Paul has a talent for fishing that neither his brother or father can match [1].

For a person to truly understand another -- that feat is as difficult as a fisherman trying to think like a fish.

[1] It's ironic that Norman and his father feel unable to connect with Paul, and yet Paul is an amazing fly fisherman who can "connect" with fish.

20 July 2011

Song of the day: "Since I Fell For You" by Buddy Johnson

I learned of this song from the episode "Rendezvous" in the TV show Alias. A beautiful, slow jazzy tune.

When you just give love
And never get love
You'd better let love depart
I know it's so, and yet I know
I can't get you out of my heart

You made me leave my happy home
You took my love and now you're gone
Since I fell for you

Love brings such misery and pain
I guess I'll never be the same
Since I fell for you

Well, it's too bad
And it's too sad
But I'm in love with you
You love me, then you snub me
But what can I do?
I'm so in love with you

I guess I'll never see the light
I get the blues most every night
Since I fell for you
Since I fell for you...

12 July 2011

Link of the day: Rainbow Mansion

I've often thought that it would be a neat idea to live in large house with other people. You would give up a little privacy for the benefit of living in a community. One well-known group living situation is the "Rainbow Mansion." The Rainbow is located in Silicon Valley and its residents are ambitious (mostly technology) people who "want to change the world." This might be a bit extreme for me, but it's an interesting idea. I enjoyed living in a co-op in college and I like the idea of group living.

05 July 2011

Code complexity

An oft-uttered mantra in programming is to write "good" code that is well-organized and understandable. One obvious question is how do you know if you have "bad" code that is too complicated and unintelligible?

People have researched this question and have come up with "complexity metrics" to quantify how complicated a piece of code is. A well-known metric is the McCabe complexity metric or "cyclomatic complexity." It roughly counts how many different paths you can take to get from the beginning to the end of the code. The more branching statements and loops in the code, the more complicated it is. A rule of thumb is that a module should have a cyclomatic complexity of no more than ten (CC < 10). If the cyclomatic complexity is larger, you should refactor the code. This is really cool. It's great to have a non-human, automated method to test the complexity of code. I'll have to try running some complexity metric tools on the next programs I write. For further reading, check out Reg. Charney's article on code complexity metrics in Linux Journal or this IBM development article on cyclomatic complexity.

04 July 2011

Stack Overflow and question-and-answer websites

I found that I learn a lot by reading forums. I learned about hockey equipment at ModSquadHockey and about musical theater at Musicals dot Net. This is a great way to learn about relatively obscure topics. Unfortunately, this method is also very time consuming because forums are almost completely unorganized. Even if you search for keywords, you have to filter through a lot of noise.

Wikis are much more structured and easier to read. Unfortunately, they require a lot of work because the contributors need to write decent articles and there are the issues of who can edit the wiki and multiple authors of the same article. These difficulties are the reasons you see a lot of incomplete wikis on the web.

A nice compromise between forums and wikis are question-and-answer websites like Quora and Stack Exchange. Instead of having threads like on forums, question-and-answer websites organize by question. For each question, other users post answers. This seems pretty much the same as forums so far. The key difference between forums and question-and-answer sites is that the users can dynamically tag questions and vote on how much they like a particular question or answer. The users do the filtering and that makes the website so much easier and enjoyable to read.

Quora is a very general Q&A site, with the philosophy that you have to stand by your answers. You're supposed to use your real name when you answer and you are asked to give qualifications as to why you are an "expert" in the topic. The site is closed to the public. You have to register and login. I think the reason is it is semi-private is to prevent Quora from becoming like Yahoo Answers which attracts a lot of random, "bad" answers. Stack Exchange is a group of Q&A websites on mostly technical topics. You don't have to login to see the answers, which is why I think Stack Exchange is more popular. I see Stack Exchange websites show up in Google searches whereas I never see anything from Quora. The most famous Stack Exchange site is Stack Overflow, which is focused on non-expert programming (though "expert" is subjective). I have fun reading through the top voted Stack Overflow questions for particular topics like Python and Mathematica. So far I like Stack Overflow better than Quora. Jon Evans wrote a comparison of the two sites in TechCrunch.