Monday, February 6, 2012

This Is Me - Part 2

In the first part of this two part post, I talked about the motivation that got me to pull up my socks and change some things about myself that I wasn't happy with.  But prior to that, I wrote about some of the things I wanted to get gone this year, mentioning that a list like this helps to motivate me.  That post contained a set of specific goals I set for myself.  One of the things I wrote was this:
My best lift is the deadlift.  Pick a weight up off the ground and put it back down.  Simple enough.  I can usually do something like 350lbs to 365lbs for five or six reps depending on the day with a bodyweight in the low 140lb range.  Not bad.  This should translate into a 415lb+ one-rep max... So...

Goal #1: Deadlift 405lbs for a single rep.  That's four wheels a side.  This goal should be doable.  I just have to do it.
Italics added.  Keep those in mind.

I also wrote in Part 1 about some of the reading I've been doing in regards to working out.  One of the sites I didn't mention there that I hit up pretty regularly is Jamie Lewis' most excellent Chaos and Pain.  This site is NSFWOAE: Not Suitable For Work, or Anywhere Else.  Don't click that link.  You have been warned.
This Is Not Me
Jamie has a way of writing that doesn't just give you a wakeup call: his writing delivers violent and repeated blows to the head using your own arm as a club.  It leaves you lying in a pool of your own blood and other bodily fluids.

In this recent post (once again, don't click that link), he wrote:
One of the most virulent and offensive exhibitions of this "I suck and can't help it" mentality is the practice of setting a New Year's resolution.  In setting a NYR, you're doing a couple of things, all of which are about as cool as those grown men who brag about watching My Little Pony and write fan fiction for the show.  First, you're announcing to the world that you've identified a fault within yourself and refused to resolve it.  Second, you've decided to procrastinate on even pretending to resolve the issue until an arbitrary date.  Third, you're making a hell of a lot of noise about nothing, since only about 12% of people who make New Years Resolutions enjoy anything resembling success.(Quirkology)  It's a fucking embarrassment of fat, drunken David Hasselhoff with a hamburger proportions.  If you think you suck, fucking stop sucking immediately.  Women, I'm pointing at you and your motherfucking diets- there's no goddamned time like the present.  Stop putting shit off until tomorrow like you're a modern day J. Wellington Wimpy, who is perhaps the cartoon character most deserving of a curb stomp in history.
Can you hear the wake-up call?  One of my goals for the New Year was to do something I already believed I was capable of doing.  So why hadn't I done it?  Because I suck.  Because walking up to a bar loaded with almost three times your body weight and lifting it off the ground is hard.  It was time to grow a pair.

I did this two day's after reading Jamie's blog.
This Is Me

Not only did I hit a goal I had set for myself just days before, but it looks like I could have gone heavier and still have made it.  It isn't everyday that I can say I learned something from a barechested crazy man in an Viking hat, but I can today.  So can you.

Now go click on a few of those links.

Sunday, February 5, 2012

This Is Me - Part 1

I have always been a skinny guy.  I have the genes of Phasmatodea, wrists like twigs, and legs like toothpicks.  This made Junior High and High School not a lot of fun at times.  It is apparently a lot of laughs to pick on the little guy.  And if he just happens to be a nerdy little guy, well... so much the better.
This Is Not Me
As the years went by and I grew older, so did everyone else.  Maturity does pretty much everyone some good, and I wasn't picked on anymore.  I went about my business as so many other skinny guys do: I jogged, put rocks in my pockets when the wind came up, and avoided all you can eat buffets.

Enter university, and my hair started thinning out.  The new round of jokes made at my expense were sometimes funny, sometimes not.  It didn't help that there wasn't much I could do about it.  It was also depressing in that thinning hair and a skinny frame did not make for the most attractive combination.  I came to believe that I would die a lonely death.
But as a friend of mine would say, "I'd rather be lucky than good".  I met someone wonderful who would later become My Lovely Wife.  She said that my thinning hair and skinny frame did not bother her.  Maybe.  Hopefully.  But it bothered me.  Each of these things had been a noose around my neck for too long, and I decided I would cut each of them away.

I would embrace the thinning hair.  I would shave my head and go from male pattern baldness to Lex Luthor cool in one go.  Easy.
This Is Not Me
But not so fast.  There was one problem: the combination of a bald head with my skinny frame would have me regularly mistaken as a cancer patient.  And that isn't cool at all.  I would have to put on some weight, but all of my years of being too thin made me fat-phobic.  If I was going to put on some weight, it would have to be good weight.  I started working out.  Not easy.

And I made mistakes, many of them.  My biggest mistake was believing what all of the workout gurus on the Internet were saying: you need to do endless amounts of crunches to get good abs, you need to hit the muscles from all angles to get them to grow, you better eat every few hours or your muscles will fall off, and you need to buy tons of supplements to get anywhere.  I would learn later that all of this is wrong.  All of it.  But I'll get back to this in a bit.

When I started working out, I bought a simple weight bench and a set of "standard" weights that you see collecting dust in so many basements.  I did endless amounts of curls with these things, along with other assorted bits of randomness.  And then one day I started to notice that my arms were getting a little bigger.  Not a lot, mind you, but enough to give me the positive reinforcement I needed to keep going.    When you've been skinny all your life, this is a big deal.

I began doing some research as I kept exercising, and my understanding of what is effective and what isn't as it came to exercise and nutrition gradually improved.  I learned that to get strong, you need to lift heavy things.  It sounds crazy, but it is true.  I decided that I would get myself an Olympic style bar and set of weights totaling 300lbs.  300 lbs!  I'd never need to buy more weight again!  But one solution leads to another problem, and the idea of pinning myself under a heavy barbell, only to be found dead two weeks later was not a good one.  So I bought myself a power rack.  I could then lift heavy weights safely in my own basement.  I was still making mistakes, but I was on the right track and continuing to gain strength.

At least I did one thing right.  I ate a ton of food.  Even though the workouts I was doing were far from optimal, my undersized and undernourished body soaked up calories like a sponge.  I was gaining a pound a week, and most of that was good weight (i.e. muscle).  I hit the scale every Monday and watched with glee as my "newbie gains" took hold and the dial on the scale inched upward.

My research led to to a couple of sites that I became very grateful for.  They actually had some science behind what they had to say.  This was a refreshing change from the "bro-speak" that is pervasive on the web.  If you've ever heard someone say something along the lines of "Everybody knows that you need to do X to get Y", you've got yourself a perfect example of bro-speak.  "Everybody knows that you need to eat breakfast to kick-start your metabolism in the morning".  "Everybody knows that you need to eat brown rice and chicken breasts if you want to get lean."  Etc.  Bro-speak is a good example of correlation vs. causation, and it is important to know the difference.  Sure, there are a lot of bodybuilders that eat endless amounts of brown rice and chicken breasts and get very lean doing so.  But just because they did so doesn't necessarily mean that that was the cause of their getting lean, and that they couldn't have gotten lean by eating some other way.  Consider this: ice cream sales go up in summertime.  Drownings go up in summertime.  This must mean that ice cream causes drowning, right?  Of course not.  Ice cream sales correlate to drownings (they follow the same kind of trend), but one doesn't cause the other.

Back to those sites.  The first site was Lyle McDonald's Bodyrecomposition.com.  I'd recommend that everyone read his site from top to bottom to really understand how the nutritional processes work in your body.  The sooner you understand how you get fat, that a calorie is a calorie, and that your weight depends simply on calories in vs. calories out, the better off you'll be.

The second of those sites was Leangains.com.
This Is Not Me
This is Martin Berkhan, the man behind Leangains.  A man who doesn't use steroids.  A man who walks around all day everyday at around 6% bodyfat.  And a man who once figured out he ate on average of an ounce of cheesecake every day for a year.  Martin developed a version of Intermittent Fasting (IF) where you restrict your calorie intake to within an eight hour window and fast the other sixteen.  He uses some pretty solid research to put a knife through the heart of many myths related to exercise and nutrition.  This is another site you need to read from top to bottom. You'll learn that your metabolism doesn't slow down if you don't eat every few hours, how partitioning calories around a workout can benefit getting stronger, and that "clean eating" is not a requirement to getting big and lean.  And he's got the clients to prove it.

A lot of what he wrote made good sense to me and I was thinking I'd give it a a shot.  The one thing that held me back was that I thought (like so many other people) that I would starve to death if I didn't have breakfast.  But then again, how do you know if you don't try?

Read that last bit again.

How do you know if you don't try?

How many times have we shot ourselves down when we might have been easily capable of doing something?  And I'm not talking about jumping off a bridge here. I was talking about skipping breakfast.  If I didn't like the experiment, no harm done.

I remember the first day I gave this a shot.  I stopped eating at 10:00 pm on a Friday night and didn't eat until 2pm the next day.  My expectations were that I'd feel crappy, tired, and hungry until I ate that day.  I was amazed that it actually went the other way.  The coffee I was drinking (caffeine helps to curb appetite) was like rocket fuel on my empty stomach.  I was full of energy.  And I also experienced another benefit to the fast that I had read aboout but thought was bullshit: my concentration levels were way up.

That night, I put a major hurt on an all you can eat buffet.  And this highlights another benefit of Intermittent Fasting: when you eat, you eat big.  The same amount of food eaten in a narrower window seems like more and leaves you satisfied.  If you've ever done the "eat every three hour thing" and always felt hungry, then give IF a try.

I've been eating this way now for the last two or three years and don't think I'll ever go back.  Eating big rocks.  I will often eat 1500 calories within around 90 minutes after my evening workout and then go to sleep for the night (for point of reference, a Burger King Whopper has 670 calories).  I don't get fat thanks to calories in vs. calories out.  Simple.
The Caloric Equivalent of Two of These Before Bedtime
Plus An Order of Value Onion Rings
But the bigger benefit to me has been how my ability to concentrate has increased.  This is something I noticed was degrading as I grew older.  I think my focus is now at least as good as it ever was.

Am I a big and lean like Martin?  Nope.  Not even close.  I could very likely eat more and train smarter, and my age and crappy genetics in this regard don't help.  But I am decently strong for my size and have around 20-25 lbs more muscle on me than when I started.  Years ago I was picked on.  Now friends and family will say to me out of the blue that I look really good.  That feels great, because I've worked damn hard to put those pounds on.  That positive reinforcement gives me the extra push I need when I'd otherwise feel too tired or lazy to go downstairs and hit the iron for the night.

Anyhoo, if you made it this far, you might be wondering if I have any point to make in all of this rambling.  I do, but that will have to wait to Part II.

Sunday, January 29, 2012

IM-ME Proof of Life

I have been making progress on using a Pretty Pink Pager as a receiver for the Davis Instruments Wireless Integrated Sensor Suite (ISS).  The ISS, in case you weren't aware, is the outside part of the weather station that records wind speed, wind direction, rainfall, temperature, and humidity.  Anyhoo, I got this going last night.
Click to Embiggen
Here is what this display is showing:
  • Freq is the frequency the IM-ME is set to receive to, in Hz.  The hex value below that is the corresponding settings written to the FREQ2, FREQ1, and FREQ0 registers on the CC1110 processor in the IM-ME.  I wrote a simply Python script to make sure I was properly converting the raw frequency to the register values as a double-check.
  • Chan is the channel ID.  The Davis system uses 51 channels for its Frequency Hopped Spread Spectrum (FHSS) scheme.  This really doesn't do anything.  Yet.
  • Cal is the result of the frequency calibration executed using the RFST_SCAL command.  This value gets written to the FSCAL3, FSCAL2, and FSCAL1 registers on the CC1110 processor.
  • RSSI is the current Received Signal Strength Indicator.  In other words, this is the received power picked up by the IM-ME.  It updates many times per second.
  • Max is the good stuff.
I fired up my little program and watched as the RSSI value bounced around in the noise at a value of around 65 to 70.  Then I brought over my wireless console over and put it into diagnostics mode by pressing the TEMP and HUM(idity) buttons at the same time.  Pressing 2nd CHILL brings up a second display that shows the channel number the receiver expects the ISS to transmit next.

Just after the Davis console started scanning for Channel 0, the Max value of the RSSI jumped from around 70 to the 113 value shown above.  YES!  The IM-ME was seeing the power in the signal transmitted from the ISS.  This made me pretty happy to say the least as it proved out a number of things:
  • I was properly calculating the frequencies based on the hex values sniffed when I worked out the Davis frequency hopping sequence.
  • I was getting other basic aspects of the radio configuration correct.
  • I can write a simple program.
The first bit about the frequencies being calculated correctly was a big deal.  I had been led to believe from some of the Davis FCC documentation that the 51 hop frequencies were evenly spaced by 500 kHz between 902.5 and 927.5 MHz.  The values I sniffed in the link above told a different story: the frequencies were only roughly aligned to that spacing, with significant deltas of 100 kHz or more in places.  I wasn't sure which was correct, and I wasn't prepared to take my ISS to work to look at the signal on a spectrum analyzer to find out.

One thing I built in to my little test program was the ability to adjust the center frequency of the radio in steps as large as 1 MHz and as small as 1 kHz.  This let me tune to other channels in the hop sequence.  If I saw a big spike in the RSSI value at the right time, I would know that I wasn't getting lucky on just the first channel.  And indeed, I was able to tune to the next calculated channel frequency and watch the Max RSSI value jump up at the right time in the sequence, as expected

As far as being able to write a simple program, that is probably overstating it a bit.  If it weren't for the amazing work by Michael Ossman, who wrote the IM-ME spectrum analyzer on which my program is based, I'd be totally screwed.  Michael, in turn, based his work on an earlier reverse engineering effort on the IM-ME at Dave's Hacks. And so on down the line it goes.  I will of course share whatever I come up with once things get further along.

So I can see the power in the signal now, but I'm still a ways off from getting actual data.  The first problem that I have to overcome is determining how the ISS sends synchronization and preamble information to the console.  I never really realized how much this involved until I dug in to it this weekend.  The CC1021 in the ISS and the console leaves this chore to the firmware of the processor controlling it.  The CC1110 does a lot more to handle this automatically, but you still have to tell it what to look for.  And the problem is I don't know what to tell it to look for: that information isn't available for sniffing on the SPI bus.  What I think I'm going to have to do is open up the console yet again and look at the signal lines that carry the data bits back and forth between the CPU and the radio chip.

Stay tuned.

Sunday, January 22, 2012

Baby Steps

Tool chain: Check!
IM-ME: Check!
GoodFET: Check!
Let's get this party started.

Wednesday, January 18, 2012

Blogger, You Suck Hard

I am angry.
This evening I went to sit down and finish yet another epic blog post that I've been working on for days.  Just a quick proof read plus a few cleanups here and there.  I open the post in Blogger's editor.  It goes on for pages.  It looks great, and it should, because I have put all kinds of effort in to this.  I type a couple characters and hit Control-Z.  Suddenly every word and image in my post disappears.  I see the Autosave button flash.

And I am right fucked.

Because it is gone.  All gone.  Undo does nothing.  Hitting the Back button does nothing.  Closing the post and reopening does nothing.  Frantics searches bring up nothing that can bring it back.  Why don't I just revert to an earlier draft?  Because there is no revert to a previous draft.

What the fuck Blogger?  Is a working undo something that is really that hard?  Really???  Why can't I revert to an earlier draft?  Why didn't the Undo work?  I am not the only one complaining.  There are many more who have suffered this problem.  And tell me, why do you sit there with your thumb up your ass and not respond to your users?  It goes on an on and on.  You could always do a Google Search to see how pissed off people are. Are you too blind to realize that the best workaround being suggested is to use Windows Live Writer as an editor?  Even with that I am still up shit creek because I use Linux.

So fix this.  Fix it now.  And then how about a basic table editor, for chrissake.

Thursday, January 12, 2012

Happy Birthday to My Best Friend

This blog tends to cover a lot of ground: from landscaping to food to hacking.  Some stuff is pure technical geekery, while other stuff is more personal.  This blog entry will be some of the latter.

It has been said many times that man's best friend is his dog.  Here is mine.  Her name is Abby and she is indeed my best friend.
Say Hello to Abby
I write this on a special day as it is Abby's 11th birthday.  Her mother was a purebred Chesapeake Bay Retriever and her father was a German Shepherd that happened to be nosing about at the right time.  Abby was an accident, but a happy accident.  Happy Accident #1.

My Lovely Wife and I were new in town, and we were about to move into our new home on an acreage in a week.  She was phoning around for alarm systems when someone told her that she'd just be better off with a big dog given our remote location.  Our friend gave us directions to a pet store, but since we didn't know the city, we went to the wrong place.  Happy Accident #2.

It was very much love at first site, despite knowing nothing about her breed.  We looked it up in one of the books at the pet store and it described Chesapeakes as "large, solid dogs".  Indeed, she weighed 18lbs at eight weeks of age.  We didn't know it then, but the size of her knees were a giveaway that she would someday fit the advice given to us by the alarm system salesperson.

We took her home a week later.  Our new home was about a half hour drive away from the store.  We were within a quarter mile of the new place before she turned her head towards me and threw up all over my jacket.  Happy Accident #3.

Over the years, Abby would grow out of her car sickness and grow in to her knees, tipping the scales around 82 lbs at one point.  We brought her with us when we picked up and drove 2000 miles to our current home around eight years ago.  One of the prerequisites in picking our new home was some place that would be dog friendly.  Chesapeake's were bred to retrieve game fowl from the icy waters of the Chesapeake Bay on the U.S. East Coast, and when a nice place right on the river came along... well...
Less Icy In the Summer
Our home on the river means we have lots of wildlife wandering by, and then fleeing for their life once Abby catches wind of them.  The trails we maintain through the forest alongside the river's edge makes walking the dog a joy, not a chore.  My Lovely Wife's "job" is to keep the home fire's burning while I am at work, and they enjoy several beautiful walks each day.  The two are inseparable.
Abby On Bush Trail Patrol
Fortunately for us, we don't have to worry too much when Abby tears after some critter like a bat out of hell.  She is big enough and strong enough that she can handle herself for the most part.  For the most part.  Abby likes to act first and think about questions later.  A good question to ask up front might have been "Should I really go after that porcupine?  Again?"
Not Such A Good Idea, As It Turned Out
Another Chesapeake behavior that Abby features is a certain stubbornness. Strangely, this feature is not mentioned in books that encourage people to get a Chesapeake.  She listens to us when she wants to.  At times this is maddening; at other times, hilarious.  But it gives her an unpredictable nature to her character that makes Abby the dog she is, and I'm not sure I'd want her to be any different.  I like to think of it as selective understanding.

While she has many Chesapeake qualities, her German Shepherd side comes through in several ways as well.  The coloring around her muzzle is one obvious spot, but another one a little less obvious is the Shepherd instinct to always walk a little bit ahead and lead the way.  This has an interesting side effect: she is in every picture we have ever taken.
Abby Hamming It Up... Always
Abby's many interesting qualities and the environment she lives in have combined to give an endless stream of wonderful stories over the past eleven years.  Since it takes a long time to type in an endless stream of wonderful stories, I'll pick three favorites.

Story #1: A year after we got Abby, we had a visit from some friends whose daughter was maybe a year old at the time.  She was just getting good at walking but was not yet at the point where she could build a lot of speed.  Somehow, this little girl quickly built a connection with a dog that was much taller than she was and many times her weight.  The little girl would toddle out from the kitchen table to the living room with Abby walking slowly behind.  They would switch around at the coffee table in the living room so that Abby walked in front on the way back to the kitchen with the little girl following behind.  They did this once or twice before anybody really realized what was going on.  It was one of the most amazing things I've ever seen.

Story #2: My Lovely Wife plugged a kettle in before heading upstairs to take a shower.  Abby started barking soon after.   My Lovely Wife yelled at her to stop but Abby keeps at it.  Finally, My Lovely Wife heads back downstairs to see what all the barking is about before starting her shower.  It turns out that the cord on the kettle was shorting out and the kettle's base was starting to smoke and melt down.  My Lovely Wife was able to unplug it before any serious damage was done.  Abby just might have saved our house from catching fire and burning down.

Story #3: Not that long ago, a group of people came in to our yard to sell us some religion.  They rang the front doorbell and Abby went crazy.  My Lovely Wife mistakenly answered the side door.  She was busy and didn't have much patience for what she knew this crew was here to do.  She was holding Abby by the collar at the side doorstep as Abby was working hard to pull away.
Them [nervously]: "My!  HE's a big one!  I hope HE isn't hungry!"  [Abby gets called a HE all the time because of her size].
Abby decided to answer the only way she could, and she did so with the timing of Bob Hope.
Abby: BEEEELLLLCCCCCCCCHHHHHHHH.
Them: "Oh, I can see you are busy.  We best get going now."
And they drove the hell out of our yard at high speed.

I think you get the idea.  My Lovely Wife and I believe that Abby is a very special dog and we love her will all our hearts.  She has certainly slowed down over the years, and I know she won't last forever.  But neither will I.  That is why Abby's will bequeaths everything she owns to me, and why my will bequeaths everything I own to her.  Until that fateful day comes to pass, I cherish every day with her.  Every single day.  And that is no accident.

Happy Birthday Abby, and many more.

--------------

P.S.  If you'd like to know more about Abby, My Lovely Wife keeps a diary of her various adventures here on Dogster.  There you'll find many more stories and pictures that will be sure to get a laugh.  Skip anything related to garter snakes if you are squeamish.

Sunday, January 8, 2012

Troubles with IM-ME and the GoodFET

I have been spending some time recently with my IM-ME Pretty Pink Pager and my GoodFET.  Most of this time has been unproductive, unfortunately.  I think I might finally have sorted out all the issues causing this, and I'm using this post as an opportunity to record it all so I know what to do next time, if there is a next time.  This is all running under Linux: your mileage will vary under another OS.

I came across my first hurdle some months ago.  Commands like this:
goodfet.bsl --fromweb
goodfet.monitor test
would give me this:
Resyncing
Resyncing
Resyncing
These messages would spit out every couple of seconds.  Now these commands don't require any kind of connection from the GoodFET to the IM-ME: the messages indicate that the laptop and my GoodFET can't communicate.  After much pulling out of hair (made more painful with the fact that my head is shaved), I discovered that my GoodFET PCB had two bad vias.  Unfortunately, these vias were under the processor, and the processor is surface mounted to the PCB.  It took some tricky soldering, but I was able to patch around these vias and get back in business.  However, it seems I needed to use the --slow parameter to goodfet.bsl to get it to work.  Whatever, I was happy.
Tricky Soldering
Then over the Christmas break, I broke out the IM-ME and the GoodFET in the hopes of getting something productive done.  No way.
Resyncing
Resyncing
Resyncing
This would again spit out once every couple of seconds despite the fact everything seemed to be working well the last time I'd left it.  More hair pulling ensued.  Nothing would work.  In a fit of desperation, I went back to an older version of the GoodFET client that I had on my laptop.

It worked perfectly.

I'm not sure why (maybe this?), and right now I don't care.  But a fairly recent version of the GoodFET client software was totally broken for me.  The client dating back to Feb 26th 2011 works great.  And I just checked out the lastest SVN version of the GoodFET code and that is worked great as well.  Just my luck.

So everything is working.  Fantastic.  I sit down at my laptop this afternoon to see if I can get something productive done once again.
Resyncing
Resyncing
Resyncing
Argh!  This time the messages were flooding across my terminal window.  Last time, they were separated by a second or two.  This seemed to be more an issue on the laptop side than the GoodFET.  I had noted that the laptop had been put to sleep since it was last working.  "Simple enough", thought I.  Something wasn't being handled coming out of sleep and all I needed to do was unplug the GoodFET's USB connection and plug it back in again.  No luck.  Taking the batteries out of the IM-ME while unplugged from USB either didn't help.  Restarting the laptop fixed the problem, but the problem would come back every time coming out of sleep.  A bit of Googling and I came across a blog post from years ago that discussed a fix for a similar problem for stuck USB memory sticks.  That particular trick didn't work for me, but this one does.  As root:
# modprobe -vr ftdi_sio
# modprobe -v ftdi_sio
The ftdi module is responsible for communicating with the USB to Serial chip (FTDI FT232RL) on the GoodFET.  Apparently, the ftdi driver has a sleep problem of some kind.  Removing and re-inserting the ftdi module sorts things out.  This is with the 3.1 Linux kernel, BTW.  Hopefully this gets fixed sometime.

I noticed that the Feb 26th version of the GoodFET client software would flood the screen with Resyncing messages after the laptop came out of sleep, but the latest version of the software does the usual message every second or two.   Dunno why this is.  Either way, the modprobe dance above fixes either version.

Finally, if you see something like this:
[dk@laptop client]$ goodfet.cc info
  File "/usr/local/bin/goodfet.cc", line 22
    print "# %s" %s;
               ^
SyntaxError: invalid syntax
then you are getting burned by Python versions.  Distributions like Arch Linux default to Python3, but the GoodFET client assumes Python2.  To fix this, edit the first line of the various GoodFET scripts you use from this:
#!/usr/bin/env python
to this:
#!/usr/bin/env python2
and you'll be good to go.

Now to get something useful done...

ADDENDUM: So just after posting this, what did I get?  You guessed it..
Resyncing
Resyncing
Resyncing
The only thing I changed this time was the USB cable.  I went from a longer, more flexible cable with a choke at the end to a shorter, stiffer cable with no choke.  Operation with this shorter, cheaper cable is definitely unreliable.  Moral of the story: try a different cable if all else fails.