Duff O'Melia

Expectations and Mental State

I’ve been wondering about how much of our mental state is based solely on our expectations.

Consider this. The day begins and I plan on accomplishing 10 specific tasks. By the end of the day I’ve only achieved 6 of them. I can feel discouraged. I can feel like a failure. I can feel as if I just wasn’t very productive.

Now change the scenario just a bit. The same day begins and I plan on accomplishing 4 specific tasks rather than the 10 I was predicting before. I work just as hard and I’m just as productive so I get to the end of the day and I’ve accomplished those same 6 tasks. I feel great! I’m an efficient machine. I accomplished 2 more tasks than I thought I would. Can anything stop me?

The only difference between the two scenarios was my prediction for how much I thought I’d accomplish. I worked just as hard and just as efficiently but my mental state at the end of each scenario was markedly different.

It’s interesting to me that we know that we’re not clairvoyant yet our mental state can be affected by our ability to predict the future.

Viewing a Page in a Browser

I’ve been doing a bunch of integration testing of a rails site lately. I have found it quite useful to be able to quickly view the current page in a browser.

I added the following method to my integration testing DSL:

1
2
3
4
5
6
7
8
9
module IntegrationDsl

  def view
    filename = File.dirname(__FILE__) + "/integration/.integration_test_output_for_browser.html"
    File.open(filename, "w+") { | file | file.write(response.body) }
    `open #{filename}`
  end

end

It simply writes out the response body to a file and then opens it (using the `open` on a mac).

So now in my integration test, I can view the current page in a browser like this:

1
2
3
4
def test_feature
  s = new_session_as :duff
  s.view
end

TDD - Rails Integration Style

I’ve been writing unit tests for many years. I can’t live without them. Writing code from a test-driven perspective became second nature for me a long time ago.

I’ve played with Rails integration tests on a few different projects now and each time I did, I found that there was a slight learning curve for using them. I also found that the tests were often larger than the code I was actually testing. The tests seemed brittle and they seemed to take such a long time to write.

Recently I decided that I just needed to keep writing them for awhile to see if I could get good enough at them such that they were no longer a burden to write. A conversation with Robert certainly played a part in this decision. Since I was working on a personal project this past week, it was a perfect opportunity.

What I’ve found is this. Rails integration tests are amazing. They were taking such a long time to write because I was new at it. They were brittle because I didn’t know what I was doing. The tests were long because I was testing things more than once and I wasn’t refactoring to a Domain Specific Language (DSL) like Jamis wrote about.

The result is that my integration tests are now slim. They’re cinchy to write and they’re getting easier as the DSL for the project improves. I’ve gotten good enough at it that I can now write the integration test before implementing the feature. They’re not taking very long to write at all. It feels amazing knowing that the regression tests are accumulating and it’s becoming harder and harder to break the site I’m working on.

I realize now that the unit testing I did when starting out wasn’t test-driven at all. I wrote unit tests after I wrote the code I was testing. After developing some competence, I was able to switch over to test-driven unit tests. A similar process has now happened with integration tests.

The 2 or 3 days it took to get up to speed was quite worth it.

Clicking a Link

There have been times when integration testing a rails site that I’ve wanted to click a link on a page without caring about it’s route or url.

So let’s say the following exists on a page in my app:

1
2
3
4
5
<html>
  <a href="http://meresheep.com/users/4;resend_activation_email">
      resend your activation email
  </a>
</html>

In my integration test, I can now do things like this:

1
2
3
4
5
def test_non_activated_user
  s = new_session_as :duff
  s.click_link("resend your activation email")
  s.assert_template("invitation_sent")
end

To get this functionality, I added the following method to my integration testing DSL:

1
2
3
4
5
6
7
8
9
module IntegrationDsl

  def click_link(link_text)
    assert_select("a", link_text, "Trying to click a link named '#{link_text}' that did not exist") do | links |
      get_via_redirect links.first.attributes['href']
    end
  end

end

The test fails if the link doesn’t exist on the current page.

Zippy Soapadoo

I was recently able to give Soapadoo a nice little performance makeover. The site is now considerably faster than it’s ever been. It’s quite evident clicking around the site that the performance improvements are significant. For the curious geeks out there, here are some of the things I did:

THIS Is the Day. Not Tomorrow.

I just read the following about joy from The Life You’ve Always Wanted by John Ortberg:

We all live with the illusion that joy will come someday when conditions change. We go to school and think we will be happy when we graduate. We are single and are convinced we will be happy when we get married. We get married and decide we will be happy someday when we have children. We have children and decide we will be happy when they grow up and leave the nest – then they do, and we think we were happier when they were still at home.

And this:

When we celebrate, we exercise our ability to see and feel goodness in the simplest gifts of God. We are able to take delight today in something we wouldn’t have even noticed yesterday. Our capacity for joy increases.

Some take home lessons for me:

  • Yes, I need to place some emphasis on setting goals for the future and working today to help achieve objectives tomorrow. Not as much emphasis as I’ve been placing, though. I shouldn’t be so focused on tomorrow that I’m missing the wonder of today.
  • I need to start taking much more notice of the incredible things that happen on a daily basis right in front of me.
  • Joy in life and achieving goals aren’t tied together. One is not dependent on the other.

This is the day which the LORD has made; Let us rejoice and be glad in it.
- Psalm 118:24

To Quit or Persevere

It takes real guts to abandon a strategy, especially if you’ve gotten super good at the tactics. That’s precisely the reason that switching strategies is often such a good idea. Because your competition is afraid to.

I agree with him. Abandoning a strategy is often a good idea.

His post brought to mind a few questions I’ve thought about in the past along similar lines. When do you quit? How do you know if your current strategy really should be abandoned, or if you’re just quitting before your strategy had enough time to succeed?

We’re often given seemingly conflicting advice in life:

  • “Never ever ever quit.”
  • “Embrace change and be willing to change strategies because the path that you’re on might not be feasible.”
  • “It’s not possible to fail if you don’t give up.”

I’m not really sure how to generically know if it’s time to change strategies. I am, however, capable of coming to a conclusion for a specific business instance. Soapadoo.

Is the whole strategy of Soapadoo flawed? Should I stop spending time on it and instead devote time to another business? Soapadoo clearly isn’t viral yet and it hasn’t become the dominant reviews website on the internet. It’s generated revenue but it’s not yet profitable. Should it be scrapped?

My answer is no. Certainly not. Here are some reasons why:

  • Soapadoo hasn’t been around very long.
  • Most businesses take time to develop and succeed. Sam Walton said that Wal-Mart, like most overnight successes, was 10 years in the making.
  • It often takes time for a business to adapt and change to the marketplace. This refinement can often cause a business to become remarkable/viral. Ward Cunningham has spoken about “waiting for insight”. Insight often takes time.
  • I haven’t found another website yet that’s completely focused on reviews and keeping things simple without bloat.
  • I haven’t found another website yet that allowed bloggers and other reviewers to aggregate a subset of their posts onto a review site that’s highly Googleable.
  • I haven’t found another review site yet where reviewers could benefit financially.
  • I haven’t found another website that effectively combined the idea of a social network with reviews.
  • As a consumer of the site, I find it personally useful to read reviews written by friends and others I respect. I’ve also found it useful to be able to email a link to a Soapadoo review to those looking for recommendations.
  • This business has a really low capital burn rate.
  • If Soapadoo isn’t profitable a year from now, I’ll certainly consider spending less time on it in favor spending time on more profitable ventures.

Interviewed on CenterNetworks

Allen from CenterNetworks recently interviewed me about Soapadoo and a number of other topics. I think Allen’s a pretty talented interviewer so you might want to check it out.

If you haven’t seen CenterNetworks yet, it’s a pretty useful source of information for people in the tech world. It’s also a great place to learn some lessons from tech entrepreneurs.

Here is the interview. You can listen to it on the bottom of that page. I’m hopeful that it’ll provide some value to folks.

Dream Small Dreams Every Day

There has been much written in the area of setting goals for one’s life. It seems that most successful folks attribute some of their success to the fact that they had very clear, very big, and very specific written-down goals.

Most people think way too small. If they’ve even established some goals, those goals are often much smaller than they should be. People seem to underestimate their potential and this can often contribute to a lack of fulfillment in one’s life. To combat this tendency, many authors would say that your goals should be ginormous. They should be so huge that you have no idea how you’re going to accomplish them. Dream really big dreams and you’ll achieve much more than you thought possible.

This all makes sense if you’re talking about long term goals – 30 year goals, 10 year goals, 3 year goals, and 1 year goals. For these kinds of time frames, I think that having incredibly huge dreams about your future helps you. I can see very little downside to having goals that are seemingly beyond your reach – when you’re creating your long-term goals.

I’ve run into some trouble when trying to apply these principles to daily goals. There’s a major downside to setting goals that are too big when you’re working with a daily time frame. That downside is discouragement.

I’ve had many days when I’ve felt disappointed at the end of the day. Some days I’ve felt unproductive. Other days I’ve felt like I just didn’t get nearly enough done as I should have. It’s pretty easy to feel like a failure if your daily goals are too big. Disappointment comes from unmet expectations. The failure I was feeling was not because I didn’t accomplish enough that day. It was because I didn’t accomplish as much as I thought I would at the start of the day. If my expectations for the day are unrealistic, it’s a recipe for continual discouragement. Discrouragement can then lead to other problems because it’s tough to be optimistic when you’re disappointed.

I’m not arguing that you should low-ball your daily goals. I’m not saying you should turn into a daily sloth and only set a few easy goals each day so you can feel accomplished and stay positive. This wouldn’t be living up to your potential.

Instead, I’d argue that a daily goal list should be broken down into 2 sections:

  • The first section is the must-have list. This is the list of things that you need to do every single day no matter what. These things ought to be done regardless of what happens that day. If you’re in a coma, then you don’t need to accomplish the must-haves. No other excuse holds any water. It’s the section of your daily goals that you’re not willing to compromise on. If the things on this section aren’t done by the end of the day, you don’t go to sleep until they are.
  • The second section is the nice-to-have list. Every other goal you have for the day is in this list. It’s ok to think bigger here because everything in this list is gravy. It’s nice if you get them done but it’s certainly not the end of the world if you don’t accomplish every nice-to-have goal for the day.

This type of approach builds up your confidence and leads to more discipline in your life because you form the daily habit of always doing what you say you’re going to do that day. It also encourages you to stretch a bit with the nice-to-haves.

Soapadoo Reviewers Share Profits

I recently decided that the profit that the Soapadoo website generates should be shared with reviewers. 50-50.

The reviews on Soapadoo are assets. They were created by reviewers who were willing to take the time and energy necessary to create worthwhile reviews others can benefit from.

The Soapadoo website generates revenue primarily through relevant advertising. This money is now shared with reviewers. It would be foolish for Soapadoo to keep all of the profit when the reviewers are doing so much of the work. The reviews on Soapadoo provide value to the people reading the site. The reviewers are now compensated for providing this value. If you’re a blogger, this is another reason to re-publish the reviews from your blog onto Soapadoo.

If you’d like more information about the program, you can read more about it here.