The Self-employment Struggle

Being self-employed can be tricky.  In the (nearly) three weeks I’ve been without a boss I’ve had days of huge productivity and days of zero productivity.  For a while I thought working for myself would mean a flexible schedule, with lots of time to do whatever I want.  Indeed if I so desired I could put 60+ miles on the bike every morning, wearing compression tights while I sit at my computer and code for the afternoon and evening.  Or I could travel all over the place, see friends endlessly, and live the good life.

What I’ve described above is the self-employment struggle — no clear deadlines or outside pressure, nothing but self-induced desires and goals.  The urge to stay-cation is huge, yet productivity is critical.  I should be the busiest I’ve ever been in my life right now.  The only way I’ll succeed is by building awesome shit, enabling me to have more meaningful conversations with investors.  I quit my job to give myself the time I need to prototype ideas and speak to investors.  I didn’t quit to get more free time.  Self-employment, at least the kind that will hopefully one day lead to a technology startup, is about working hard, not taking a vacation.

Android SQLiteOpenHelper onCreate() and onUpgrade() Semantics

Overall I’ve been insanely impressed with Android’s documentation.  I’d even go so far to say that the Android platform has the best documentation of any platform or technology I’ve ever learned, including Django and Python.

However, I couldn’t find much on the semantics of the onCreate() and onUpgrade() methods in android.database.sqlite.SQLiteOpenHelper, which is a class that helps you open and upgrade a SQLite database.  I’ll describe below how these methods are called when databases are created and upgraded.

Database Creation

When the SQLite database is constructed for the first time, as you’d expect the onCreate() method is called, creating the tables you’ve defined and executing any other code you’ve written.  However, this method will only be called if the SQLite file is missing in your app’s data directory (/data/data/your.apps.classpath/databases).  This method will not be called if you’ve changed your code and relaunched in the emulator.  If you want onCreate() to run you need to use adb to delete the SQLite database file.  The sqlite3 tool description has more context here.

Database Upgrading

The constructor of your implementation of SQLiteOpenHelper should call the super constructor, passing along the database name and version.  The onUpgrade() method will only be called when the version integer is larger than the current version running in the emulator.  If you want the onUpgrade() method to be called, you need to increment the version number in your code.

Owning and Doing

Time has a fantastic article about happiness, money, experiences, and possession.  If you have the time I’d suggest reading the article.  Otherwise I’ll give a quick commentary below.  Here’s a great excerpt from the article:

There’s been a lot of recent research on this subject, much of it conducted at Tom’s home institution, Cornell University (a lot of it by Tom). And the answer is clear. If you’re conflicted about whether to spend money on a material good (say, a computer) or personal experience (say, a vacation), the research says you’ll get much more satisfaction — and for longer — if you choose the experience.

I can’t agree with this more.  Sometimes I worry that I have too many possessions – two surfboards, a snowmobile, two snowboards, three bikes, two computers, one car, the list goes on.  However, all of these possessions enable me to have experiences with my friends.  The most happy moments of my life have been on my bike, snowboard, or snowmobile with my friends or family.  I’ve found myself uncontrollably yelling with joy during my experiences.  And I recall those experiences countlessly with those same friends and family.  I get as much if not more joy recalling these experiences as I do actually participating in them.

An experience, whether it’s athletic, food- or drink-related, travel, or anything else, has brought me far more happiness than my possessions.  I justify new or better possessions based on the quality and quantity of the experiences I’ll have with said possessions.

Determination, Success, and the Tour de France

Every year at the beginning of July, France is host to the most legendary race of the year. Over 180 professional cyclists from around the world start a 21-day race that will cover more than 2,200 miles and climb over dozens of mountains.  The Tour de France tests these cyclists both physically and mentally, awarding the holy yellow jersey to the fastest overall rider.  This year’s tour, apart from being the most entertaining tour I’ve ever seen, showed me how dependent success is on determination.  I’ll give a quick recap below.

This year’s Tour de France ended yesterday on the Champs-Élysées, putting a close to the epic race which was determined the day before on the individual time trial.  Amongst the favored winners for this year were Cadel Evans of Australia and Andy Schleck of Luxemburg.

On Thursday, July 21, with four stages to go and Thomas Voeckler wearing yellow, Andy Schleck attacked in the mountains.  He would win the Queen stage that day, and only miss yellow by a few seconds.  The next day, again in the mountains, Andy would perform well and wear the yellow jersey, with a margin of almost a minute on Cadel Evans.

With Andy in yellow, the tour would enter the final determining stage on Saturday, the individual time trial (TT).  This stage is different than all other stages, because riders pedal solo against the clock, without team members to draft.  Cadel needed to make up one minute of time on Andy to win the tour, to be the first ever Australian to wear yellow on the podium in Paris.  All Andy needed to do was maintain his minute lead.  Andy, riding last, had a huge advantage, too, because he knew exactly how his time compared to Cadel.

Cadel would win Saturdays stage, beating Andy’s overall time by 94 seconds.  Cadel out raced Andy on the individual TT by over two minutes.  He rode like a champion.  He rode with determination.  You could see his passion and commitment to win in his face.  He wanted the yellow jersey more than anything.  He left everything on the road that day, determined to win, determined to bury his body and forget everything he’s ever done to focus solely on winning.  Meanwhile, Andy rode with excuses.  You could tell by looking at his face, at his pedal strokes.  Throughout the tour he complained about descents being too technical, ultimately upset that the tour wasn’t being determined in the mountains.  Though I haven’t heard what Andy had to say about Saturday’s individual TT, I could tell what he was thinking by his riding.  He was thinking about how lame the individual TT was, how a tour should never be determined by a TT.  He was making excuses to himself, reminding himself that he trained to his strengths in the mountains, instead of to his weakness on the TT bike.

Determination is all it takes to succeed.  Often we focus on what we’ve done instead of what we need to do.  We can’t make excuses.  Excuses haven’t gotten us to where we are today.  Whether you’re racing on the bike or trying to start your own company, you need to focus everything you have on what’s in front of you, on what you need to do to win.  Forget how you’ve trained or what jobs you’ve had previously — those don’t matter anymore.  All that matters is your determination to do whatever it takes to win.  Cadel is the first Australian to ever win the Tour de France because he was determined to win on Saturday.  Instead of making excuses and distracting himself from his goal, he focussed, performed, and won.  Congratulations, Cadel.  I was originally rooting for Andy, but you deserve the glory that will rest on your shoulders for the rest of your life.

Lastly, I’ll leave you with a wonderful commencement speech from Bill Cosby.  I can’t tell you how much this speech has inspired me. I strongly recommend that you listen to the entire speech. It’s a beautiful story and analysis of you.

You need to a flashplayer enabled browser to view this YouTube video

Photo credit: here and here