Just another Halloween…

So last night a kid who honestly was probably too old to be trick-or-treating said, “thank you SO much” very sarcastically when I dropped one small piece of candy into his pillowcase and it stuck very conspicuously near the top, so it was obvious how little I gave him.

I immediately had negative thoughts about his reaction, but I had nothing to say because honestly, he was right. It was pretty stingy. But the problem was, we only bought one bag of candy this year, not knowing how many kids to expect, and it turned out to be a busier-than-usual year. (Most years we buy 2-3 bags and have 2+ bags’ worth left over at the end of the night.)

I started the night giving each kid 2 pieces, but I quickly realized that at that rate I was going to run out before 7 PM, so it was time to dial it back.

So yeah, I guess I deserved to get called out by a snotty 13-year-old for my less-than-copious candy offerings. Some people might say kids shouldn’t act so entitled but honestly, this is part of the social contract we agree to when we decorate the front of our house and turn on the porch light on October 31. Kids are going to come to our door for the express purpose of us putting a reasonable amount of candy into whatever receptacle they happen to be carrying, and one “fun size” Twix is not a reasonable amount.

On a more positive note, not only did it feel like a “normal” year last night, but SLP and I even managed to watch both Halloween and The Shining in their entirety, without falling asleep. (Well… she may have dozed off briefly around the time Dick Halloran was sensing the call to leave his Miami retreat.)

Do What You Like

How “Do What You Love” Is a Recipe for Disappointment and/or Exploitation

Note: This is a rough sketch of some thoughts that have been simmering in my head for years and that were catalyzed by a conversation I had this morning on a walk with SLP. I may turn this into something more substantial and cohesive at some point in the future. But since I also may not do that, I wanted to post this early version, such as it is, so I don’t lose these ideas altogether.

The expectation that you will find a career doing The Thing you truly love tends to lead in one of three directions:

  1. Exploitation by an industrial complex that knows you will work more hours, for less pay, with more personal sacrifice, if you believe you are following your true passion.
  2. Loss of love for The Thing as you realize the compromises you need to make in order to turn a passion into a career.
  3. Cognitive dissonance as you struggle to rationalize that whatever it is you’ve ended up doing is The Thing you believe you truly love to do, when it is not.

Don’t give away The Thing that you love.

Many industries, especially academic and creative fields, are structured in a way that assumes the majority of their most talented workers do truly love the thing that they do, and they’re optimized to exploit that passion. The expectation that you will always go above and beyond, first because you want to but eventually because the structure of the job forces you to, is baked in. You will work more hours than you should, demand less pay than you deserve, and sacrifice other aspects of your life, because you are told it’s what the job requires, and you believe it. But what the job really requires is you. Your talents and your passion, and you should be compensated adequately for those, both in terms of pay and time off. But that rarely happens.

Compromise can be a killer.

There are many aspects of life where compromise is necessary and good. But compromising The Thing you love in order to turn it into a career can very easily suck that love out of The Thing. Clients may have unrealistic or illogical demands. Promoters will want you to do The Thing their way instead of the way you know works best for you.

“Do what you love” ≠ “Love what you do”

This may be the most dangerous path of all. Very few of us can land a job doing The Thing we truly love. Incremental shifts over time, impulsive decisions made long ago, or unexpected changes due to the complex challenges of life, all can lead a person into a place where they’ve invested years of time and energy into something that has little or nothing to do with their true passion in life. But that investment is hard to throw away, and it’s easy to try to convince yourself that you are doing The Thing you love, whatever it is that you’re actually doing. Admitting to yourself that you have no real interest or passion for the job you do can feel like a massive personal failure, but the real failure is denying your personal truth.

Do what you like.

Find a job that gives you satisfaction and fulfillment, but that you can walk away from at the end of the day… or walk away from entirely, if you realize it doesn’t suit you. This is a job that you are willing to invest in enough to take seriously, to do good work, to make a decent living and to contribute to society. It is not a job that you are willing to let make unreasonable demands upon your time, your energy, your family or your personal well-being.

A job you like doesn’t crush your spirit during the working hours, and it leaves you with a good amount of non-working hours to pursue your true passion, hobbies, leisure activities, family time, whatever it is you most want out of life.

Super-easy filterable lists/tables with jQuery

I’m working on a page that will potentially have a very long table of information, and I wanted a way to filter the table to only show rows that contain a specific text string.

Fortunately, with jQuery that’s super easy. It took me about 3 minutes to build and test. Let’s take a look!

First, you want to create your table. Give it a class you’ll be able to use to tell jQuery this is what you’re filtering. Something like this:

<table class="filterable">
  <tbody>
    <tr>…</tr>
  </tbody>
</table>

Now let’s put in a little form field for entering the filter string. This is old news now, but HTML5 lets us use one-off form inputs for on-page actions without having to wrap them in a <form> tag, so let’s just stick this into our HTML above the table:

<div>
  Filter: <input type="text" id="list_filter" />
</div>

Now here’s where it gets fun. In jQuery, we’re going to watch for the keyup event on the input. If the input has a value (i.e. is not empty), we’ll do our filtering. If it is empty, we’ll just reveal all of the rows in the table again.

We probably want the filter to be case-insensitive, so we’ll make both the input string and our check of each row’s text all-lowercase with .toLowerCase().

Next we’ll step through each row of the table, check if our filter string is not present (.indexOf() == -1) in the .text() inside that row. If it’s not there, we’ll hide the row. Otherwise, we’ll show it. (This last bit is important because we want to start revealing previously hidden rows if the user deletes characters from the filter input.)

Yeah… that’s pretty much it. And since it’s all jQuery interacting with elements already present on the page, it’s lightning-fast.

<script>
  jQuery(function() {
    jQuery('input#list_filter').on('keyup', function() {
      if (jQuery(this).val() != '') {
        var filter_val = jQuery(this).val().toLowerCase();
        jQuery('table.filterable tbody tr').each(function() {
          if (jQuery(this).text().toLowerCase().indexOf(filter_val) == -1) {
            jQuery(this).hide();
          }
          else {
            jQuery(this).show();
          }
        });
      }
      else {
        jQuery('table.filterable tbody tr').show();
      }
    });
  });
</script>

A few other notes:

  1. The way this is built, you could conceivably have multiple filterable tables on one page, but only one filter input. The filter would automatically get applied to all filterable tables on the same page. There are various ways of changing this by modifying your selector.
  2. I am deliberately only checking for <tr> tags inside the <tbody> tag to allow for a header row inside a <thead> tag that would not be subject to the filter. If you have a header row inside your <tbody> tag, it’s going to get filtered too! Probably not desirable.
  3. You could play around with making the whole thing smoother with .slideUp() and .slideDown() instead of .hide() and .show() but that UX can get messy in a hurry.

Why Capitalism Is Stupid: A Case Study

Note that I didn’t say bad, or evil, but stupid.

Before we go any further, let me state that I have never studied economics, and I’ve only taken one intro-level philosophy class. The topics I’m bringing up here are steeped in both, and I know I’m out of my element.

Capitalism has, as a core principle, a belief that competition drives innovation and growth, which helps a society to thrive; whether its helping society to thrive is intentional or just a consequence is debatable. And in practice capitalism is just as susceptible to corruption as communism — both fail as a result of the boundless greed of the powerful. But for the moment let’s not dwell on the big picture… let’s just look at one example of how capitalism can be… well, stupid.

I live in Minneapolis, a large city of 425,000. Along with St. Paul (pop. 310,000) it is the core of a metro area of 3.6 million. Like all large cities, Minneapolis is divided into a number of distinct communities. The community I live in is called Longfellow, and combined with neighboring Nokomis, the immediate area has a population of around 65,000 people.

Unlike many other parts of the city, Longfellow-Nokomis has always resisted the heavy encroachment of large chain businesses. Of course we have a Target, a scattering of McDonald’s and Subway locations, etc. But for the most part, the businesses here are small and local.

In fact, in an area comprising about 13 square miles, home to 15% of the entire city’s population, there is only one Caribou Coffee, and until recently, zero Starbucks (not counting the one inside the Target… which is a capitalism story for another blog post). Of course we have dozens of local independent coffee houses, but only one each of the two big chains.

And they’re right across the street from each other.

How does it benefit the citizens of the community to have a Caribou and a Starbucks within sight of each other, when the vast majority of residents of the area don’t live within walking distance of either one? Who does a decision like this really serve? How does this help society to thrive?

What we’re looking at here is not a failure of capitalism in principle, but an example of how it fails in practice, as power is consolidated in the hands of a few greedy, powerful corporations.

I’m sure this is the point where a (21st century) Republican dutifully says, “But how can a corporation be greedy? Greed is a human emotion, and corporations are businesses, not people.” Oh right, corporations are only people when it comes to exercising their right to free speech. (And political money equals speech.) I’m sure few, if any, of the individuals within these corporations are ruthlessly greedy. But they don’t need to be. The system is built on a principle whose logical consequence is that increasing profits outweighs any other considerations. That could be defined as greed.

One could argue that Caribou and Starbucks have grown to that tipping point in capitalism where they are no longer focused on competition through innovation, but on stifling competition through consolidation of power. Nothing better exemplifies to me capitalism’s absurd failure than a business opening its first location in a large, heavily populated area within feet of its rival.

Sadly, I’m sure these corporations did extensive research and determined that the best location in Longfellow-Nokomis for a major chain coffee house was right at this spot, even if there was already another one right there. And I bet both will do booming business, because… honestly? Most of us just don’t question it.

Now get in the car. I want some coffee.