Measuring economic growth over generations

Berkshire Hathaway's annual report was released last week and it of course includes another letter written by Warren Buffet. There are always nuggets in there to help understand our world, business management, and even obligatory diet advice (burgers and cola all the way down). But in this issue I found a theme on measuring "economic growth" over time.

The percentage of people employed in farming has decreased tremendously over the past 200 years however output increased. This resulted in many disrupted jobs but now nearly everybody has access to very affordable food. This drastic change has also happened in other industries and as we speak there are several being steamrolled right now. What tools should we use to determine if this was a good development (improvement in quality of life) or a bad one (exploitation of labor, concentration of wealth, robot conspiracy)?

Lots of numbers are available from statisticians: GDP, worker productivity, inflation, gini index and more. You could find these number if you read the reports (and trust the authors), but is there something that is more readily available and obvious?

Yes! Directly compare the quality of life across time and across income levels. If we can assume that people with higher income levels or more wealth have a higher quality of life then this is a sound method. Buffett gives one explanation:
All families in my upper middle-class neighborhood regularly enjoy a living standard better than that achieved by John D. Rockefeller Sr. at the time of my birth. His unparalleled fortune couldn’t buy what we now take for granted, whether the field is – to name just a few – transportation, entertainment, communication or medical services. Rockefeller certainly had power and fame; he could not, however, live as well as my neighbors now do.
It might not be easy, but this is the correct way to compare the improvement of the life circumstances across times. Luckily, for most of mankind this is a simple comparison and progress has been positive.

Generic process to unroll any recursive algorithm

In computer programming, you run into recursive algorithms when dealing with a problem that exhibits similar substructure. Recursion will apply the exact algorithm to a subset of the problem and then combine the result in some way with the remainder of the problem. Using recursion can be very readable and elegant. You are not likely to come across a contrived usage of a recursive algorithm.

Recursion uses a finite resource, stack space, and requires an assumption that the algorithm -- with expected inputs -- will not exhaust this resource. If this assumptions fails, then you will need to "unroll" the algorithm to make it not recursive, or reconsider your approach altogether. It is always possible to rewrite a recursive algorithm as unrolled.

Here I will demonstrate a generic way to unroll any recursive algorithm. Of course, for your specific algorithm, you can surely do better.

Our example is finding tree depth, from Eric Lippert at Microsoft:

int depth(node *tree) {
  if (!tree)
    return 0;
  return 1 + MAX(depth(tree->left), depth(tree->right));
}

STEP ONE:

Refactor your code to meet a few requirements:
  1. All variables must be defined, without initialization, at the top of the function
  2. Each recursion must be on its own line
  3. Use a retval variable
int depth2(node *tree) {
  int retval;
  int l;
  int r;
  if (!tree) {
    retval = 0;
    return retval;
  }
  l = depth(tree->left);
  r = depth(tree->right);
  retval = 1 + (l > r ? l : r);
  return retval;
}

STEP TWO

Create a stack struct and move all variables there. Also include a parent pointer, a resume_point int, a retval, a returned_val and any function parameters. In the function, make a pointer to this stack entry and use the variables from there. Also initialize parent = NULL.

typedef struct depth_stack {
  int l;
  int r;
  node *tree;
  int resume_point;
  struct depth_stack *parent;
  int retval;
  int returned_val;
} depth_stack;

int depth3(node *tree) {
  depth_stack *pStack = malloc(sizeof(depth_stack));
  pStack->parent = NULL;
  pStack->tree = tree;

  if (!pStack->tree) {
    pStack->retval = 0;
    return pStack->retval;
  }
  pStack->l = depth(pStack->tree->left);
  pStack->r = depth(pStack->tree->right);
  pStack->retval = 1 + (pStack->l > pStack->r ? pStack->l : pStack->r);
  return pStack->retval;
}

STEP THREE

Add a new variable tmp_stack for your opening variables, then push that into your stack. Replace each recursion call with code to push on the stack. At the end, include code the returns pops the stack and returns if empty. When pushing and popping, use a unique resume_point and goto (yes, really) to get back to that location.

