Moneyball and Software Development

I really enjoyed the book Moneyball.  I didn’t enjoy the movie as much.  The pacing seemed off and Brad Pitt seemed like a bad choice for the lead.  There also seemed to be this intense desire to inject drama and controversy into the film’s plot which was ironic when the point of the book is exploring a purely rational approach to a very subjectively emotional game.

Read the book, watch the movie.  The question that many will ask following experiencing either is “How could economic theory apply to my profession?”  I’d like to spend a few minutes thinking through some Moneyball implications with regards to Software Development.

fashion driven

Talent vs Grit

hired at enty level

flame out

amazing programmers start their own companies or are never heard from

Maybe more than any other profession, software development is impossible to “game”.  In other words, good programmers really are good, and you don’t see guys who don’t do a good job churning out software that works.  Yes, it is possible to have some sort of awful application made by crappy programmers, but eventually you’re going to have to pay the piper and address the technical debt you’ve been accumulating. 

PHP Sucks!

Software development is a remarkably fashion driven industry.  I’m definitely guilty of the default “newer is better” mindset that many technologists have, but one of the more bizarre fashion statements I hear constantly nowadays is “Oh, I mean, you know how PHP sucks.”

I hear it at conferences, from developers old and young, in companies large and small.  Modern languages like Python and Ruby are better designed, maybe have cleaner syntax, have a few features that PHP does not, maybe even better library support, and they’ve got Rails and Django.   It’s natural to conclude that PHP Sucks!

A few years ago when we started incorporating Ruby into our platform, this gospel was so well ingrained that when we found that long-running scripts chewed up a lot of memory we blamed PHP.  Because it sucked!  People were actually rewriting scripts into Ruby because they could run for a day without running memory, until someone noticed that there was a leak in our internally built database abstraction layer (wich Ruby didn’t use), fixed it, and made PHP suddenly so much better.

But when I talk to developers and hear that statement, I like to drill in on why they think PHP sucks and here are the common reasons, in no particular order:

  • We use PHP it at work and there’s so much legacy garbage code.
  • PHP encourages bad programming.
  • PHP doesn’t have the developer mindshare that Ruby enjoys.
  • All the best companies use Python/Ruby.

PHP is older.  It has a good 5-6 years on Python and Ruby and that includes an incredible amount of growth for the web.  It was heavily used prior to frameworks and Ajax and Web2.0 and standards around TDD for the web.  Legacy garbage code is not the fault of the language, it’s the fault of the developer.

PHP does not encourage bad programming.  Bad programmers or bad organizations encourage bad porgramming.  Blaming PHP for our lack of discipline is setting everyone up for failure the second time around with a different language.  I’ve seen just as much bad Ruby code as PHP, it’s just there’s usually less of it because there’s only been a few years for the Ruby stuff to accumulate.

PHP doesn’t have the same developer mindshare on the cutting edge, at least as far as I can tell, and there is some merit to the idea of using what is being progressed, but there are good PHP alternatives to a lot of the key cutting edge Ruby or Python projects.  Looking for a good framework?  Check out Symfony2.  Behavior Driven Design guys should check out Behat.  Heroku and several others now support PHP.  My guess is that “new car smell” of a new framework and new project is what people are really after.  Spin up a new project on PHP and use some of its modern conveniences and see if you agree.

Many good companies use Ruby or Python, many use PHP.  Here’s a company defending its use of PHP a year ago.  There are still more lines of PHP code out there in some really great products written in PHP.

Bottom line: PHP doesn’t suck.  Guns don’t kill people and neither does PHP.  I’m not saying that Ruby and Python and PHP are all equivalent, but I am saying lets put down the fashion statements and really say what we mean.  Without truly understanding our reasons behind language choice, we’re doomed to make really stupid mistakes like the anecdote above, and faulty decision making processes that hide true requirements produce bad decisions.

I also like trying new things.  My last two projects were a Rails and Django project.  But when asked why I was using them, I said “to learn” not “PHP Sucks!”  

 

A Guide to Walt Disney World – Tickets and the Magic Kingdom

I wasn’t a big Disney buff until I met my wife.  She loves Disney, because, as she likes to remind me in that tone that only self-evident-truths-that-I-have somehow missed deserve, “It’s the happiest celebration on earth!”  At first, I got a kick out of going to Disney because she did, now we both enjoy going and usually manage 2-3 days a year.  This is our unofficial guide to the parks. Tickets Disney tickets are expensive, and it’s very difficult to get a good deal.  Your options are generally speaking the following:

  • Florida Residents: If you’re a Florida resident, you can purchase tickets at a discount with your valid Florida drivers license.  These are non transferable, and Disney fingerprints you to avoid the “have my Florida friend go one day then I’ll go”.  The discounts are very very attractive and if you pay attention they’ll run specials that have restrictions (certain days blacked out, etc.) which will let you get down to roughly 40 bucks a day if you buy a 3 or 4 day pass.  This is the best deal you’ll ever manage.  Note that most multi-day passes (but not all) can be upgraded within six months of your first visit to a year-long annual pass for the difference between what you paid and the annual pass rate.  This is another really good deal if you plan to go often.  Rule of thumb – if you’re going to go more than 5 days in a year, get the annual pass because it includes free parking, which saves you 10 bucks a day.
  • Out of Staters: You have a lot less options.  Generally speaking, you’re going to pay full price, unless you can wrangle some sort of amazing package deal, but beware, these tend to not be the greatest deals once you analyze it.

Scam Options: There are plenty of scam options available:

  • Timeshares: These involve sitting through a timeshare presentation (usually with two friends you’ve brought along) for 2 hours and result in theme park tickets and a room or two for a night.  This is OK if you’re sure you can say no, but they make us nervous because you usually have to prepay a hundred bucks or so that will get refunded upon viewing the presentation.
  • Tickets for some other presentation: See above. Same deal and same risks usually.
  • Get a Florida ID to unlock the Resident Discount: These services will help you get a Florida ID card, but are often defeated by the fingerprinting that Disney does and it’s illegal – a serious felony if you’re caught.

Legitimate Discount Options

  • Triple A (AAA) – They have a discount.  Use it.
  • Military Families – Another nice discount if you’re eligible.

The Bottom Line on Tickets

Disney is expensive, but here’s the thing – you’re going to spend as much money inside the park if you’re not careful as you did on tickets.  Seriously.  Many find that the ultimate costs of food, drinks, parking, souvenirs, aren’t closely scrutinized while they’re there and add up to being way more than the actual park entry fees.  Our advice would be to focus on cost control in those areas and just bite the bullet on the tickets.

Controlling Costs Inside

Disney allows you to bring food and beverages into the park.  I’m not sure about alcoholic beverages, but for sure you could sneak them in if that’s important to you.  We believe that eating as we walk around the park is one of the best things about Disney, but if you’re watching your diet and trying to cut your costs, bring sandwiches and some bottles for water is the way to go.  We see a lot of people with CamelBaks on throughout the park and if you stock it with enough ice, a Camelbak should last you most of the day. Don’t forget sunscreen – the stuff they sell inside the park is very expensive – $20 for a bottle, and you don’t have a choice on this item.

Hotels

We would advise not staying on property hotels.  They are really expensive compared to other options out there.  Hotwire and Priceline are your friend, but beware of the fact that there are a LOT of older hotels in the Orland/Disney area that are run down.  We recommend Priceline since you can read reviews on the properties you’re thinking about staying at before you pull the trigger, but we’ve had no real issues with Hotwire.  You can generally find accommodations that are decent in the 80 dollar per night range.  Many hotels have a resort fee or parking fee each day that’s tacked on so keep that in mind when you’re looking.  Many hotels also provide a shuttle which will save you the $10 a day parking fee at each park.

Times to Visit

We’ve been in the spring, summer, fall, and winter and even though we had a great visit in late April, it was a little skewed because it was during a weekday.  The Wife insists that January is the best time to go both for temperature and crowd control reasons, and of course, if it’s during the school year try to go on a weekday.

Fast Passes

The fast pass has revolutionized Disney and its infamous lines.  These are your life savers.  The way it works is each ticket gives you a token that lets you cut in line between a certain timeframe in the future.  This time increments throughout the day until about mid afternoon most fast pass machines shut off.  We recommend a strategy of hitting the popular rides early.  In other words, if you want to hit Space Mountain (one of the longest waits in the Magic Kingdom) immediately make a bee-line to that ride as soon as you enter the park, and get your fast pass.  That will give you a relatively early time say between noon and 1:30PM, then once you’re done you can Fast Pass your number two selection.  This will save you up to 2-3 hours of standing in line.

Line Monitoring Applications

You should also download an app for your phone that gives you wait times for each ride.  I use WDW waits and WDW maps – they’re free and seem to work OK.  They allow you to input wait times and see wait times reported by others across the park so you can monitor your hitlist during the day and “sneak” into rides that have their wait times temporarily drop.  We’ve used this to snipe a ride with “no wait” that was close to us several times and it’s remarkable how much wait times can fluctuate throughout the day.

The Magic Kingdom

This is the smallest of the parks, believe it or not, and also the busiest.  Expect the highest percentage of kids and stroller-jams.  We’ve found that even though most kids annoy us (we have no kids) one of the best things about the Magic Kingdom is to watch kids freaking out with excitement on the way into the park and during the day, and to spot meltdowns that occur when they get tired.  If you’re lucky, the parent will also melt down and we take sadistic pleasure in witnessing this.

Here are the absolute must-see rides:

  • Space Mountain – a fast, chaotic, clackety ride that’s world famous because it’s in the dark.  This is our first fast pass of the day always.
  • Monster’s Inc. Laugh Factory – this is probably the best, more underrated ride in the entire park.  I can’t say enough good things about this show.  Essentially, it’s a standup comedy routine performed by actors who voice and control the expressions of animated Monsters on the screen in front of you.  You can submit jokes, the audience participates, and no two shows are the same (jokes and gags differ).  This is an unbelievably creative ride and if you liked the movie, it’s a slam dunk.
  • Thunder Mountain Railroad – this may be a “kiddie coaster” but it’s a fun one with awesome theming.  The ride is fun and feels chaotic enough to be exciting.  Try to get a seat in the back cart.  This is always our second fast pass of the day.

Things we Enjoy

  • Tea Cups – This is another ostensibly kid ride that can be had in any park, but we attempt to spin as fast as possible and it’s a relatively short wait.  If you do this right, you can usually be so loopy you’re close to falling down at the end of the ride.
  • Pirates of the Caribbean – this ride closed for an overhaul that lasted quite awhile but really only saw them insert a few Captain Jack Sparrow figures into the ride.  It’s the same as it ever was, and that’s generally a good thing.  It’s got a covered line which gets you out of the heat and we generally use this line to eat a snack since it moves pretty well (usually not more than 40 minutes).
  • Train Ride – we use the train to get around the park a lot since the Toon Town and Frontierland stations are well positioned to save you walking through the chaos of the middle of the park. Note – currently Disney is completely renovating/rebuilding/expanding the Fantasyland part of the park which means the Toon Town station is closed which really limits the train’s usefulness.  This should reopen in 2012.
  • Haunted Mansion – we like this ride because it seems to exemplify the old-school haunted house theme and has a very creatively themed line with funny tombstones, etc.  This is probably not a good idea for young kids.  Bonus – every time we’ve ever been on the ride it has paused or broken down for a few minutes and a voice comes on that advises you to stay inside your “Doom Buggy”.  For us, this is the best part.
  • The People Mover – a good way to rest your legs and relax.  Nothing earth shattering here.

Things We Hate

  • The Hall of Presidents – Yes, I get this is a classic, but it sucks.  Although it is air conditioned and the wait is short, the problem is you’ll be tempted to fall asleep during it if you pop in during the middle of your day.
  • The Lilo and Stitch Ride – Easily the worst ride in the park.  It’s a bizarre ride, but it makes a little more sense when we learned that it was originally an Aliens themed ride that got retooled.  It’s horrible horrible horrible.  A complete waste of time.
  • Small World – insane lines and that horrid song.
  • Country Bear Jamboree – we thought we liked it as we had fond memories of this line, then we recently went to it and it ruined the memories for all time.

Food Guide

  • Giant Smoked Turkey Leg – the single best food offering in the park.  These can be found in Frontier Land in a cart right by the river.  If you’re on a high protein diet / low carb diet, this is essentially your only option, but who cares?  The meat is actually not turkey but Emu and it’s awesome.  Make sure you bring dental floss if you’re going to eat one of these – the meat tends to get stuck in your teeth and you can’t buy it anywhere within the park.
  • Cotton Candy – The Wife loves this.  You can get it on Main Street and also in Frontierland.
  • Pineapple Soft Serve Float / Coke Float / Pineapple Ice Cream – my favorite dessert, can be found in Adventureland near the Pirates of the Caribbean.
  • Taco Salad – find these in the food court opposite the Pirates of the Caribbean.
  • Jelly Bellies – these are insanely expensive but they’re inside the general store in Frontierland along with the Cotton Candy and Aunt Selma’s massive cookies, which are really good.

Other Items We Enjoy

  • There is a glass blower shop on Main Street on the right side when the train station is at your back.  Inside there are artisans that are shaping glass items and we’ve also seen them blowing glass to make goblets and other large items.  This is a lot of fun to observe.
  • The camels in Adventure Land spit water on you when you walk by.
  • The parades are always entertaining to watch, and even more fun to watch kids freaking out as their favorite characters walk by.  Protip: monitor line times closely during parades to hit a few rides while the parade soaks up large crowds.

More Easy Fun With Telephony

Recently I decided I needed a little more flexibility with my phone situation.  Years ago I was carrying two cell phones and had three Vonage lines while running my own business.  This got consolidated down to a single iPhone, but that can be a little problematic particularly if you’re calling to/from international numbers.  This week I ported my iPhone number to Google Voice (within 24 hours too), and got a new phone number for my cell that I’m hoping to keep private and function as a throwaway.  However, I needed a bit more flexibility on some of the things I wanted to do, so I threw Tropo into the mix.  Twilio lost out because Tropo provides free inbound and outbound calling.So here’s the path when you call my number:  call comes into Google Voice, which forwards the call to my Tropo application, which then plays a menu and you can either punch out to Sentry’s main number or continue to ring my cell.  Text messages are forwarded by Google Voice, and the net result is that for inbound calls, I’ve effectively decoupled the phone number I’ve had for seven years from any handset or location and added a whole bunch of flexibility.It’s almost eerie how much power Tropo gives you over your telecom setup.  With a few lines of code I can transfer calls, accept inbound international calls with a local number, kick out text messages, provide a menu, have their computer voice speak any text I want, etc.  Call quality is crystal clear through both Google and Tropo, and I have yet to have any reliability problems.  In 2004 we thought it was amazing replacing a 150k Avaya PBX with Asterisk, but this is replacing all of that with about twenty lines of code.  For free.  With no setup or ongoing hardware or maintenance costs.I’d say the only real drawback to the situation is the inability to spoof outbound caller id with native dialing – it would be interesting to see if Apple allows you too hook other providers into it’s native dialer (yeah right) or if this is a feature within Android.  It definitely needs to be implemented at some point – and then we’d have true telecom nirvana.

High Speed Passenger Rail for America: Thanks But No Thanks

Most of you know that I really like trains.  Model railroading is a hobby of mine, and I grew up consistently riding trains in China as alternative transport options either didn’t exist or were really unsafe (read: 80’s era Chinese airlines).  We generally travel by train in Europe when we visit.  However, most people are usually surprised that I don’t support any plans for high speed rail in the US and don’t envy the extensive passenger networks that exist overseas.Passenger service requires the presence of several factors which are almost never available in the United States:

  • Relatively short distances (less than 4 hours).
  • High population density.
  • Good local public transport one you’ve reached your destination.
  • High schedule density (a lot of trains providing lots of schedule options).

Passenger rail is incredibly expensive to operate by itself even with the presence of those four factors.  The last requirement of sufficient schedule density imposes a lot of constraints on the rail network that aren’t readily apparent to observers too.  As an example, The Wife and I often choose to ride the Amtrak from South Florida to Orlando instead of making the drive.  It’s more expensive at roughly 100 bucks for both of us round trip compared with a tank of gas at 40 bucks, but the 27 dollar toll for the turnpike makes things a little closer.  It’s roughly an hour longer too, but it’s nice to be able to read or watch movies on the train instead of driving.  Most importantly, and what prevents us from using it a lot more is the schedule: you can depart at 9:30 AM from South Florida, or 1:30PM from Orlando, and that’s it.  Compare this to Europe where most cities have an hourly service and you can see the difference.  There are several points in this little anecdote: the schedule, the cost, the need for pickup upon arrival in Orlando (thanks Sara’s family!) and the time all conspire to eliminate huge swaths of potential customers.A more insidious issue: once you’re at sufficient schedule density, you basically invalidate your rail network for freight traffic.  Here’s something you may not have known: the United States has the world’s most efficient railway system (See here, and here: the US enjoys the cheapest freight rates in the world).  This is because it’s entirely freight based which allows the railroads to maximize what trains are really good at: moving huge amount of cargo extremely cheaply and efficiently.  Adding in passenger traffic (particularly dense traffic) with its priority trains would essentially destroy the efficiency we have or require incredibly expensive infrastructure investments.  Even with those investments it’s generally not feasible to run freight and intense passenger service on the same trackage.  Most freight in Europe travels by truck in case you didn’t know.Passenger rail, even where it’s “successful” in Europe and Asia is still a chronic money loser requiring subsidy support.  In a wholly unsurprising development, China’s extensive new (and darling of the media) high speed passenger network is essentially insolvent.  This is the ideal which Friedman and other breathless watchers of China and India have been prescribing for the United States for years.  Says Chinese professor Zhao Jian:

“In China, we will have a debt crisis — a high-speed rail debt crisis,” he said. “I think it is more serious than your subprime mortgage crisis. You can always leave a house or use it. The rail system is there. It’s a burden. You must operate the rail system, and when you operate it, the cost is very high.”

I’d rather have the railroad system the US currently has, thank you very much.  A privately funded, operated, and most importantly, wildly efficient transportation system that’s designed to move big bulky stuff.  As gas prices fluctuate and we continue to import a huge percentage of our manufactured goods, we’re sitting pretty.

The Impending Ad War

A few weeks ago I attended Github’s CodeConf in San Francisco.  While there, I got to meet quite a few really accomplished technologists (hackers) and discuss a variety of projects, processes, programming methods and more.  One of the most interesting moments for me came over lunch while talking to the CTO of a very well known blog which clocks in over 5 million unique visitors a month.  Like most sites of its type, it receives almost 100% of its revenue from ads.  According to him, one of the largest (new) challenges they were facing was that advertisers are beginning to buy ads targeting the blog’s fans from Facebook, not the blog itself.  In other words, to get at the blog’s users, advertisers were paying Facebook less money to directly market to the blog’s fans on Facebook.The more I think about it, the more I think this is a major problem for almost every ad supported site out there, and it could be the pitch that Facebook is using to bolster its insane valuations.  Right now, there are probably no less than a dozen Googlers being kept up at night worrying over this very problem, not to mention the admen at hundreds of highly trafficked blogs and other internet properties.  After all, if I can immediately pitch my competing product to your customers without paying you a dime, I’ve got a huge advantage, you’ve got a huge problem, and Facebook has an unbelievably great strategic position.Maybe you’re reading this and thinking “yeah that’s old news” and it probably is to many, but having never worked at an ad supported organization, I’d certainly never thought about it before.  I’ve also never heard it articulated online, and I’m wondering how many organizations even realize this is happening.  Note there is a two-fold risk here: ad supported properties risk losing ad revenue to Facebook, and they risk exposing their customers to competition.  If you’re an advertiser, you’d much rather know that you’re reaching out to all 10,000 fans of Blog X with the stats to show you who clicked, etc., vs. an anonymous 100,000 impressions.  Note that even if a Blog chose not to have a Facebook page to attempt to combat this kind of thing, Facebook can still harvest those users who “like” the Blog in their profile.Before, I used to think that the benefits of a Facebook presence for an organization outweighed the downsides, but now I’m not so sure, particularly for ad-supported businesses.  It’ll be interesting to see how this plays out.

