Showing posts from March, 2011

Review: The Lexus and the Olive Tree: Understanding Globalization, by Thomas L. Friedman

I read it, it took a while. I found myself annoyed with keeping track of all the analogies. He'd introduce a concept, then say, "This is something I call the Golden Straightjacket" and I'd think What a strange name, why do I need a shorthand for this? And then he'd refer to it several times. There were lots and lots of these, DOScapital 1.0, Electronic Herd, bleck. Here's an amazon review that was annoyed, too. I did find it informative, but I think I'm going to read 'Guns germs and steel' before any more of his later books. PBSwap link . Reminded me that he mentions Enron's management with approval, and found their use of derivatives inevitable. A scattered review. I finished the book ~1 month ago, so I'm forgetting pieces.

Review: Myth of the Rational Voter, by Bryan Caplan

subtitle: "Why Democracies Choose Bad Policies" Engaging, somewhat technical, an excellent swipe at the failure of established economic practice to explain what happens during out elections. I think I finally know what public choice economics refers to. Biases of non-economists are central, to quote from PBSwap: they underestimate the wisdom of the market mechanism, distrust foreigners, undervalue the benefits of conserving labor, and pessimistically believe the economy is going from bad to worse.   Distrusting foreigners translates easily into protectionism and tariffs, which hurt. Conserving labor is the tough one, because he means that we should protect an individual in a particular job, but instead allow 'churn', so that people move to the jobs that will be the most productive. So European unions/protection gets a bad grade, there. I learned a lot, which is what I was looking for. PBSwap link .

Large files in C++

More specifically, wxWidgets and MSVC++ 2010. I found an msdn query that says 2010 is the first version that supports >2Gb file sizes with std::iostream. So that's fine with me. We found a few necessary changes: stat() changes to _stat64() istream::tellg() returns an istream::streampos, not an int. But what on earth happened here? // save the beginning position of this line for when we have to back up istream::streampos begin_line_pos = infile_stream.tellg(); string std_keyword; infile_stream >> std_keyword; // bunch of other keyword handling..... if (keyword == "shape") {    infile_stream.seekg(begin_line_pos);    // Danger! over 2Gb, this turns into negative seek, fails:    //infile_stream.seekg(begin_line_pos, ios::beg);    return true; } How does the commented line with the seekg() fail? It should treat begin_line_pos as an offset, which should be 64 bit. It's REALLY LAME if it sees the unsigned streampos and converts it to 32 bits for s

How to swim freestyle

It's pretty obvious how different my stroke is from these pros: My wife is working on this. I'm just watching, amazed. Oh, and here's Michael Phelps . He does it too.