int depth4(node *tree) {
  depth_stack *tmp_stack = malloc(sizeof(depth_stack));
  tmp_stack->tree = tree;
  depth_stack *pStack = NULL;

push:
  tmp_stack->parent = pStack;
  pStack = tmp_stack;
  if (!pStack->tree) {
    pStack->retval = 0;
    goto pop;
  }

  // Recurse left call
  pStack->resume_point = 1; // will pick up back here
  tmp_stack = malloc(sizeof(depth_stack));
  *tmp_stack = *pStack;
  tmp_stack->tree = pStack->tree->left;
  goto push;
recur1done:
  pStack->l = pStack->returned_val;

  // Recurse right call
  pStack->resume_point = 2; // will pick up back here
  tmp_stack = malloc(sizeof(depth_stack));
  *tmp_stack = *pStack;
  tmp_stack->tree = pStack->tree->right;
  goto push;
recur2done:
  pStack->r = pStack->returned_val;

  pStack->retval = 1 + (pStack->l > pStack->r ? pStack->l : pStack->r);
  goto pop;

pop:
  if (pStack->parent) {
    tmp_stack = pStack;
    pStack = tmp_stack->parent;
    pStack->returned_val = tmp_stack->retval;
    free(tmp_stack);
    if (pStack->resume_point == 1) goto recur1done;
    if (pStack->resume_point == 2) goto recur2done;
  }
  return pStack->retval;
}

CONCLUSION

In step 3 we have implemented a deterministic way to translation a recursive functions to an unrolled one. Therefore, this exact technique applies to every recursive function. Of course in the real world you will probably find a better control flow than goto, but I hope this is a helpful starting point.

Full code Gist.

Practical dreams about saving the human race

Among the things that have kept me up at night:

Your species is being attacked by a superior invader that takes apart peoples' brains and assimilates the knowledge into their collective hive. How do you stop them?

Best radio shows from from 1940s to the end of the 20th century

This is second in a series started with a review of comedy acts in the 20th century.

Old Time Radio is enjoying a comeback. There are plenty of original and creative shows recorded over the years and have expired copyright which makes them great for repackaging and reselling. There is great selection on ISOHunt and for sale on Amazon. These are a great way to pass the time if you are driving for hours each day.

The shows

I downloaded several torrents and with "best of" packs as well as individual show archives. There are many series in the sets, some longer running story shows include: CBS Mystery Theater (ghost stories), X Minus One (sci-fi), Tom Corbett Space Cadet (sci-fi), Escape (variety), and Sherlock Holmes audio books. Other "late night" shows include The Bob Hope Show, and NBC Summer Theater.

The best rated show, with deserved merit, hands-down is the 1938 radio adaptation and broadcast of War of the Worlds. It is easy to understand how this broadcast caused a real-world panic -- but it is surprising that this novel broadcast format has never been reused in any significant way since then. The immersion is a significant part of the show, with regular decoys from a broadway show to make the listener forget that they are experiencing a science fiction story and instead make them believe they are enjoying a concert with alarming interruptions. The musical scores are numerous and span over one minute in length each. In modern cinematography this is unheard of, with "TV interruptions" on the screen for less than 3 seconds. They really did it right with this show, and everyone should hear it once.

A second place is A Logic Named Joe, a radio adaptation on X Minus One in 1955 of the short story by the same name. Since Old Time Radio shows are so long (> 20 minutes) it is hard to recommend a show for general appeal unless you are already a fan of that category -- suspense, ghost stories, science fiction. However A Logic is such a notable piece, and the radio adaptation does it justice, because of specific and correct technology predictions it made. The story was written in 1946. At this time only several "computers" existed, none of which were general purpose, and most were classified; phone, meanwhile, had just recently been updated to integrate the speaker and microphone into the same unit. This story predicts personal computers which are networked together, have messaging capability, and an incessant need to collect and publish their users' personal information for gossip. Along with other specific predictions, this is literally on the money 60 years into the future. Also notable is how this piece does not fall into the trap of false predictions that are made by other science fiction pieces set in the future. Everyone should be able to appreciate the success this story has made in predictions when listening to the show.

Predictions for the Future and Sci-Fi Themes

A common theme in science fiction in the past and today is prediction of future technology. Some odd predictions and other common themes are here.
  • Mass-market, sentient devices which turn on their owners for self preservation
  • Computers that violate Gödel's incompleteness theorem
  • Time travel -- with paradoxes: allowed, leading to explosions, resolving themselves
  • Space travel by astronauts that would clearly fail a psychological exam
  • Faster-than-light travel
  • Odd things on the dark side of the moon
  • Aliens achieving space flight but failing to reconnoiter our atmosphere
Also, in the advertisements every brand name was always spelled out. "Gilette, that's G-I-L-E-T-T-E".

Page One Power -- SEO Services Billed Hourly, Plagiarism, Claiming Others' Work, No Accountability

We have been a customer of Page One Power for 12 months and after a failure to glean results from the campaign have cancelled the campaign.

Poor results are a common result of business dealings but when a company employs tactics to cover up shortcomings, misrepresent results and fails to take any accountability, then this is blog-worthy.


The Contract

We have contracted with Page One Power for SEO services including email-based linkbuilding and guest blogging and would not recommend these services to a friend. The relationship spanned 12 months starting September 2013 and was for a 5-figure sum of money.

Their Guest Blogging Approach

One the P1P blog, in the few posts where they discuss strategy, guest blogging is a major component of their thinking. Of course Google's Matt Cutts discusses the fall of guest blogging as an SEO strategy in his blog. But since this is a low-cost, low-quality, high-visibility link, P1P project managers defended the practice with (emphasis mine):
Yeah Will we have seen this. It’s nothing new, Matt has been talking like this for a year. If you look at it very close, especially his added notes at the end and his replies to peoples comments you will see that “guest posting” is not going away. This to us, seems to be more of strong threat to say, “Stop doing spammy stuff” which we all agree. To me this gives me all the more confidence in what we do. We do real outreach with real people contacting relevant sites, writing real articles that make sense for both parties. 
Of course 99% of guest blogging with hyperlinks is spammy, including the work of P1P. All our articles were written by invented people with fake personas. These fake people also failed to disclose their relationship with our company. In legitimate publications (the ones you and I actually read) this would be unacceptable and considered a failure of journalistic integrity. In other words, this is the exact stuff Google is targeting. I was also given the following excuse:
Guest Posting is part of the internet world. Everyone from New York Times to Moz does this. Is Google going to penalize New York Times?
Excuses are not necessary, only results matter, I have typed in [new york news], [news papers from new york], [us newspapers], and [news] into Google using my large 21” iMac. I did not see New York Times mentioned anywhere above the fold on any of these pages. And these are just the first queries that came to mind. 

Email Linkbuilding

Since you are paying by the hour, results are glossed over. You can quickly see this by viewing their packages page which states "We sell hourly packages because we can’t promise a certain number of links per month." They fail to mention typical customer results. Our results were 24 normal email-based outreach links created over 12 months. Several of these link existed (and are visible on the Wayback Machine) before the P1P engagement. In other words, they took credit for others' work.

Other Campaigns

P1P has implemented several other campaigns types during our work together. Wikipedia links which are quickly reverted (for anti-spam policy) are still reported for credit. Lastly, a badging campaign ("You are one of our top 10 favorite websites, link to me!") took several months to execute and produced less results than we achieved in house last time using interns. On our website we will post links to our chosen sites and hope they link to us. P1P has provided me with text to publish which was already published elsewhere on the internet (big no-no!) and also this ridiculous piece below:

The Worst Part

The worst part is how P1P fails to take any accountability in their projects and in resolving issues. When I started with P1P we used Google Docs to manage the account, set a target of 10 links per month, and I had visibility to the whole team. Also, I promised to double the budget when the target is met, and to continue doubling. We have failed to meet the target in every month of the campaign and not once has anyone from P1P contacted me to note that the target was unreasonable nor that they were failing.

To reduce accountability further, P1P has reorganized its project teams to delegate contact with clients through a separate Project Manager for client interaction. Also, the detailed Google Docs including project goals has been replaced with Linktracker, an internal reporting tool that only provides data. The links acquired data and outreach information they provide is detailed and (if you ignore credit taken unduly) useful.

A Director of Operations at P1P missed appointments three times when discussing project accountability and failed to indicate that other Project Managers at P1P would produce any different results, noting only "... we certainly had hopes to bring the results you desired.  This was a difficult project and we are clearly not on the same page."

How to make the best out of jury duty

Su just got her third notice today about needing to reply to a jury duty summons.

Su: Wait... so why did they pick me?
Su: So it's like a lottery? And I hit the lottery? I've never hit the lottery before, this is awesome!
Su: So I have to interview them first and see if they will pick me?
Su: And I don't have to go to work that day!? Even better!
Su: I'm going to say yes to every question they ask me... they will definitely pick me!

When Su is seeing new things here for the first time, sometimes I just give her the facts rather than explain all the emotional baggage that we attached to those things. This also explains why she loves root canals "so they just open my mouth, take out all the bad stuff and put good stuff in... I definitely want that!"

Is Free Internet Chess Server (FICS) a registered nonprofit? Are donations tax deductible?

I have been trying to get involved in the FICS project, the largest and oldest free online chess server. After playing for many years there, maybe there is something I can give back.

It would be nice to know more about their organization and who the real people involved are. Even though there are so many people actively playing there, information about the project is sparse and dated, and I can get in contact with any admins via email. Investigating further, I have the following to share.

The entity that owns and operates the FICS (or used to) is Free Internet Chess Organization, a Minnesota corporation. Their original address was:
P.O. Box 3212
Burnsville, MN 55337
While operating out of
13306 Court Pl
Burnsville MN 55337  USA
But is now
8708 31ST Ave N
New Hope Mn 55427
Originally the FICS was registered as a non-profit on 07/31/1998, however the entity has been dissolved as of 01/16/2007 according to the State of Minnesota.

So, at this point donations are not tax deductible.

Sources: