Blog | Admin | Archives

Safety Agains Reopen

What does this comment in the MySQL source mean? (log.cc, currently line 2295 in 5.1)

{ // Safety agains reopen

I think I understand what it’s supposed to mean — the writer is pointing out that the code is checking again, to be double sure that the log is still open (although, if it can close between this call and the last call to is_open(), I’d be worried about it closing after this call too… note that both checks are after LOCK_log has been acquired).

What I’m more interested in is what the comment, as written, actually means? The grammar is very odd. I’m open to suggestions.

Grey Swans

Scott posted a link to an article (text below). I found it interesting and with some good ideas, but also woefully misguided at some points.

Ten principles for a Black Swan-proof world

By Nassim Nicholas Taleb

1. What is fragile should break early while it is still small. Nothing should ever become too big to fail. Evolution in economic life helps those with the maximum amount of hidden risks “and hence the most fragile” become the biggest.

This is easy. Nothing is ever too big to fail. That is a term invented by bankers and politicians to justify taxpayers supporting banks. Taleb is on to something about hidden risks, though.

2. No socialisation of losses and privatisation of gains. Whatever may need to be bailed out should be nationalised; whatever does not need a bail-out should be free, small and risk-bearing. We have managed to combine the worst of capitalism and socialism. In France in the 1980s, the socialists took over the banks. In the US in the 2000s, the banks took over the government. This is surreal.

Nothing actually ever has to be bailed out, or nationalized, but I suppose nationalization would be preferable to the current trend of just giving bad companies money.

3. People who were driving a school bus blindfolded (and crashed it) should never be given a new bus. The economics establishment (universities, regulators, central bankers, government officials, various organisations staffed with economists) lost its legitimacy with the failure of the system. It is irresponsible and foolish to put our trust in the ability of such experts to get us out of this mess. Instead, find the smart people whose hands are clean.

No arguments here. It is interesting that the government, the media, and probably most people still view the ones who created this mess “financial experts”.

4. Do not let someone making an “incentive” bonus manage a nuclear plant or your financial risks. Odds are he would cut every corner on safety to show profits while claiming to be conservative. Bonuses do not accommodate the hidden risks of blow-ups. It is the asymmetry of the bonus system that got us here. No incentives without disincentives: capitalism is about rewards and punishments, not just rewards.

I think this is sound advice to financial companies. I see no need to legislate this opinion, however. Rather, get rid of the corporate safety net, and companies will shape up or fail and die, and the problem will fix itself.

5. Counter-balance complexity with simplicity. Complexity from globalisation and highly networked economic life needs to be countered by simplicity in financial products. The complex economy is already a form of leverage: the leverage of efficiency. Such systems survive thanks to slack and redundancy; adding debt produces wild and dangerous gyrations and leaves no room for error. Capitalism cannot avoid fads and bubbles: equity bubbles (as in 2000) have proved to be mild; debt bubbles are vicious.

Seems to be sound advice again, for me and for you. Again, I don’t see any need to mandate this sound advice in law. But some people see the need to outlaw salt, so probably not everyone agrees with me.

6. Do not give children sticks of dynamite, even if they come with a warning . Complex derivatives need to be banned because nobody understands them and few are rational enough to know it. Citizens must be protected from themselves, from bankers selling them “hedging” products, and from gullible regulators who listen to economic theorists.

The world somehow survived 4 billion years without banning complex financial derivatives. I know that many people think regulation solves everything (it doesn’t), but I really think the world will survive this too. Let those who learned from this go on without blowing themselves up. Again, I see no need to open the door to unintended consequences by trying to set up rules (that will be circumnavigated) to prevent a one-time occurrence from happening again.

7. Only Ponzi schemes should depend on confidence. Governments should never need to “restore confidence”. Cascading rumours are a product of complex systems. Governments cannot stop the rumours. Simply, we need to be in a position to shrug off rumours, be robust in the face of them.

Many banks were robust in the face of these rumors. They are the ones not receiving any money from the government (That’s why I “love” the bailout(s)). Most of the economy is still fine and has proven to be robust in the face of tempestuous times.

8. Do not give an addict more drugs if he has withdrawal pains. Using leverage to cure the problems of too much leverage is not homeopathy, it is denial. The debt crisis is not a temporary problem, it is a structural one. We need rehab.

I agree. Many people seem to be under the impression that the legal and economic system we currently have — progressively more regulations outlawing progressively more things and creating progressively more perverse incentives — makes sense, and that it only fails occasionally. Well, it doesn’t make sense, and it is always going to fail.

Of course, many people disagree with me about what constitutes a fix. So I say to them, go ahead and try out your ideas, just don’t force me to be a part of your fix. Then we can both be happy.

9. Citizens should not depend on financial assets or fallible “expert” advice for their retirement. Economic life should be definancialised. We should learn not to use markets as storehouses of value: they do not harbour the certainties that normal citizens require. Citizens should experience anxiety about their own businesses (which they control), not their investments (which they do not control).

This is very bad advice. Citizens should make this choice themselves, depending on how much risk they are willing to take on. I think it is generally good to have people invested in a market economy — it is one of the best financial engines ever developed.

10. Make an omelette with the broken eggs. Finally, this crisis cannot be fixed with makeshift repairs, no more than a boat with a rotten hull can be fixed with ad-hoc patches. We need to rebuild the hull with new (stronger) materials; we will have to remake the system before it does so itself. Let us move voluntarily into Capitalism 2.0 by helping what needs to be broken break on its own, converting debt into equity, marginalising the economics and business school establishments, shutting down the “Nobel” in economics, banning leveraged buyouts, putting bankers where they belong, clawing back the bonuses of those who got us here, and teaching people to navigate a world with fewer certainties.

I like the voluntary part. Market capitalism itself has never been broken. It is the continuous political patching of perceived flaws in the that has created the many perverse incentives of our current wonderful system, somewhere in the murkiness between fascism and capitalism and socialism and stupidity.

Then we will see an economic life closer to our biological environment: smaller companies, richer ecology, no leverage. A world in which entrepreneurs, not bankers, take the risks and companies are born and die every day without making the news.

In other words, a place more resistant to black swans.

Humans have used their intelligence to out-compete the rest of the natural world. I don’t see why we should model one of the best wealth production mechanisms we have developed yet — the market-based capitalist economy — on a biological world that will continue to become less relevant as technology progresses. This is just useless sentimentalism.

The writer is a veteran trader, a distinguished professor at New York University’s Polytechnic Institute and the author of The Black Swan: The Impact of the Highly Improbable

The writer calls himself a “veteran trader” — ie, a “financial expert”, and wonders if maybe we should take the part of  advice where he says we shouldn’t take the advice of financial experts. As a fellow beneficiary of a relatively free, relatively stable, capitalist market economy, I would urge you to not make the situation any worse.

Blogging is Hard

I decided to write a blog post this evening, and I have discovered that it is hard.

I have five or so unfinished drafts. Some of them have really good titles:

  • Time Horizon
  • Tags
  • Is Antitrust Regulation Harmful to Consumers?
  • (no title), but the content seems to be a fairly well thought-out post about the “black swan effect”

Maybe I should try finishing these articles.

Blog Optimization

In the last two days, I

  1. Changed my blog’s MySQL tables storage engines from the MyISAM to InnoDB
  2. Installed the WordPress Memcache Plugin to mimimize database queries (16-25 queries reduced to 2-7)
  3. Installed APC (Alternative PHP Cache) to reduce PHP bytecode compilation overhead. As a result, all PHP sites on mimimus should be faster.

In addition, I did some general cleaning up and upgrading of software on minimus and nexus.

Altogether, these changes reduce the typical Checksum Arcanius page load from 2.5-3.5 seconds to 0.5-1.5 seconds, a 2-7x improvement.

These are very easy steps to take — I would suggest them to anyone running WordPress. Step-by-step directions follow (assuming Ubuntu Linux):

  1. For each table in your blog’s database, execute the following SQL via a mysql client instance, phpMyAdmin, etc:
    ALTER TABLE <tablename> ENGINE = InnoDB;
  2. Install memcache:
    sudo apt-get install memcache
  3. Download the WordPress Memcache Plugin and place it in your wp-content directory. That is all you have to do to get memcache support in WordPress!
  4. Install APC:
    sudo apt-get install php-apc
  5. Restart Apache:
    sudo /etc/init.d/apache2 restart

Very simple steps with a very high payoff.

The Trend

The Trend is Clear

As I have become more involved with Facebook and Twitter, the number of idea that actually mature enough for me to blog about them go down. Also, I’m not taking enough time to review my thoughts and write about them.

My first resolution of 2010: I resolve to do blog more. I need that time to reflect reflect on my life. Status updates are not sufficient.

Strange Tracking

I have been trying to return a package to Amazon for over a month now. I think it might make it this time! I have two tracking numbers, and one of them (1Z7R23Y69088829050) reports the following tracking data:

Date Time Location
January 13, 2010 09:31:00 PM Hodgkins IL US
January 13, 2010 05:45:00 PM Hodgkins IL US
January 9, 2010 03:24:00 AM San Pablo CA US
January 9, 2010 02:29:00 AM San Pablo CA US
January 8, 2010 10:06:00 PM Menlo Park CA US
January 8, 2010 07:01:00 PM Menlo Park CA US
December 12, 2009 09:49:00 AM Lexington KY US
December 12, 2009 03:53:00 AM Indianapolis IN US
December 12, 2009 02:21:00 AM Indianapolis IN US
December 11, 2009 10:21:00 PM Hodgkins IL US
December 11, 2009 07:13:00 PM Hodgkins IL US
December 9, 2009 05:25:20 AM
December 9, 2009 12:35:00 AM Oakland CA US
December 8, 2009 11:52:00 PM Oakland CA US
December 8, 2009 10:10:00 PM Menlo Park CA US
December 8, 2009 07:25:00 PM Menlo Park CA US
December 8, 2009 04:25:20 PM
December 8, 2009 04:25:00 PM Menlo Park CA US
December 2, 2009 02:02:50 AM US

Notice how it magically disappeared for almost a month after reaching Kentuky, and then reappeared in Menlo Park, only to be shipped off again. UPS magic!

That means the package has travelled over 7,000 miles since when I tried to ship it!

2009 Resolutions Redux

It’s the end of the year, which means its time for me to look back at my 2009 resolutions to see how well I met my goals:

  • Complete a marathon
    Result: Success! I completed the Portland Marathon in October. It wasn’t my best moment, but I did make it. I had to verify that this resolution said “complete” rather than “run” because I certainly did not run the entire marathon.
  • Complete an Olympic-length Triathlon
    Result: Failure. Had I been a little more aggressive with my schedule before starting work, I could have participated in an olympic-length race with Kunlun; however, I was not sufficiently on the ball and I missed this one.
  • Get a better time on a Sprint Triathlon
    Result: Success! I completed the Seafair Triathlon three and a half minutes faster this year than last year.
  • Complete Seattle To Portland bike ride in One Day
    Result: Success! I left Seattle with the first wave at 4:45 am, and many hours later, arrived at the finish line in Portland just after 9:00pm. Apparently, I didn’t blog about this, perhaps because I was preoccupied with my upcoming travels (see next item)
  • Visit Australia and Peru
    Result: Success! I traveled to Peru with Kunlun, Scott, and Ben in June. I enjoyed myself, but I’m not itching to go back real soon. I wrote about the trip in five blog posts. I returned home just long enough for the Seattle to Portland bike ride and the Seafair Triathlon, then I headed out for Australia and New Zealand with my parents, a trip that I consider to be the most wonderful success of any trip I have ever embarked on. I definitely have more I want to see and do in Australia and New Zealand.
  • Work out (1+ hour) at least once a week
    Result: Mixed. I probably got more exercise than this throughout the week, but often not all at one time.
  • Get my Motorcycle certification endorsement
    Result: Failure. I just didn’t get around to this. I will try again next year.
  • Complete my Masters degree with a grade at least as high as my Bachelors degrees
    Result: Failure. I’m pretty disappointed with the overall grade I achieved in grad school. If I ever go back, I won’t let it happen again.
  • Eat slower, smaller portions
    Result: Partial success. I’m getting better at regulating how much and how quickly I eat, but I still have too many lapses. Fortunately, I’m learning more about myself, which is helping me make progress here.
  • Eat only until I’m full
    Result: Partial success. This is of course closely related to the last point, and I have gotten better at moderating my intake at each meal. Again, this is a work is progress.
  • Curb over-snacking tendencies
    Result: Success. I’ve found that by limiting what I have around the house, I can control what I munch on much better. This is made a little more difficult by easy accessat work to junk food, but it hasn’t been a major problem, so I feel good about claiming this as success.

Overall, I feel good about my accomplishments this year, even though the failures bite a little, I hope to learn from them and do better next year.

Stay tuned for next year’s resolutions.