Open the Gate!

The last three places we’ve lived in South Florida were “gated communities” which is supposed to make you feel exclusive and special.  They provide zero additional security (had a car stolen from one of them in the middle of the night) are often broken, and even when they work they’re a pain.  All of our gated communities would link your personal code to a phone number of yours, and when visitors keyed in “112” it would ring your phone.This causes problems:

  • The gate dialer can only link to one phone.  If your wife is traveling and you want some pizza to be delivered, the wife may not be able to pickup the phone and press 6 to let the pizza in.
  • Most can only link to one or two area codes.  One of the systems could only link to a 954 area code number.
  • If you’re riding with someone else and don’t have your remote with you, you can’t get in if your wife isn’t with you, or has the cell phone in a bag in your trunk.

The Wife has been out of town for a few days and this finally irritated me to the point where I headed over to Tropo.com and provisioned a simple phone application.  Now when you dial the phone number of my Tropo app, it answers, says “Opening the Gate!” and plays a number 6 key press which tells the gate to open.  Perfect.I heard about Tropo out at CodeConf in San Francisco and have wanted to play with it but didn’t have a problem to solve until now.  The entire thing took about 10 minutes to setup with the only really painful thing being the hunting down of a key press sound from http://www.freesound.org/ and the subsequent conversion to a GSM format.  I ended up using the excellent Sox command line sound converter to make the conversion, and then we’re in business.  Total cost for the whole thing was zero dollars.The Tropo service is really nice and their documentation is good too.  Their UI for their website is a little clunky in spots.  For example, picking an area code for your number is really painful with about 50 city suggestions and no way to search for an area code or specific city.  They’re not alphabetized as far as I can tell either and the city names are super specific so it just makes it hard.  Also, I couldn’t find a way in their API to generate a key press tone which meant I had to mess with my own sound files.  That should be built right in or they should provision a directory of key press sounds with your default files.All in all a fun little project to get done while on Amtrak bound for Orlando, and now I can open my gate whenever I want.  Tropo has done a great job with their platform and I’d highly recommend it for these types of tools or any kind of telephony or communications application.

Does China’s Autocratic Government Provide an Economic Advantage?

It’s a question you often see timidly asked, in an almost guilty fashion.  Don’t you think, just maybe, setting aside all of its problems and just focusing on the economic question, that China’s government gives it an advantage over our messy democratic republic? Liberals in the United States are often criticized for their breathless infatuation with technology, intelligence, education, and a belief that top-down government inspired projects and policies are the main way to affect lasting and dramatic changes within society.  They point to examples including the Transcontinental Railroad, New Deal’s Tennessee Valley Authority, the Apollo Project,  and the impact that DARPA and other government funding had on the internet.

No one today cheerleads the economic advantages of China’s autocratic government more than Thomas Freidman, author of The World is Flat, and Hot, Flat and Crowded. Reading these books is to experience a breathless optimism that surrounds India, China, and other developing countries as he examines their education systems, massive economic investments in infrastructure, and the desire of their citizens to compete in a global economy.  No country receives quite as much praise as China, however, and the message both implicit and explicit throughout his columns and books is that this is all a product of a single-minded focus from a strong central government that’s dedicated to improving the lives of its citizens.

Are We Losing Our Edge to China?

China watchers (both admiring and fearing) can usually list off the following in quick abandon: China has the world’s second largest and second busiest airport, the fastest train, the fastest computer, the largest dam, and is using most of the world’s concrete (PDF).  There are other impressive economic stats as China is now the world’s largest exporter, makes the most cars, and has the world’s second largest economy.  The Chinese people and Chinese government relish statistics, particularly those that point out how they’re the best, and they have a flair for announcing large projects like the construction and logistical integration of several cities into the world’s largest mega-city that leave foreign observers stunned at the sheer scope of such projects.  If you read the previously linked Telegraph article, you can clearly see in your mind’s eye a vision of editors going back to each number and checking that they have the right number of zeros, all while softly cursing to themselves at the absurd size and scale involved.

Lets Look at Real Statistics

But for all of the admiration, large projects, and grandiose announcements, Friedman and others tend to forget a simple fact: China and India are still by any standard exceedingly poor.  Equating scale of projects without taking into account relative size is just, well, stupid.  Of course China and India should have the largest of everything – they have the largest populations.  The public works that everyone salivates over are all driven by the monumental sized populations that each country is responsible for.  People forget that China is still the 95th poorest country in the world when ranking by per-capita GDP.  Lest we become guilty of not adjusting for relative purchasing power (in other words, everything’s cheaper in China so you can earn less but still feel richer), when we look at their per capita GDP adjusted by Purchasing Power Parity, China climbs two spots to number 93.  These are imperfect estimates, but are directionally correct, and are prepared every year by the International Monetary Fund.  The United States, by contrast, is in the top ten for both measurements, with none of the countries besting the United States having a population of over fifteen million.

Can We Really Know the Effects of Communism on China?

Note that these bad (both absolutely and relatively speaking) individual economic indicators are despite nearly thirty years of constant economic growth, many of these years being close to ten percent or greater.  Not exactly the picture that tends to be painted, is it?  The point is this – there are two words that accurately describe China’s current economic progress: catch up. Decades of autocratic rule, political unrest, warfare (China was continuously at war from 1927 through 1950) have actually intensely harmed the country and its economic prospects.  In fact, these are often pointed to by outsiders (and even some Chinese) as reasons to why China is currently lou hou or backward.  

However, there is a decent control scenario that we can use to contrast with the current Chinese economy: Taiwan.  Both countries were founded the same year, 1949.  Both had participated in the ravages of civil war.  It can be argued that Taiwan may have left the mainland with some economic advantages: the best and the brightest, and possibly more administrative experience, but that case seems hard to make due to how poorly they had previously run the mainland.  They also left with China’s gold reserves, but the mainland received economic aid from the Soviet Union the first decade of its existence, and if the economic development stats were at all close it might be relevant.  In any event, Taiwan, having always pursued a free market with limited government interventions is today is one of the world’s strongest economies and near the top of the lists we just ran for the United States and China.  In other words, historically, China’s autocratic government has been nothing but a hindrance.

Today we are told, that all has changed.  China’s embrace of new economic policies (and priorities) is the new paradigm: that of the state guiding the economy along long term goals, inspiring its citizens with great public works while simultaneously providing a stimulus to the economy as a kind of dual pronged weapon of economic good.  This is contrasted against the herky-jerky, short sighted, messy and error prone proclivities of democratically elected governments that are so obviously wrong. However, when you really stop to consider this, it’s extremely puzzling.  We’re essentially saying that the element that prevented China’s economic growth for thirty years (a planned economy) is now it’s key advantage when competing globally.  

Keep in mind that when people decry the fact that the free market hasn’t arrived with something, they’re generally pushing an agenda that is economically incompatible with reality.  Friedman and friends are pushing carbon reduction due to a belief in global warming.  Others push social agendas for things like public housing.  Still more push redistribution of wealth for the betterment of the working and lower classes.  While we can debate the merits of these agendas, the reality is that if they were economically viable, someone would have found a way to monetize them. Here’s the general conclusion (to be followed I’m sure by a few more posts on this topic): it’s easy to make double digit gains when you’re in last place.   It’s also easy to cherry pick smart development deals when your whole country is undeveloped or underdeveloped.  In a hyper complex, massive economy like the United States that also happens to be very diverse, this type of top-down management is practically impossible.  China makes their share of stupid investments too, we just tend to not hear about them.

Jeopardy and Watson

We had a great time last night watching Watson take on two humans in a round of Jeopardy.  Or at least, I had a great time.  The wife and her sister weren’t quite as into it as I was, but they watched it just the same.Here’s a recap:

  • The show did a great job explaining what was happening (they burned half the episode on explanations).
  • It’s interesting how most people don’t understand what the true challenge of this event is (even techies) – Watson has huge volumes of information (he knows a lot of stuff), but the real challenge is understanding the meaning behind a question.  In other words, it’s an understanding/comprehension challenge, not a fact challenge.
  • IBM came up with a really neat tool that showed the audience how Watson was playing the game.  They would show the top three answers he came up with and a confidence interval.  Watson would buzz in with the highest rated answer that crossed the confidence interval.  If none of the answers made it across the threshold, he wouldn’t buzz in.
  • Alex Trebek gave a tour of the datacenter which had ten-ish racks of IBM servers.  The size of the install was very surprising to our non-technical viewers.
  • Watson glows green when he’s confident in his answers, and when he gets one wrong, he glows orange.  This feature was a big hit at our house.
  • Two perfect examples came to light exposing the difficulty of this challenge.  One question made references to the Harry Potter world and a dark lord who challenged him.  It was clearly a Harry Potter question due to the contextual clues, but the answer was “Lord Voldemort”.  Watson answered “Harry Potter”, but his second choice answer was “Lord Voldemort”.  A human who understood the meaning of the question would never have answered in that way.  The second occasion involved Jennings answering “the twenties” to a question, which was wrong.  Watson buzzed in right after him and answered, “the twenties,” which no human would ever do.

One question I had was if the text transfer of the questions happens in step with Alex Trebek’s reading of them.  Does it happen character by character or does Watson get a few precious seconds while humans are reading the screens?  Conspiracy theorists would probably ask how Watson’s first choice was an 800 dollar question (unusual) and he hit the daily double immediately, but it could be part of the IBM team’s strategy.All in all, that was probably the most fun I’ve had watching a TV game show.  Looking forward to the next two episodes.

Jeopardy, Artificial Intelligence, and a Chess Playing Robot

Tomorrow Jeopardy will feature a computer facing off against former champions Ken Jennings and Brad Rutter.  I have been looking forward to this for a couple of months since I first heard about it, and it is an amazing feat of computer science that a computer can go head to head with humans on a game show as complex as Jeopardy.  IBM is the true leader in feats (stunts?) such as these having staged previous competitions against former chess master Garry Kasparov.  The show has already been filmed (in a special sound stage at IBM’s location) but I do have an inkling of what the engineering team probably went through prior to the event.

Artificial Intelligence

My freshman year in college, I managed to convince my professors that I could and should skip the computer science prerequisite for everything, COS120.  This put me into a data structures course in the first semester of my freshman year, and several linked lists and b-trees later, I was able to take any class I wanted in the spring.  I made  bee-line for a class called “Intro to Artificial Intelligence” as I was more than intrigued by the possibility that I could build Skynet and cause the human race its final doom.  Sweetening the pot was a rumor circulating the labs that the class would make use of the very recently released Lego Mindstorms.  Fulfilling the dreams of nerds and lego aficionados (with there being an admittedly strong correlation between the two groups) the Mindstorms were fantastically expensive to a college kid (several hundred bucks) and required programming knowledge to really make them hum along.  This AI class in other words was my ticket to Lego Nirvana, not the other way around.

Legos and LISP

I managed to sign up for the class and was one of (I think) two freshman.  Having spent high school and the fall semester doing work in C and C++ along with learning Perl and a new fangled language called PHP, it was quite a surprise to show up for class and begin learning LISP.  For those of you who are non-techies, LISP is a complete paradigm shift from how most programming languages allow you to express yourself.  The analogy might be like going from sketching in black and white to being handed multiple colors of modeling clay and being told to sculpt in three dimensions.  LISP is the oldest programming language still used in a mainstream capacity today.  LISP treats data and the program the same, so you can build a self modifying program which is one of the reasons Artificial Intelligence researchers and applications use it so much.  LISP has a weird looking “list based” syntax (LISP stands for LISt Processor) and allows you to solve weird problems in fairly elegant ways.  In fact, some like it so much and feel it is so powerful that LISP is the reason that Paul Graham (a well respected computer scientist and technology entrepreneur) credits for his business success. He felt he was able to elegantly and more efficiently out-build his competition simply because of their language choice.  I don’t really agree with Graham, but the point is that LISP is a very cool and very different language that was a pleasure to learn.  This class remains the only one in college where I did every single homework assignment.  The problems were just too fun and the ways of solving them were extremely different. Along with LISP of course came the Legos.  Almost immediately, we began building simple Lego robots that would following a line on the floor, be able to navigate a room, follow a light source in a dark room or navigate a maze.  It was unbelievably cool and a testament to Lego’s design prowess that their system allowed for such flexibility.  Each kit provided a command unit and several motors and sensors.  There was a touch sensor, light sensor, and a few others, and the command unit would download the programs via a cable hooked into a computer.  There was a Lego provided GUI-based way you could program the processor, but hackers had already provided several other languages, and we used Not Quite C (NQC) which was very similar to the C programming language with a few restrictions.

A Chess Playing Robot

All in all, we were having a blast, and just like kids get bored with a slide and start daring each other to go down backwards, or standing up, we began competing to build a bigger better robot.  Our professor was also the chair of the department, and he sensed he had something brewing, so he got the class together and challenged us to come up with a project that could bring fame and glory to our small liberal arts university.  A robot that could get us soda from the machine!  A robot to gather up homework assignments and drive them back to the professor!  Not as popular as the food or waiter suggestions.  Finally from the back of the class came the ultimate idea: a chess playing robot!  A senior in our class had been working on an independent study in addition to taking this class, and had produced a fairly workable Chess simulator, written in LISP.  The class began buzzing with excitement.  We could build the robot, then challenge students to beat it! I started to get a bad feeling about the project – building a Lego chess playing robot would be quite the undertaking.  My good friend Aaron Williamson upped the ante – “I could get the university TV station to film a match!”  Uh oh.  A third student offered to get one of the most popular professors in the school to face off against the robot, and just like that we had ourselves our very own TV spectacle: Man vs. Machine.  Nerds vs. Normals.  Technology (us) vs. Philosophy (the professor).

The work was divided up and we immediately had to start pulling late nights as we only had a few weeks to get everything together.  There would be a vision processing team (the robot had to know where the chess pieces were), a robotics team which would build the gantry crane and arm mechanisms, and the chess software team.  The Public Relations we soon learned, would take care of itself.  I was on the vision team, and our job, we felt, was quite possibly the hardest.  This was 2000, and web cameras were novel, low resolution, expensive, and rather rare.  At least, they were expensive for college students, so we used the only one we had available: a web camera attached to a Silicon Graphics O2 workstation that provided a 640×480 resolution color picture.  It provided enough resolution so we could film the board, and our algorithm would take one picture, save it, then take another after the human moved, and compare them to determine which two pieces had moved.  This seems pretty trivial, but it was complicated by a fisheye effect from the lens, and the fact that the robot arm (or human) wouldn’t actually place the pieces very accurately. Lighting and other conditions could also change depending on where the human was standing or for a host of seemingly random factors. As we started to work, even simple things seemed to derail us.  Silicon Graphics apparently used a proprietary RGB format which was reverse of standard RGB, so we had to write a converter.  Irix, the SGI OS, turned out to be a pain to develop for, at least compared to Linux, so we performed the processing on another computer.  This meant we also had to set up the workflow between the IRIX machine which captured the image, and the Linux machine which processed the image, and then interface with the robot and the chess playing program, which ran on another machine. The date for the campus wide demonstration was looming, and we were determined to not be humiliated.  The student newspaper ran a feature, and our opponent was quoted that “no hunk of metal would best him” to the delight of the student body.  

Media_httpwwwpeebsorg_gamba

Finally, the day was upon us, and we began preparing the lecture hall which would be ground zero.  We had lots of equipment to move from our basement computer lab to the lecture hall, and as we began calibrating everything alongside the film crew which was also setting up, we noticed that the vision system wasn’t working.  At all.  It couldn’t find the edges of the board, couldn’t determine the grid, and it couldn’t see which pieces had moved.  We were in trouble – the fluorescent lighting conditions of the basement worked but the incandescent lighting and TV lighting in the lecture hall didn’t and we needed to recalibrate everything.  Working like mad we began tracking down all intensity assumptions in our program and moving pieces around until finally we got it working. The format of the competition was designed so that while the computer was thinking we’d explain to the audience what was happening, and our opponent would also discuss the philosophical ramifications of sentient machines.  This was designed for another, secret reason – if something went wrong, we wanted to be able to troubleshoot without drawing too much attention.  We had a backdoor programmed into the chess program which could reset it if there was trouble, or in the event of a catastrophic failure, we could take over and manually play out the match.  The ethical dilemma of should we tell the audience what happened if that were to come to pass was hotly debated.

The clock struck 7:15, in came the audience, and on came the red blinking lights of the video cameras.  The lecture hall was packed out, and the professor did a great job making jokes as we introduced the event and briefly explained the rules.  Our class professor could have died of happiness at that moment.  As we began the competition, the professor picked white and made the first move.  “Take THAT you cold calculating MACHINE!” he proclaimed to resounding applause from the audience.  That pissed me off.  I had been championing a feature where the robot would insult and taunt its opponent with every move, but was shouted down for not being classy enough.  We had to endure a night of insults that could have been combatted and we all admitted in hindsight that we should fought fire with fire. At first, everything looked like it was going well.  The robot was working, it could see what was happening, and the chess program was making good decisions.  We started to relax a little, and the audience was clearly intrigued as the gantry crane would slowly move to the right spot, lower its arm, then grab the piece and move it.

Then disaster struck.  Just a few moves in, our opponent performed an En Passant which while being a rather esoteric move, also has the rather interesting distinction as Wikipedia puts it, as “the only occasion in chess in which a piece captures but does not move to the square of the captured piece.” Uh oh.  Our vision system was designed to look for what changed and was looking for either a move or a capture, not a weird combination of both.  Our program chose the two best coordinates to send which caused the chess program to have the wrong board information, and we watched in horror as the gantry crane moved into the wrong position, knocking over several pieces as it vainly swiped in air to make its move. “Uh oh, Houston, LOOKS LIKE WE HAVE A PROBLEM!” yelled our opponent as the crowd roared its approval, and he immediately launched into a discussion about how pure logic will never overcome the malleability of the human mind. It was chaos as we raced to reset the board, recalibrate the vision system, and instruct the chess program of the true state of the game.  I believe we had to simply reset the game state completely, in essence telling the computer that the game had started with the board situated the way it was since it didn’t understand an En Passant.  Things were looking up as the computer managed to make a move and actually captured a pawn to the crowd’s approval.  

For the next fifteen or so moves we each took turns giving a short talk about how the robot was built, the technologies we used, and the challenges we overcame. As the evening wore on, the game developed nicely.  I’m not a chess player but I could tell that the computer was holding its own and it could already beat everyone in the class, so we were optimistic about our chances.  Still, it was roughly an hour into the game and even though I wasn’t following every move closely it was a surprise when all of a sudden the professor announced “Checkmate!”  I looked over at the board and it was indeed checkmate!  However, the computer didn’t agree.  Turns out that either during the initial setup of the board or during the insane scramble to fix our En Passant adventure, someone had incorrectly placed the King and Queen on the computer’s side.  The computer had been defending its queen instead of its king, and thus had fallen prematurely. A disappointing end to what would end up being one of the most memorable projects of my college career.  Still, we couldn’t help but feel proud of being able to build something unique and stage a public spectacle of sorts that everyone seemed to enjoy.  Tomorrow as I tune into watch Watson and the team from IBM, I have a small sense of how they’ll be feeling, and win or lose (there are already rumors leaking out as to the results) it is an incredible achievement.  Congratulations and good luck!

Postscript: