The Carbon Tax – Washington Initiative 1631

Fellow Washingtonians! Are you uncertain how to vote on I-1631, the carbon tax initiative, which is easily the most controversial referendum on the November ballot this year? I’ve done some extensive Googling and I have some thoughts on the matter!

Normally I don’t blog about politics but a very long Facebook post seemed like the wrong format to tackle a ballot referendum like this. So let’s dive in.

What is the gist of the measure?

If the measure passes, the following changes will be applied in the state of Washington, beginning on January 1, 2020:

  • Enact a carbon emissions fee of $15 per metric ton of carbon emitted.
  • Increase the fee by $2 annually until the state’s greenhouse gas reduction goals are met.
  • Use the revenue from the fee to fund various programs and projects related to the environment.

Source: BallotPedia

The full text is available if you have time to read 38 pages of legalese, but you might consider reading the ten-page summary instead.

The grand idea of the bill relates to existing laws in Washington state to reduce greenhouse gases in Washington; namely to reduce emissions in the state to 1990 levels by 2020, and to reach 50% of 1990 levels by 2050. This initiative is an attempt to, you know, actually try to do something to reach these goals instead of just hoping things will work out for the best.

The reason it’s called a fee and not a tax is a technical distinction under Washington law; essentially it means that the revenue cannot be spent on government expenses or public programs, but the revenue is dedicated to specific accounts related to investing in climate and environmental projects. So the revenue can’t be used on other forms of government spending unrelated to this measure.

Who supports the measure, and who opposes it?

The top donors for the YES campaign are two committees: Clean Air Clean Energy WA and Fuse Voters. Among their largest donors are the Nature Conservancy, League of Conservation Voters, the Bill and Melinda Gates Foundation, and a handful of other donors. They’ve raised about $15 million to support the measure.

In terms of endorsements, it’s supported by The Stranger and the Progressive Voters Guide, The Olympian, the American Lung Association, REI Co-op, Microsoft, Virginia Mason, Union of Concerned Scientists, and dozens of other local groups. You can find a full list of endorsements here.

The opposition is (surprise!) largely funded by large corporations in the oil and gas industry, namely BP America, Philipps 66, Andeavor, Valero, Koch Industries, and American Fuel & Petroleum Manufacturers. Suffice to say, these industries have a vested interest in maintaining the use of fossil fuels for Washington’s energy needs. They’ve collectively raised $28 million to oppose the measure, much of which hasn’t even been spent yet.

The Seattle Times and a local professor of Atmospheric Sciences at the University of Washington, Cliff Mass, also oppose the measure. The former isn’t too surprising considering the Times is a strangely conservative newspaper in an overwhelmingly liberal city. But the fact that a professor of atmospheric sciences opposes the measure might give you some pause. I’ll come back to that later.

What’s the history? Are there alternatives?

In 2016, there was a similar initiative called Washington Carbon Emission Tax and Sales Tax Reduction, or I-732. The idea was a carbon emission tax on the sale and use of certain fossil fuels and electricity generated from fossil fuels, and its aim was to be revenue neutral. There a really great article on Vox about how and why that initiative failed to pass, and how I-1631 is different. In fact, you should stop what you’re doing right now and go read it. Seriously. I’ll wait.

Done? Okay. So basically I-1631 is a new attempt at a carbon tax, this time with broader political appeal, due to its commitment to invest the fee revenue in projects that will fund additional programs and projects that will further accelerate the goal of investing in clean air, energy, water, and healthy forests.

What kind of programs would it fund?

Did you read that Vox article?

  • 70% goes to clean air and clean energy programs; 15% of that goes specifically to easing the burden on low-income families. Some $12m will also go into a fund designed to help fossil fuel workers transition into new jobs.
  • 25% goes to clean water and healthy forests. Remember all those wildfires we’ve been having? Some of that money could be used for controlled thinning of at-risk forests.
  • 5% goes to healthy communities, which mainly means assisting rural communities affected by climate change.

These projects are estimated to create some 40,000 new jobs in clean energy, forest health, and manufacturing.

Who oversees the programs?

The measure would establish a public oversight board to implement the new law. The board would have fifteen voting members: the chair; the Commissioner of Public Lands; the directors of the Department of Commerce, the Department of Ecology, and the Recreation and Conservation Office; four at-large positions; and six co-chairs of three investment panels. The three investment panels would be created by the measure and would provide advice and recommendations to the board and assist in developing criteria for approving spending on certain projects. There would be certain requirements for the at-large positions and the six co-chairs.

The board would have numerous powers and duties. It would make decisions about which projects and programs to fund with the moneys raised by the pollution fee. It would review and approve rules developed by other agencies that set guidelines for the various programs required or funded by the measure. The board would consult with other agencies and government bodies, Indian tribes, and others in developing projects. It would report to the Governor and Legislature regarding progress and challenges in implementing the measure.

Source: Voters’ Guide

So basically there will be a board of 15 members who are in charge of overseeing the projects and programs.

My Opinion

I plan to vote FOR the measure, and here are some reasons why:

Climate change is real – and is mainly caused by human activity

If you don’t agree with me on this one, then my persuasive power might be limited. But the scientific consensus is clear – not only has climate change accelerated greatly in the past couple of decades, it’s largely due to man-made pollution, and unless we change course, global warming could have devastating effects on our planet. The time to act is now – before things get much, much worse.

Investing in Clean Energy is a better path forward

The fact that the opposition to this measure is almost exclusively Big Oil companies is very telling. I don’t blame them – they have a vested interest in protecting their industry. But a dependence on coal, oil, and other “dirty” energy sources causes pollution and exacerbates global climate change. Meanwhile, there’s a near-infinite amount of free energy in the form of solar radiation that we haven’t yet fully capitalized on. Investing in clean energy could allow us to harness this energy for cheaper than extracting a limited supply of fossil fuels, and with a lot less pollution. That’s a win-win outcome!

The exemptions aren’t a big problem

One of the main ads against I-1631 states, “Big corporations get a free ride, while Washington families, consumers and small businesses pay billions.” Of course, the ad fails to mention exactly who these “big corporations” actually are – why is that? In truth, the fee will apply to 80% of state emissions, and the most notable exemption is the TransAlta power plant in Centralia – which is already scheduled to be shut down by 2025. So much for a free-ride for big corporations. Here’s (part) of the ad.

Some of the other “polluters” exempted include pulp and paper mills – and according to state law, wood emissions are carbon neutral.

It’s not that expensive for consumers

According to this article in The Atlantic, gas prices are likely to rise about 13 cents per gallon in 2020, and 15 cents per gallon for home-heating oil. Which will end up costing most residents in Washington $10 extra per month, at worst. That price is far, far less than the eventual cost of catastrophic global climate change; in fact most consumers probably won’t notice at all. And the fact that the oil industry is so adamantly against this tax means that they will be unlikely to be able to pass all of the fee on to consumers – because there are other options, such as solar power, especially as solar panels become less expensive and more prevalent in the coming years.

This is a positive step in the right direction

Cliff Mass, the Seattle Times, and the oil industry want you to believe that this is a flawed measure that exempts some of the state’s largest polluters, has too many loopholes, and isn’t the nationwide solution we need. While I agree that we do need a nationwide solution to help combat global climate change, sometimes you have to lead by example – and this measure is a positive step in the right direction, both in terms of using a tax (fee) as an incentive to drive down consumption, and because the revenues from the fee will be used to invest in the future.

Cliff’s main reasons to vote against the measure seem to be the fact that it’s a left-leaning (partisan) approach, and that there’s no concrete spending plan written into the bill for the billions of dollars of revenue the fee will generate. The idea that we shouldn’t vote for this bill because it doesn’t explicitly list all of the programs it should fund is ridiculous – such language would prevent thoughtful and meaningful investments in the future by artificially limiting them to what is written in the bill. Instead it sets up an oversight board tasked with finding and funding projects based on a number of authorized uses and requirements, which are written into the bill.

As for the partisan approach, surely Cliff is aware that the bipartisan, revenue neutral approach to a carbon tax (I-732) already failed two years ago? Is he proposing we put that back on the ballot and allow it to fail again? Cliff’s anti-partisan (anti-liberal) stance seems to stem from a certain narrow anti-government and anti-Native ideology that really makes you wonder – is it enough to believe in climate change, or do we also need to believe that we should do something about it instead of simply letting oil companies continue to pollute the only planet we have?

Conservatives and libertarians rarely believe in environmentalism and taking action to protect our planet. That’s because large-scale solutions to negative externalities like pollution and global climate change require government solutions and international cooperation, which are two things conservatives and libertarians are ideologically opposed to. Many won’t even consider this kind of solution because they believe – wrongly – that free-market forces are sufficient to clean up the planet on their own. This is a dangerous myth that prevents us from taking any real action, until it’s too late.

It’s true, this bill is probably not 100% perfect. But that’s not an argument to vote against it, unless your argument is really just a way to pretend you care about the planet while letting oil companies get away with murder. Don’t fall for it – guys like Cliff are simply trying to waste our time chasing legislative unicorns.

The bottom line is, we have a real chance to make a meaningful policy change in the state of Washington to meet our commitments to reducing greenhouse gases via a emissions fee on the state’s largest carbon polluters, which will drive down carbon consumption while raising money for additional clean energy, clean water, and healthy forest projects, while creating thousands of new jobs. The initiative is supported by a broad coalition of concerned citizens and local businesses, and is really only opposed by large oil corporations who want to continue polluting our planet while making as much money as possible. Let’s do the right thing for our state and our future – vote YES on 1631.

Additional Links / Editorials

Yes on 1631

Mark Higgins – Seattle Times: Forget Big Oil Scare Tactics

HeraldNet – Even with flaws, I-1631 provides climate solutions

Bill Gates – Why I’m for Washington state’s carbon fee

The Olympian: If no carbon fee now, when?

 

How Traveling Abroad Can Make You a Better Person

I’ll just get right out and say it – traveling abroad can make you a better person.

For some of you reading this post, that might be obvious to you, perhaps because you yourself have had the opportunity to travel internationally and know exactly what I’m talking about. If you haven’t – then you should really consider it. Not just because it’s fun, but because the experience itself is transformative, and can actually make you a better person. Here’s why:

You become more flexible

International travel is fun, but it’s also full of challenges and inconveniences. You might suffer from lack of sleep and jet lag on your first day if you travel several timezones away. You might have to wake up super early to catch a flight or a ferry or a train. When you’re hungry, you might have to resort to whatever local cuisine is available at that time. You might be overdressed or underdressed for the weather and temperature, leading to discomfort. But ultimately each of these inconveniences and challenges can be empowering – they teach you that you can survive and even somehow enjoy uncomfortable situations. You adapt and do whatever needs to be done, and over time you learn to become comfortable with being uncomfortable. You become more flexible, and more able to deal with challenges with grace and aplomb.

You will discover new and beautiful places

The world is full of beautiful and interesting places to see – whether it’s a gorgeous cathedral constructed over hundreds of years in Paris, a breathtaking mountain range in Argentina, or the clearest blue water you’ve ever seen off the coast of the Yucatan peninsula in Mexico. Experiencing such a sight in person will inspire awe and wonder that leaves your heart full of love and gratitude for the beauty that exists on this Earth. And with that love in your heart, it’s hard not to treat those around you will more love and compassion as well.

You meet new and interesting people

It might happen on accident; perhaps a shared ride in an elevator on your way to town leads to a conversation that then leads to drinks with friends, and before you know it, strangers become not so strange anymore. You might befriend some people from your town that you’ve never met before, or folks from England, Iceland, New Zealand, or Switzerland. Maybe you’ll add each other on Instagram, friend each other on Facebook, or simply trade numbers so you can contact each other on WhatsApp. Most likely you’ll need to speak the same language in order to form a fast friendship like this, but it not only can happen – it does happen. Depending on how flexible your travel plans are, you might even find yourself traveling with some friends you just met and adventuring together. But even if you only share a few moments together, making international friends shows you that the world is full of charming, lovely people from all over the globe, and you realize that we are all one in mankind.

You get better at solving puzzles

International travel is not always easy or straightforward – sometimes it can be downright confusing. Depending on where you are, you might not speak the language, or understand the way that things work in a particular place. Let’s say you have a flight into Zagreb and want to make it to the island of Hvar a couple days later – what’s the best way to get there? Should you take a bus? Or a train? Or should you rent a car and visit a winery and a waterfall on the way? Some of the options available to you require some thought and planning in advance, but other puzzles must be solved on the fly, in real time. How do we check in to a new hotel or apartment? How do we navigate from where we are to where we are going? You’re basically solving mini-puzzles constantly while you’re traveling, and if you’ve got the right attitude, then instead of being frustrating it will be fun and empowering, in the sense that each puzzle solved increases your personal power to tackle bigger puzzles and challenges in the future.

You learn new languages

This one is kind of obvious, but it’s worth mentioning. If you are traveling abroad in a country that does not use your native language, then you’re likely to pick up at least some bits and pieces of a new language. At the very least, it’s worth learning these six essential phrases: Hello, Goodbye, Please, Thank You, Yes, and No. Anyone can learn these six phrases in any language, and using them appropriately will do wonders for your likability. Americans in particular have a reputation for being a bit ethnocentric and uncultured; putting forth a little effort in appreciating and using the local language shows that you are neither.

In addition, just by immersing yourself in a place where a different language is used, you will learn a couple words just from signs and context. When it’s more inconvenient not to know the local language, then you will learn some of it automatically as you travel.

You experience new cultures

International travel can be a very eye-opening experience. Especially for those who have lived in the same place and been immersed in the same culture for their entire lives, it can be shocking to experience a new culture and new ways of doing things. At first this can be frustrating – why can’t people just act “normal”? But over time you realize that the particular ways of acting or doing things in the place you are from are not universal; they are cultural artifacts. And perhaps it’s worth considering that there is more than one “right” way to live. As you experience new cultures, you have the opportunity to learn from them, and perhaps even change the ways you act or respond to certain situations.

You become more grateful for what you have

As much as international travel can be fun, it can also be a relief to come back home. You start to miss your friends, your family, and even the routine of your work week and weekends. The inconveniences and stresses of travel sometimes add up and home can be so comforting in contrast. Especially if you visit countries or areas where there is poverty or difficult conditions, you may find yourself extremely grateful for what you have when you come back home.

So what are you waiting for?

Get out there and see the world!

Projecting My First 12a

Two weeks ago I finally did it – I redpointed my first 12a.

In layman’s terms, that means I climbed a route rated 5.12a, on lead, without resting on the rope or taking a fall, in a single go.

I don’t mean to sound dramatic, but seriously.. this is not something I believed I could do.

For those of you who don’t climb, I could at this point write a long-winded explanation of the Yosemite Decimal System, its history, and its use today, but you’d get bored and so would I, so if you’re truly interested, just Google it. The short story is that sending a 12a is similar to earning your black belt in Karate, but for climbing. While it’s definitely not the hardest grade in climbing (that would be 5.15c currently), it’s a significant achievement that few folks who try climbing ever attain. For me it’s been somewhat of a Holy Grail – something I’ve always aspired to, yet just out of reach. Something I never thought I would actually accomplish, but rather a signpost in the direction you’d like to go.

I started climbing thirteen years ago, in early 2004, as a fun new hobby. I wouldn’t say that my inherent finger strength was particularly good or that I was particularly fit when I started, so my progress as a climber has not been very fast – in fact I know several climbers who have reached 12a in a third of the time. However, I do have one advantage: I like climbing. In fact I would say that I’m pretty passionate about it.

That helped me stick with it as a sport. But to be honest, for the last couple years, my progress in sport climbing had stalled out. I looked it up – I sent my first 5.11b on March 11th, 2011. I’ve redpointed a couple other routes rated 11b since then, but for five years, that was my highest grade sent. I’m not really sure why – maybe I just assumed that I wasn’t strong enough to send an 11c? Maybe I was just too afraid to even try? I just reviewed my climbing log today, and somehow, I managed to get on only two routes harder than 5.11b for five years. Yikes.

But last year, I don’t know, something changed. Maybe it was the fact that I started a new training plan the season before. Or maybe I just got lucky. I spent a long weekend climbing in Squamish with my two most awesome climbing partners, Rachel and Sarah. They were working really hard on an 11d called Rug Munchers, a short overhanging climb with powerful, bold moves and difficult clips that really tests the limits of your power endurance. Your forearms end up on fire by the end of the climb. It’s tough.

But my friends were all working it in earnest. Really figuring out the moves and how best to clip the rope at each bolt while holding on with only one hand. And as much as I assumed I could never do it, I tried it anyway. And.. I didn’t do so hot. I made it maybe halfway up, on toprope. But even that outcome showed me that maybe it wasn’t quite so impossible as I had assumed. I also spent some time that weekend working on an 11c that Sarah was interested in, called Filth Infatuated.

I didn’t send that 11d that weekend, nor the 11c. But I did come back three weeks later with my girlfriend (now fiancée), and not only did I send Filth Infatuated on Saturday (my first 11c), on Sunday I ended up sending Rug Munchers as well! The moves seemed to flow smoothly like water in a stream, every movement calculated, visualized, and practiced beforehand. In fact, when I clipped the chains at the top of the route, I almost felt like it had been too easy – like I was cheating or something. But that’s how it should feel when you’ve truly mastered a route.

The key to my success on that trip was the magic of projecting. Projecting is climber-speak for working the same route over and over, learning its holds, moves, and clipping positions, and practicing it until you can execute it in your sleep. While I only took two burns on Rug Munchers per day on my first trip, I watched several of my friends take turns on it, and in doing so, I learned not only the correct holds to use but the body positions, sequences, and clipping positions that make the climb as easy as possible.

You see, a good climb is like a well-orchestrated dance. Your hands and feet work in concert with the twists and turns of your body, allowing you to flow upward with the minimum amount of effort required. While climbers might have a reputation for raw finger strength and bold fearlessness, it’s the vertical dance that really separates the good climbers from the great. The ability to balance properly and use your center of gravity to your advantage is infinitely more useful than raw strength. Advanced techniques require lots of focus and lots of practice. But learning these techniques is essential to any budding climber’s progress.

This summer, I made a pact with my friend Rachel to project a 12a named Rainy Day Woman on the World Wall at Exit 32 / Little Si. Rachel has Wednesday afternoons off, and although I typically work a standard 9-5 job, I foolishly agreed to take Wednesday afternoons off in June and July this year in order to work on this specific climb. This plan was foolish not necessarily because of the vacation time I’d need to use, but because I had no reason to believe that sending the route was even possible for me – especially considering that I’ve only climbed one 11d and two 11cs in my entire climbing career. So this climb was likely to be harder than anything I’d ever even tried before. But I didn’t care – I decided what was important was putting in the work, and actually projecting something difficult, for once, and if I send, then that’s icing on the cake. So we started heading out to the wall in early June to work on it.

Let me pause here to tell you a little bit about the route. The first thing you should know is that it’s a monster of a route – 80 feet of overhanging volcanic serpentine rock. It’s neatly divided into three sections; the first 30 feet culminates in an awkward bulge, that is quite taxing and cruxy regardless if you go left, right, or straight up and over it. But completing this section earns you an amazing ledge that you could take a nap on – or simply get your heart rate under control. After that, there is another 30 feet of sustained, slightly overhanging, pumpy climbing on mostly good holds, aside from one tricky clip halfway through. Finally, after a pretty decent rest position on some bomber jugs, the last 20 feet starts with a very difficult crux move followed by taxing, powerful moves that really test your power endurance until you reach the chains at the top.

It’s hard to describe the crux move exactly, but it involves a very high, barely feasible crimper for your left hand and then moving your feet onto quite precarious footholds before pushing off your right foot in order to reach the next right hand, all while above your last bolt and trying to pretend you’re not afraid to fall. At least when I do it. Even while fully rested, the move is not easy. After that it’s still a struggle to get into position for the clip, and the next move to the next bolt requires high feet and a long stretch with your left hand into a V-shaped notch in the crack, thumbs down. The final moves to the chains wouldn’t be so bad except you’re traversing right on mostly non-existent footholds and by now you’re probably pumped out of your mind.

Suffice to say, this is a very hard route with hundreds of moves, each of which must be executed flawlessly in order to save enough strength for the crux and not pump out before the chains.

Our first day out was not particularly impressive. In fact, neither of us could finish the route on lead – as I said there is one move that starts the high crux that is very difficult, even to the point of being cryptic and inscrutable the first time you encounter it. We refused to feel defeated though – we were still able to practice the lower two-thirds of the route, which we still needed plenty of practice on.

On our second Wednesday out, we managed to clip one more bolt, past the crux move, but still didn’t have the strength or the nerve to finish the route. Doubt of our eventual outcome still hung in the air as we departed.

The third Wednesday was a little better. Rachel finished the climb on lead, albeit bolt-to-bolt. Meanwhile, both of us were trying a few different things on the lower, bulgy crux, in order to determine the best and easiest possible path to the bomber ledge above. Things were going just.. okay.

By the fourth trip, it was my turn to lead the route again. We’d been switching lead duties so that the other could climb with the psychological safety of a toprope, focusing on the moves and not the fear of falling. I’m pretty sure I finished the climb on lead this time, though I might have pulled on some draws in the process. Embarrassing, I know. Oh, and I also fell right after the first bolt. Oops.

Our fifth Wednesday out was a bit of a breakthrough for me. Rachel couldn’t climb that day, so I asked our friend Samantha if she wanted to work on the project. To my surprise, she agreed, so we headed out there, and as the more experienced climber it was my responsibility to lead. I accidentally led the route clean up until the high crux at which point I chickened out on the crux move and asked for a take. But on my second burn on toprope, I actually climbed the whole thing without falling. Hot damn! Suddenly the send seemed not only possible, but actually within reach.

Two Saturdays ago, the three of us headed out to climb the route yet another time. Since we arrived earlier in the day, when we arrived at the wall we were surprised to find that it was in the sun – and it was a pretty hot day! Fortunately, by the time we had each warmed up on a 5.9 and both Rachel and Samantha took a burn on Rainy Day, the sun had moved enough to put the wall in the shade for my attempt.

The first section went swimmingly, aside from my extremely high heart rate after I pulled over the bulge. I literally spent five minutes breathing deeply on the ledge, trying to get my heart rate down. Excessive resting, you might say. The next section flowed pretty smoothly too, aside from one clip that has always given me trouble, because you’re clipping from either a bad side-pull on the left or a far-away right hand. So I skipped it until I was in a better position above and could clip it at my hip.

At this point I took another excessive rest in a relatively good position below the high crux. I found I could almost arm bar my right arm to my left while standing on really good feet. Cycle hands and repeat.

Once rested again, I started moving. There is a set of jugs by the clip before the crux move, but I’d learned previously that you don’t want to stall here – you have to keep moving. So without hesitation, I put my feet into position and threw my left hand up for the high crimper. As always, it was good, but not great. I strained to move my left foot under my center of gravity, and then pushed down on it to get high enough to grasp the next hold with my right. Surprisingly, it worked, and I made a couple more moves to get into position for the clip. Clipped.

The next move is a high right foot followed by a high left foot, while keeping hands on the same holds used to clip, and then standing up enough on the left foot to strain and reach into the crack high to the left, with my left hand. Somehow, this also worked, and I managed to clip the last bolt before the chains.

Only a five foot traverse up and to the right remained. Of course, my forearms were incredibly pumped at this point in time, so even though the last several handholds were jugs, I needed to stem off a corner to the left and cycle hands on the clipping jug to regain just a tiny bit of strength. Then, I made the moves necessary to reach the chains. It was a little ugly, as I was seeing red for the send and not thinking clearly due to the adrenaline running through my bloodstream, but I made it, and clipped the chains.

Boom. My first 12a.

Now that was a rather long-winded story, and it might even seem self-aggrandizing, but the point I’m trying to make is not that I’m an amazing climber or anything like that. As I said, I’m not particularly strong or skilled for someone who’s been climbing for thirteen years. My point is that, for a really long time, I had assumed that sending a climb at this grade was impossible for me. Like, literally, completely impossible. And I think this belief held me back for a long time. Projecting showed me that even something that seems impossible at first glance might be quite attainable if you keep at it, maintain a positive attitude, and put in the work.

Is there something you’ve always wanted to do in your life, but have always assumed is impossible? Is there a dream that you’re holding onto that you’ve never truly pursued because you don’t want to face the fear of failure? Maybe it’s not as impossible as you think. Maybe it’ more attainable than you realize. Is it possible that you could take small steps between where you are and where you want to be, put in the work, and succeed in the one thing your heart truly desires?

I think you can. But there’s only one way to know for sure – believe in yourself, get started, and put in the work.

Abject Failure as a Recipe for Success

So way back in 2008, after spending four years working as a software engineer for National Instruments, it came to pass that my girlfriend at the time decided she wanted to move to Seattle to go to law school. This was not entirely unexpected, and in the end I decided to move up to Seattle with her rather than terminating or long-distancing the relationship.

I managed to get onsite interviews with Google, Microsoft, and Amazon, and they each flew me up on separate weekends to interview me and wine and dine me and convince me to move across the country. Well, I should say that Google and Microsoft tried to wine and dine me, and Amazon basically just shrugged and said, “You’ll become a better programmer here, or something?” Anyway, recruiting strategies aside, I moved here in mid-2008 with high hopes and big dreams.

Boy did that ever turn out differently than I’d hoped. I got placed on the Visual Studio 2010 Platform/Core team, honestly a team of some very very smart developers who outclassed me in every way, and to put it nicely… things did not go so well for me there.

I think that a big part of it was just that they weren’t quite sure what to do with me when I arrived; I’d gotten the job mainly due to a friend of a friend, and when I arrived there was no feature work for me to do, so I ended up working on bug fixing rather than writing any new code. The idea, supposedly, was that this was a chance for me to get to know the (very large and complicated) codebase of Visual Studio, prove myself as a good bug-fixer, and then move on to real development work. This proved more difficult than expected. The code was written in C++/COM, much of it legacy code from a decade hence, and my background was much more .NET focused than hardcore C++ Win32/COM focused. The bugs were largely bugs that other developers were having a hard time fixing or simply didn’t have time to fix, so they got assigned to me (the newbie) instead, which makes total sense of course.

Over time it became clear that my manager was not particularly happy with my performance. He had decided that I should be fixing around six bugs per week, and I was fixing closer to two or three bugs per week instead, and thus my performance was not up to par. I’m not entirely sure how he arrived at this magic number, come to think of it, but he had expectations and I was not living up to them!

I got my first review after a year on the team. Back then, you were evaluated based on two axes: Commitments and Ranking. Commitments were the things you intended to accomplish throughout the year, whereas Ranking is essentially a stack rank or bell curve of how you compare to other co-workers performing your job. Although I managed to obtain a grade of “Achieving Commitments” on the Commitments axis, I received a stack ranking in the lowest 10% on the meta-team. The insidious thing about stack ranking at Microsoft is that managers are required to rank employees in order of “contribution” and “influence”, and that no matter how excellent your team is, someone always earns the black spot. And when you do, you are typically either fired or put on a Performance Improvement Plan with very serious implications if you do not improve your performance, young man. Not only that, but even if you wanted to transfer to another department or position, you’re basically blacklisted when you’ve got that kind of black mark on your permanent record.

Of course I took this all very seriously back then. I was filled with self-loathing and self-doubt, and questioned my abilities as a programmer and my worth as a human being. This combined with the incredibly gray and rainy Seattle winter, and my relationship falling apart, and my general lack of any kind of social support, and it’s fair to say that the winter of 2009/2010 was perhaps the most depressing and disheartening winter of my entire life.

Despite my seasonal depression, I decided to redouble my efforts, but I knew that even if I worked twice as many hours and twice as hard I still might not rank above the dreaded 10% cutoff at the end of another year. So I made a plan. I saved up as much of my paychecks as I could. I readied myself for what was to come. And when I did finally get my second yearly review, and I got yet another bottom 10% ranking, I knew what I had to do.

I quit.

My manager was a bit shocked. I’m not really sure why. Maybe it was because I didn’t have another job lined up. Maybe it’s because I told him I was going to spend the winter rock climbing in Mexico. Maybe he thought I was just being crazy and reactionary and acting on a whim. But what he didn’t realize is that I’d been planning for this possibility for nearly a year.

So I did. I gave my two weeks notice, I started figuring out how to pack up all of my earthly possessions and put them in a U-Haul trailer, and when the time came, I left Seattle in my 2003 Hyundai Santa Fe and drove to Fort Collins to drop off my stuff at my parents’ house, then continued south to Austin. After a few days, I then drove another 8 hours south to my favorite place in the world, El Potrero Chico in northern Mexico.

It’s a fantastic place. Absolutely stunning, beautiful limestone walls that just seem to jut out of the ground from nowhere, a sport-climbing paradise with some of the world’s most inspiring multi-pitch climbs. I spent a good four months there, climbing every other day, having a great time, and taking a sabbatical from the rat race and self-loathing that epitomized my Microsoft experience. And I tried something new.

A few months prior, I had a friend ask me if I was interested in helping him with this Android app he was working on. It was a really cool app actually, very popular and innovative at the time, and he needed someone to help with some additional functionality. I was more than happy to sign up. In two years at Microsoft fixing bugs, I must have written no more than 200 lines of production code, and here I was given the opportunity to write something completely new and fun and exciting. So I dove right in. At first Android was a bit scary and overwhelming, but over time our project grew and I learned more and more about writing Android applications, from the user-facing UI to the invisible services that perform the real magic. I regained my confidence and realized that I wasn’t a bad programmer; I’d simply been in the wrong environment for me at the time.

Eventually I ended up running out of sabbatical money and started interviewing for “real” Android jobs, and got one at Ratio Interactive. I was super nervous at first, but I proved myself capable quickly and regained even more confidence. I became not simply a general-purpose programmer, but a developer with a very specific skillset. A developer that people wanted to hire.

I just recently accepted a new position with a small agency called LIFFFT; the ethos of which is that they want to empower their employees to work in whatever capacity makes them happiest, as long as they continue to kick ass for their clients. I don’t mean to brag, but these days I’m making significantly more money than I made at Microsoft and I’m about a thousand times happier.

What’s funny is that if I could go back in time and chat with my former self, I don’t think the past version of me could possibly believe that my future held such potential. All I saw was the doom and gloom and unhappiness of my current situation, the abject failure of the now. And perhaps the strangest thing about this is knowing that without that abject failure, I never would have become the person I am today. I never would have spent the entire winter climbing in Mexico, having the time of my life, nor would I have taken the time to learn and specialize in the Android platform. In many ways, this terrible failure set me up for future success in ways that I could never have predicted.

So I am thankful. I am so very thankful to have had such a difficult, soul-crushing experience, struggling and failing to achieve my dreams at Microsoft. Without that, I might have just ended up living a relatively boring and mediocre life doing whatever was enough to get by, never daring to learn something new or try something risky. Play it safe. Stay the course. Don’t stick your neck out.

There are times in your life when things will not go your way. You will be discouraged, you will have difficult times, and missteps, and even abject failures. But don’t let that get you down. Sometimes these trying times are exactly what you need. The key is to use your unhappiness and discomfort as a launching pad for your future greatness. Remember, it’s only after we’ve lost everything that we’re free to do anything 😀

Photo Credit: Sergio Tudela Romero

Seven Months at Ratio Interactive

It’s been a long time since my last post (last June!), and my excuse is of course that I’ve been crazy busy ever since I started working full-time for Ratio Interactive last July.

Prologue: Pre-Ratio

Before I started working at Ratio Interactive, I spent about two years working on an “indie app” called iSyncr for JRT Studio. It’s an excellent Android app that allows you to sync your iTunes music and playlists to your Android device via USB or WiFi – specifically, I worked on the WiFi syncing solution, including both the Android app code (Java) and the server applications for Windows (C#) and Mac OS X (Objective-C).

I also co-wrote a similar app called Cheetah Sync for JRT Studio, which is a handy Android app for wirelessly syncing files and folders between your Android device and your PC or Mac. Check it out!

Working on these two apps was my first foray into Android app development, and although I was only working about “half-time” on these apps, I learned a ton and now have the right to call myself an accomplished Android developer. I’m very proud of having had this experience.

Ratio Who?

What is Ratio Interactive? Basically, we are a small but talented digital agency composed of talented designers, software engineers, and project managers that develops top-notch web apps and mobile apps for Windows 8, iOS, and Android. We’re located in Pioneer Square in downtown Seattle, but our apps have a worldwide reach. We are especially well known for being the Windows 8 app agency, having launched over 20 apps for Windows 8 when it premiered last year, and we continue to drive the core principals of Windows 8 app design. But we are far from a Windows-only app agency, having developed several quality apps for Android and iOS.

Culturally, Ratio is a relatively small team of fun, creative, yet hardworking individuals who are passionate about creating great apps and websites. Where many software companies have sterile, impersonal cubicle farms, or isolated closed-off offices, we have an open floor layout in a loft office which lends itself to open collaboration among developers, designers, and project managers which allows us to be highly agile when working across various projects. It’s really an excellent, open working environment, and it’s a lot of fun.

Projects I’ve Worked On at Ratio

Even in just a few short months at Ratio, I’ve been involved in several different projects. Here are some of them:

iCookbook – Android

iCookbook is a handy app containing thousands of searchable / filterable recipes that you can use to cook up something interesting in your own kitchen. You can view the ingredients list for each recipe, preparation instructions, take notes, create a shopping list for recipes you want to make, and much more.

When I came onto this project in July, the initial release of the app was for Android tablets only, and I was tasked with updating the app to make it work better on Android phones as well, and I think it’s fair to say that we succeeded. We created an entirely new set of screens that are optimized for the smaller form factor of Android phones and yet the app experience is just as useful and capable.

Pirq – Android

Pirq is a really cool location-based app for finding real-time deals near your location. Want to go out to lunch and get a really great deal? Pirq can help you discover a great lunch venue on the cheap, sometimes as much as 50% off.

I must admit I didn’t do a lot of work on Pirq, but I did help fix a few bugs prior to its 2.0 release =)

New Android Project

I’m currently working on an Android project that’s so secret, I can’t even mention what it is. It is, however, a really interesting project and I’m really excited to be working on it!

Join the Team!

Are you a talented designer, app developer, or project manager looking for a great place to work? If so, you should consider working for Ratio Interactive. We’re always looking for talented front-end devs, iOS devs, Android devs, Win8 devs, graphical designers, and project managers who can help us take Ratio to the next level. You can contact us through our website, or contact me and I’ll see that your information reaches our talent recruiter’s desk.

Like Games? Want to Learn a Foreign Language? Play Diablo 3 in a Different Language for Total Immersion

Most experts agree that if you’re trying to learn a foreign language, one of the best ways to do so is via total immersion in the target language, often by traveling to a foreign country where everyone speaks the language you want to learn. Of course you may need a basic grasp of the language’s rules and grammar first, but being forced to read / listen / speak in a foreign language just to make it through the day gives you a wonderful incentive to learn more, whereas living in an English-speaking area makes it difficult to practice since you have to go out of your way to do it.

On the other hand, if you can’t live in a foreign country and still want to learn the language, there are ways that you can at least expose yourself to some level of the language without too much trouble, especially if you use a computer a lot. Some ideas:

Change Your Facebook Language

If you use Facebook, chances are you already have a pretty good idea how to use it. So why not switch it to your target language for some bonus immersion? Here’s how:

  1. Open the account dropdown menu at the top right corner of Facebook and choose Account Settings.
  2. Next to Language, click the Edit link.
  3. Click on your target language and then click on Save Changes.

Easy! You’ll be “Me Gusta”-ing things in no time!

Change your Smartphone’s Language

For iPhones:

  • Settings -> General -> International -> Language -> Español

For Androids:

  • Settings -> Language and Keyboard -> Select Language -> Español

Use the Language Immersion for Chrome Extension

There’s a pretty popular Chrome Extension out there right now called
Language Immersion for Chrome. It lets you pick your language and immersion level, and then it will use Google Translate to automatically translate your favorite websites into your target language. Since Google Translate supports 64 different languages, the extension does too.

Of course, Google Translate isn’t perfect, and sometimes it’s even bad. But using the extension will still give you some exposure to the language you’re trying to learn.

Download a Foreign Language Client for Diablo 3

Like playing games? Addicted to Diablo 3? Also want to learn a foreign language? Great! Just download a foreign language client for Diablo 3 and you’ll get to satisfy your gaming addiction and learn something at the same time. Here’s how:

  1. Sign in to your Battle.net account.
  2. Click on Account.
  3. Click on Diablo 3 (assuming you’ve already purchased it).

    diablo_account

  4. Click on Download Game Client.

    diablo_game_client

  5. Verify your age (if necessary).
  6. Under Full Game Client, and next to English (US), click on Change.

    diablo_change_language

  7. Now click on your target language, and then click on Save.

    diablo_espanol

  8. Now the “Windows” or “Mac” links should be enabled. Click on your OS to download the game client downloader in your target language. Note that some languages appear to only support Windows.
  9. Once the downloader is downloaded, run it to start downloading the client in your target language. For me I had to re-download the full 8 gigabytes for Spanish, but it was totally worth it.

Once you’re set up with your new language, you can play Diablo and learn Spanish (or German, French, Italian, Polish, Portuguese, Korean, or Chinese).

diablo_characters_espanol

The whole game has been localized by Blizzard, and they did a really good job. I’ve found that every cut scene, every conversation, and every part of the interface has been localized to Spanish. In other words, total immersion. My favorite is probably when my Templar yells “Lo conseguimos!” (we have done it!).

I recommend beating the game once in English and then playing through your second time in your foreign language of choice. That way you’ll have a pretty good idea of the story and what’s going on, and can deduce words and phrases by context. Actually, you’ll be able to figure out the meaning of almost every word in the target language based on the inherent context of the game itself, which is awesome!

8 Reasons Why Climbing is the Best Sport Ever

I believe that one of the best ways to maintain a healthy level of personal fitness is to find a sport you enjoy, rather than a workout you can tolerate. I think it’s really common these days for people to think that the only way to get fit is to join a gym, resolve to hit the elliptical three times a week, and maybe do some weight training, or circuit training, or whatever.

Although working out like this will keep you fit, the ultimate problem is that it’s boring. Have you ever seen a bunch of people on an elliptical, or walking on a treadmill, who appear to be enjoying it? Hardly! For most people it’s mostly a slog; a slow process of watching your workout timer run out and trying not to collapse.

Sports are different. Sports trick you into getting fit, in some pretty awesome ways:

  • Intellectual Stimulation – Any sport worth playing involves an intellectual strategy required to win. This makes things interesting, and provides a distraction from the physical effort. You hardly even notice that you’re working out or working hard, because you’re so focused on the game, and you can put a lot more energy and effort into physical activity than you would be able to otherwise.
  • Team Focus – A sport is not really a sport without some kind of team. We work harder to “win” when there are others around to motivate us and share in our success.

I think everyone should have at least one sport that they love and that they do regularly. While I enjoy a wide variety of sports, personally I think rock climbing is my favorite, and here’s why:

1) Climbing is an excellent workout.

cliffhanger-1
If you like muscles, anyway.

Climbing requires the use of your whole body: Your fingers to hold on to the rock, your biceps and back muscles to pull yourself up, your toes to step on tiny feet, your calves to step up on your feet, your quads to stand up on your legs, and your abs / core to maintain body stability. In short, it’s a really good anaerobic workout that is going to give you a strong back, strong biceps, strong abs, and yes, killer forearms =)

Not only that, studies have shown that rock climbing is classified somewhere between excellent to superior in terms of its aerobic profile, especially during sustained climbs. It’s not at all uncommon to find yourself breathing hard both during a hard route as well as afterward.

Lastly, sustained climbing burns quite a few calories. Estimates vary from about 400 to 800 calories burned per hour, and of course it depends on your weight and the amount of exertion, but a day of climbing can definitely help burn excess calories, especially if you spend all day climbing a multipitch route.

2) Climbing is extremely intellectually stimulating.

cliffhanger-1
Not just an event in J-Tree.

Most non-climbers think of climbing as being mainly a matter of having strong upper-body strength and muscling your way up a rock face. Honestly, this couldn’t be further from the truth. Although upper-body strengh is important, there are two factors that are just as important or more for being successful on the rock: technique and mental focus.

Climbing technique can be thought of as any physical mechanic used to make any given climb easier. There are innumerable techniques used to achieve this, but they all basically achieve the same goal of conserving your strength for as long as possible. Efficiency of movement is everything. Some keystones of effective technique are:

  • Put as much weight on your legs as possible. You can always tell the new climbers from the experienced ones, especially guys, because they try to just muscle up every route with no regard whatsoever for their feet. And then they are surprised when they can only climb a couple of routes and then burn out.
  • Don’t overgrip. Climbing can be pretty scary at first, which is why almost every new climber tends to grip the rock like they’re hanging on for dear life, even if they’re toproping (and therefore relatively safe). Fighting this urge and using the least necessary force to use each hold is an important technique to master.
  • Use balance to your advantage. Balance is everything in climbing, so much so that I like to think of climbing as vertical dancing. Typically forward movement involves balancing your body weight between three points of contact (hands and feet) and using the free hand or foot to move upward. Changing your body position and balance allows you to weight the holds in an optimal direction and expend the least possible amount of effort.
  • Sequence is everything. Moving your limbs and shifting your body weight in a specific, sequenced, strategic way is of tantamount importance, especially on bouldering routes, which typically require such a careful technique, strategy, and sequence that they are called boulder problems – climbing them is like solving a puzzle.

3) Climbing makes you feel like a badass.

cliffhanger-1
Tell me this isn’t badass.

Climbing is pretty exhilirating. It’s hard not to feel awesome when you’ve just sent a route that you’ve been working on for weeks or months. It’s also hard not to feel like a badass when you do a multipitch, climb hundreds of feet in a day, and live to tell the tale.

A big part of climbing has to do with facing your fears. When leading a route, you sometimes get into situations where you are above the last bolt (facing a potentially big fall), and you have to master your fear in order to make the moves necessary to reach the next bolt and clip your rope into it. Looking fear in the face and giving it the middle finger in order to make the next clip is the ultimate adrenaline rush.

I mentioned mental focus in the last item, and it’s just as important as physical fitness and technique. Facing your fears, visualizing success, and committing completely to the climb you’re on are all necessary to send your hardest projects. When you’re climbing, there’s no time to think about the bills you have to pay or any other worldy concerns – it’s just you and the rock.

Climbing sometimes reminds me of Fight Club. It doesn’t really matter what your boss thinks of you during the work week. He doesn’t know that on the weekends you’re scaling rock faces, earning cuts and bruises as badges of honor to show that you tangled with the rock and you won. In other words, after climbing, everything else in your life gets the volume turned down.

4) Climbing gives you a great excuse to visit beautiful areas that you never would otherwise.

Climbing areas are almost always beautiful areas. Consider these photos:

potrero-mx
El Potrero Chico, MX

smith-sunrise
Smith Rock, OR

squamish-bc
Squamish, BC

tonsai-thailand
Tonsai, Thailand

But without climbing, I would have no real reason to go visit these places, or at least not a compelling enough reason to do so.

When I was younger I used to go camping a lot with my family, and although it was kind of interesting being out in nature, I found it pretty boring sitting around in a tent or camper all day, with no real purpose for being there. But climbing gives you a really good excuse to go camping somewhere – you camp in order to climb! So instead of reading books, playing cards, or fishing during the day (yawn), you get to scale some beautiful rock walls instead =)

5) Climbing is a relatively inexpensive sport.

dirtbag

Okay, so climbing is not the cheapest sport in the world, but it’s not the most expensive one either. Outdoor sport climbing is pretty much free once you have some basic gear:

  • Climbing shoes – $100
  • Harness – $50
  • Helmet – $50
  • Chalk Bag – $20
  • Quickdraws – $120 (splittable)
  • Rope – $150 to $200 (splittable)

Typically a group of two climbers only need one set of quickdraws and one rope between them, so that makes the per-person gear cost around $350 and you’re set for at least a year or two.

Other than that, you only need to pay for food, gas, and camping fees when you can’t avoid them. In fact, climbers are famous (or infamous) for being so committed to climbing that they often resort to dirtbagging. Few other sports have this kind of anti-materialistic, spend-nothing mentality. And unlike ski bums, who are really just skiiers / snowboarders who have jobs near the slopes in order to pay for their lift tickets and their apartment, climbers can actually get away with spending next to nothing for their sport.

6) Climbing can be as individual or as communal as you want it to be.

Some sports, like baseball for example, require a cadre of people to play at once. You simply cannot play without getting 18 people together at the same place and time. Typically climbers organize themselves into two-person teams, where one person belays while the other climbs, but this is not the only way to climb.

If you’d rather climb as an individual, you can always go bouldering at a local rock gym (if there is one in your area), and for some, that is enough. Another option, if you’ve got the gear and the skills to do so, is called rope soloing, where you set up a system to auto-belay yourself while you climb a route.

On the other hand, if you want to bring several of your friends out climbing, you can do that too as long as everyone has rock shoes and a harness. Typically when sport climbing, one or two people will take turns leading routes to set them up on toprope, and then everyone else takes turns climbing the routes that are set up.

7) Climbing is easy to train for.

Don’t live super close to the rock? Live in a city and have a steady job? No problem – climbing gyms exist in nearly every urban area, at least in the States, and are an excellent way to train for climbing when you can’t make it out to a real crag. Compare that to snowboarding or surfing, where there’s really no way to practice other than finding a mountain with snow on it or an ocean with waves.

And again, unlike most team sports, you don’t need a cadre of friends to practice climbing, all you need is a bouldering gym and some shoes.

8) Climbers are typically some of the nicest, most relaxed people you will ever meet.

There are jerks and egoists in nearly every sport, including climbing, but for the most part climbers are very laid back and easy to get along with. It’s part of the anti-materialistic, naturalist mindset of climbers. It’s pretty typical when bouldering indoors to share some banter with your neighbors about how to climb certain routes, and it’s also very typical when climbing outside to take turns on routes and share a bit.

I spent most of last winter (2010 -> 2011) camping and climbing in El Potrero Chico, Mexico, and it was an awesome experience, in no small part because of the community there. I met dozens of awesome climbers that were all great people to hang out with when we weren’t on the rock. It’s typically pretty easy to find climbing partners in the popular climbing areas, and not at all uncommon to run into some climbers you’ve met before in different areas. Other sports just don’t have this kind of community.

Programmatic Sentence Generation – Shakespeare!

Introduction

Many moons ago, when AOL Instant Messenger was all the rage, I really wanted to write some kind of chat bot, something like SmarterChild except, perhaps, more amusing and less useful. I do recall attempting to use some Perl-based chatbot APIs to connect one of my accounts to AIM, but had very little success. So I gave up on the AIM API, and focused more on the core functionality of what I wanted a chatbot to do: simply construct a sentence given a “seed” word as the first word in the sentence. Therefore, the “Shakespeare” project was born.

What’s in a Name?

Why is this application called Shakespeare? Well, actually, originally it wasn’t – it was called Jabberwocky. I needed a source text from which to construct sentences, and one of the free online books available on Project Gutenberg was Through the Looking Glass by Lewis Carroll, and Jabberwocky is one of my favorite poems from the book. Not to mention the fact that a programmtically-generated sentence would likely sound rather silly and hilarious. Or so I hoped. Anyway, the first version of my program used Jabberwocky as the source text, but later I decided that I wanted a much larger source text, such as one of the works of Shakespeare. I grabbed the text from The Merchant of Venice, cleaned it up, and started using it, and the sentences it generates now are just as amusing or more.

Program Source

This project is written in C++, and is available on GitHub for public consumption here: Shakespeare. Feel free to check it out. The project opens in Visual Studio 2008, but if you don’t have VS2008 installed then it should be pretty easy to edit and compile using g++ or Eclipse or something =)

Source Explanation

The program works via a simple two-step process:

  1. The source text is parsed and string pairs are put into a multimap
  2. The program reads lines from stdin until “quit” is received, and generates a “sentence” for each word entered.

Let’s examine these steps more closely:

Parsing the source text

    while (!file.eof())
{
std::string s;
file >> s;
s = strlower(s);

// Look for a period
if (s.length() > 1 && s[s.length() - 1] == '.')
{
s = s.substr(0, s.length()-1);
file.putback('.');
}
// Look for an exclamation
else if (s.length() > 1 && s[s.length() - 1] == '!')
{
s = s.substr(0, s.length()-1);
file.putback('!');
}
// Look for a question-mark
else if (s.length() > 1 && s[s.length() - 1] == '?')
{
s = s.substr(0, s.length()-1);
file.putback('?');
}
// Look for a comma
else if (s.length() > 1 && s[s.length() - 1] == ',')
{
s = s.substr(0, s.length()-1);
file.putback(',');
}

// Add the data to the map
if (last != "" && last != "." && last != "!" && last != "?")
{
wordmap.insert(make_pair(last, s));
}

last = s;
}

The code here reads strings from the file, where each string is separated by whitespace. For the most part these strings represent words, but some of the words end with periods, commas, exclamation marks, or question marks. If one of these characters is encountered, we want to treat it like its own “word”. Next, for each word that we find, we insert it into a multimap where the previously encountered word is the key and the current word is the value. By the way, a multimap is just a C++ map that can have multiple non-unique key-value pairs.

Generating the sentence

        while (true)
{
// Check to see if the word is in the multimap
if (wordmap.find(word) != wordmap.end())
{
// Get first mapped value
multimap::iterator lb = wordmap.lower_bound(word);

// Count how many there are
long count = wordmap.count(word);

// Select one of them
long index = rand() % count;

// Advance map iterator
for (long i = 0; i < index; i++)
{
lb++;
}

// Check for characters that would end a sentence
if (lb->second == "." || lb->second == "!" || lb->second == "?")
{
// If sentence is too short, select another word
if (wordcount 1)
{
// Update the word count in case the only endings to this
// word are ! or . or ?
wordcount++;
continue;
}

// Print word
cout <second << endl;
break;
}
else if (lb->second == ",")
{
// Print commas
cout <second;
}
else
{
// Print the word with a space
cout << " " <second;
wordcount++;
}

// Update the current word
word = lb->second;
}
else
{
// Not found; end the sentence
cout << ".\n";
break;
}
}

The code here looks up the first mapped value for the current word in the multimap (if it exists). If it does, then we pick one of the values for this key at random. Note that multiple identical values can exist because of how the source text was parsed, so you have a higher chance of getting a more common “following” word than one that is not so common. Each following word is printed, unless the word is a “sentence-ending” word such as the period, exclamation mark, or question mark and the sentence is deemed to be too small. Not shown here is the initialization of the first word to be the word that the user typed into the application.

Some Example Outputs

I find many of these to be hilarious. The sentences have a tendency to run on and obviously don’t quite follow the rules of sentences. But because each source word precedes a destination word, the sentences generated often almost make sense:

Will be render’d, will you, monsieur le bon?

Why should i know your master will tarry?

Try confusions with his surety and you the occasion to his affections, dispatch all of rich value of fair hand i am in silver ewes, as he hath the fiend bids me this shadow ere thou to him.

Thou like a night troilus methinks it.

Wit in the duke only are not love me to speak for the truth is no so again his outward wall, for a man knows but who bids me the wind!

Pity on his wealth being seasoned with us in alabaster?

Jump with imagined speed, indeed, for this letter call me dog and that is sum that the knave and it to offend, but assumes some taste of blood to my clerk, for i do you a key, there.

Improvements?

Feel free to leave a comment if you have any ideas for ways to make the generated sentences either more realistic, or more amusing =)

Book Review: Programming Android

<!– –>

Sorry readers (both of you), but I’m doing another book review! This time I’m reviewing the book Programming Android by Mednieks, Dornin, Meike, and Nakamura.

Why I bought this book

Despite now having worked on Android apps as my main source of income for the past year and a half, I couldn’t help but feel like there were certain aspects of the Android framework that I have probably skipped over or not encountered yet with the apps that I’ve written so far. Thanks to iSyncr WiFi and Cheetah Sync, I’ve done a lot of networking / file transfer / iTunes development, and a decent amount of UI design, fragment work, etc., but I wasn’t sure that I’d really learned everything that an Android dev should know, so I bought this book to help fill in the gaps.

Chapter 1: Your Toolkit

This chapter deals mostly with installing Eclipse and the Android SDK on your development machine and getting started with your first Hello World Android app. This chapter looks pretty good actually for anyone new to Android, but fortunately I’ve already learned all of this stuff =)

Chapter 2: Java for Android

I actually really enjoyed this chapter, because prior to working on Android I worked mostly in C++ and .NET, so there’s a fair bit of Java trivia in this chapter that I found informative and amusing. Some of the more interesting things in this chapter:

  • Java is strictly pass-by-value. This is actually just a footnote in the book, but extremely important to know as a Java developer.
  • Static vs. dynamic classes. Top-level classes are “static” by default, because they belong to no other class instance, but classes defined inside other classes are “dynamic” because they belong to the top-level class instance – this is why inline classes have access to the parent class’s variables.
  • Java collections. A short discussion of the main collection types in Java was appreciated, even if I already knew this stuff =)
  • Anonymous classes. These are supported in Java / Android, and are very useful for creating event listeners (eg. view.setOnKeyListener(new View.OnKeyListener() { });).
  • Multithreading. This was perhaps the most enlightening of all. Did you know that the synchronized keyword serializes access to data visibility as well as access to the code block it surrounds? I was definitely not aware of this prior to reading this chapter =)

Chapter 3: The Ingredients of an Android Application

This chapter is a relatively interesting discussion of the basic components that make up an Android app: Activities, Intents, Tasks, Services, and Content Providers. There’s also some basic information on the Android manifest, application resources, and the application life cycle. Not a bad chapter.

Chapter 4: Getting Your Application Into Users’ Hands

This chapter deals mostly with using signing certificates to sign your app, some very basic information on submitting your app to the Android Market, and a brief mention of supporting different screen sizes. There’s not much detail here as far as the actual publication of the app or how exactly to make your app work well with different screen sizes and densities, but considering how thorough the Android Dev Guide is in terms of supporting multiple screens, the authors probably thought it would be silly to add all of this information to the book.

Chapter 5: Eclipse for Android Software Development

This chapter is mostly a treatise on the different kinds of views you can use in Eclipse while writing code or debugging your app. For seasoned Eclipse users, this section is pretty skippable. The chapter also mentions a “static analyzer” for finding bugs in your app called FindBugs. I haven’t used this tool before, but I would definitely consider it now that I’ve read this chapter.

Chapter 6: Effective Java for Android

The most interesting part of this chapter is the discussion on concurrency / threads in Android. Rule #1 of Android development is to not perform long-running operations in the UI thread unless you want your users to get Application Not Responding errors, which are Very Bad. So this chapter discusses how you can use AsyncTasks to perform “slow” operations on a new thread so as not to block the UI thread. There’s also some discussion of serialization and Parcelables in this chapter, which are important concepts to master in Android. However, it did seem a little odd to me that concurrency and serialization would be in the same chapter here.

Chapter 7: Building a View

We’re seven chapters into this book and we’re just now discussing Views and how they’re used to design our app’s user interface. Interesting! It seems to me that this chapter should have come up a LOT sooner. Either way, there’s some discussion of how Views are laid out, especially with the LinearLayout. What I found odd about this chapter is that despite being called “Building a View”, the main flow of the chapter is about Android’s MVC architecture, which is a good way to think about programming in Android, but 2/3 of the chapter has nothing to do with Views. The last part of the chapter shows how to create a Menu for your users. I’m torn on whether or not this should be here considering that Menus are deprecated in Android 3.0 and later.

Chapter 8: Fragments and Multiplatform Support

I’m not sure what this chapter has to do with multiplatform support, because it seems to be entirely about fragments. I’m not too thrilled to see this chapter here – fragments are a relatively advanced UI concept, and we’re learning about it right after we learned how to use Views and event callbacks? Plus, this chapter is really short and I feel like fragments deserve a lot more explanation than given here.

Chapter 9: Drawing 2D and 3D Graphics

I have some mixed feelings on this chapter. The focus of this chapter seems to be describing some of the lower-level things you can do in Android to draw 2D and 3D graphics, especially if you are creating your own widgets / UI components. There’s also some explanation of matrix transformations, effects, and animations you can apply to your Views. There’s also a brief introduction to using OpenGL in Android.

While I was amused to see that you can do all of these transformations and effects in Android, it seems unlikely that most new Android developers would jump right in to creating their own UI components, so I’m not sure why this chapter wasn’t an advanced topic.

Chapter 10: Handling and Persisting Data

The focus of this chapter is mainly how to use Android’s built-in support for SQLite in order to persist and retrieve your application’s data in a relational database. Now we’re talking! Unlike some of the previous chapters, I believe this is something every new Android dev should learn as soon as possible. My only possible complaint about this chapter is that the Shared Preferences Database isn’t even mentioned as a possible way to store very simple app data, but I can overlook that considering that SQLite is a much more scalable solution for persisting data.

Chapter 11: A Framework for a Well-Behaved Application

I’m not sure why this chapter is called what it is, because this chapter is all about an activity or fragment’s lifecycle, as well as how to save and restore state correctly during the lifecycle. There’s also some interesting content on task behavior (and how tasks are launched), though I’m not sure if the intent flags are explained in a way that really makes sense. Still, not a bad chapter aside from its name =)

Chapter 12: Using Content Providers

This is one of the chapters I was most looking forward to when reading this book, because I haven’t had a lot of previous experience working with (or creating my own) content providers. This chapter explains how they work and constructs an example of how they could be used in a small sample application. Overall this chapter is interesting and easy enough to follow.

Chapter 13: Exploring Content Providers

This chapter is a bit like a continuation of the last chapter, where the authors use the previously implemented content provider to create a full application to search and display YouTube videos. Unfortunately, this chapter shows why books aren’t always the best medium for teaching; it’s full of source listings spanning multiple pages and with little contextual glue between them. I found myself wishing that I could find the source for this example online somewhere and just look through the code myself rather than trying to read and digest the source code. Trying to read the source and understand the explanations ultimately proved futile, so despite my best efforts I gave up on finishing the chapter and moved on. I really think this book would have been better if the source had been available online.

Chapters 14-16: Multimedia / Location / Sensors / Speech / Accessibility / Etc

These chapters are considered “advanced topics”, such as playing/recording video or audio on Android, location and mapping, sensors, near-field communications, speech, gestures, accessibility, etc. While these topics are interesting, they also seem to be covered pretty well already on the Android Dev Guide.

Chapter 17: Communication, Identity, Sync, and Social Media

This chapter marries two very different things; the first being an example of how your app could sync contact data with a remote service, the second being using Bluetooth in your app. Why these two topics are in the same chapter is beyond me, but since the former doesn’t seem to be easily discoverable in the Android Dev Guide, it made the chapter worth reading.

Chapter 18: The Android Native Development Kit

This might be one of my favorite chapters in the book. The Android Dev Guide doesn’t really cover the NDK in a long-form topic – it’s mostly just a brief explanation and an offer to download it and play with sample applications. Fair enough, but how are developers supposed to know if the NDK is worth playing with in the first place? This chapter explains what it’s for and how to use it in a way that is concise and easy to read.

Closing Thoughts

I thought that this book was a decent introduction to the Android platform, but the way that the information is split into chapters makes almost no sense. Some topics are too advanced to be covered in early chapters; other chapters feature multiple concepts that have no discernible relation to each other. If there was one thing I would recommend to the authors, it would be to come up with a more logical, linear progression from basic Android topics to advanced ones.

The other main problem with this book is much deeper. In a vacuum, I think this book has inherent value in what in can teach about the Android platform, but it must be compared against the available alternatives. One such alternative is the Android Dev Guide itself, which is free. So the real question is, does this book contain $27 worth of content that you cannot get from reading the Android Dev Guide? Unfortunately I think the answer is no. The Dev Guide is always up to date, contains more information than this book does, and you won’t find yourself struggling to make it through chapter 13. If you prefer reading books to reading websites, or can’t access the internet, or you have about $27 more than you know what to do with, then buy this book. Otherwise, just read the Dev Guide.

Book Review: The Nomadic Developer

I recently bought a couple of new software development books from Amazon, including The Passionate Programmer, Programming Android, The Busy Coder’s Guide to Advanced Android Development, and The Nomadic Developer. Of these, the only book I’ve finished so far has been The Nomadic Developer, so I thought I’d write up a quick book review on the blog.

Why I bought this book

As an indie Android app developer, I have worked on a couple of apps that are selling in the Android Market, namely iSyncr WiFi and Cheetah Sync, as a software contractor for JRT Studio. I am very proud of these apps, and I enjoy adding new features and fixing bugs in them as they arise.

However, I get paid from these apps only when customers buy them, and while I could spend 40+ hours a week adding new features and fixing bugs, this won’t necessarily result in a dramatic increase in the number of people who buy these apps. In economic terms, according to the supply curve of labor, in general an increase in expected wages will tend to cause workers such as myself to supply more labor, but if the demand for the app remains relatively constant, my wages are fixed and so is my desire to trade off leisure time for labor time =)

What am I getting at? Basically, this year I’m looking to get into some paid, hourly contract / consulting work to supplement my indie app income, so that I could have some more control over the correlation between working more hours and earning more income. So I bought this book to see if it had any insights into the world of contracting as a “nomadic developer.”

Things I learned from this book

It’s embarrassing to admit, but before I bought this book I was a little bit confused about the difference between contracting and consulting. Before I started working on Android apps, I was employed full-time as a W-2 employee at National Instruments and then Microsoft, so I was painfully ignorant about the “other” methods of paid software development.

So, first and foremost, I learned that contracting typically means working on short-term software development projects as a “software mercenary” until the job is complete, and then you go back to doing whatever you were doing before. Whereas consulting typically means joining a consulting firm where you are expected to be work on projects to which you are assigned and you are expected to bill hours without spending too much time “on the bench.” Also, typically the scope of a software consultant goes much further beyond simply implementing software according to provided specifications – it often typically requires business acumen, people skills, and advising.

Because this book focuses exclusively on joining a consulting firm, I didn’t learn anything about what software contracting looks like or how to thrive in that environment, but I did learn a lot about what it’s like to work at a consulting firm, should I ever be interested in doing that in the future.

Things I didn’t like about this book

As I mentioned before, I initially bought this book because I thought it might have some insights into software contracting, so I didn’t realize when I purchased it that it was first and foremost a guide to surviving and thriving as a consultant working for a consulting firm. That was my mistake when I bought the book, but it meant that many of the chapters seemed completely irrelevant to my interests.

For example the chapter called “The Seven Deadly Firms” lays out 7 types of consulting firm personalities that are worth avoiding if possible when interviewing for a consulting job, and the chapter explains how you can identify these firms and avoid them. While somewhat interesting, it was pretty irrelevant to me. This also applies to “How Technology Consulting Firms Work”, which focused mostly on how to deal with the account executive, engagement manager, recruiter, consulting manager, etc., and the “Your Career Path” chapter, which focuses mostly on career paths inside of IT consulting.

Things I liked about this book

Now that I’ve got my complaints out of the way, I’ll focus on the things I did like about this book. There’s actually a lot of interesting insight in this book that’s really applicable to any software developer, not just consultants. Chapter 4, “Ten Unstated Traits That Technology Consulting Firms Look For”, is really a recipe for any software developer looking to become a valuable and well-known developer in their tech community. For example:

  • Be good at being interviewed for jobs
  • Always be learning
  • Be active in your technical community / develop your network
  • Work on your writing skills

Chapters 6 and 7, “Surviving” and “Thriving” are full of excellent advice for any developer as well, especially the advice to do what you enjoy, and that billing work = good work. After all, developers who create profit for a company don’t get fired.

Lastly, chapter 9, “Avoiding Career-Limiting Moves”, is a little bit silly, since it’s themed on the seven deadly sins, but it does offer some good (if obvious) advice about the traps that software developers often get themselves into.

Conclusion

Overall, I think that this book has a lot of insights for any software developer, especially those interested in becoming a software consultant, but if you’re not interested in doing consulting at a consulting firm then maybe this isn’t quite the right book for you. Many of the same insights and advice for surviving and thriving as a software developer are also in the similar book The Passionate Programmer, which is approximately half the cost and you won’t waste any time trying to read chapters that don’t apply to you =)