Monday, July 29, 2019

Thinking, Fast and Slow: a very short review

Suppose you were to (somehow? I don't know how to do this) compile a list of all the books written by all the Nobel Prize winners.

And then, exclude the ones written by the winners of the Nobel Prize for Literature, because of course they write a lot of books!

And then, exclude the ones written by the winners of the Nobel Peace Prize, because they write a lot of books, too.

I think at that point you're left with a pretty short list of books.

Of those, you'll find the occasional book written by a Nobel Prize winner in the hard sciences, such as James Watson's The Double Helix, or Murray Gell-Mann's The Quark and the Jaguar, but mostly what you'll find are books written by winners of the Nobel Economics Prize.

Because those economists write a lot of books, too.

And I confess that I haven't read most of those books.

But, occasionally, the Nobel Prize in Economics is awarded to somebody who isn't, strictly speaking, an economist, and Daniel Kahneman is one such. Kahneman, who had a long career as a Professor of Psychology at Princeton, takes the opportunity, with Thinking, Fast and Slow, to describe his conclusions about something that might sound trivial, but is actually quite sophisticated: how do we think?

Not, that is, how we think at some sort of physical level, with neurons and transmitters and the like, but how do we make decisions, how do we come to conclusions, how do we form judgments?

Kahneman's fundamental insight is that there are two different mechanisms at play: fast thinking, which is spontaneous and intuitive; and slow thinking, which is deliberate and effortful. In a rather awkward turn of phrase, he calls these System 1 and System 2:

I adopt terms originally proposed by the psychologists Keith Stanovich and Richard West, and will refer to two systems in the mind, System 1 and System 2.
  • System 1 operates automatically and quickly, with little or no effort and no sense of voluntary control.
  • System 2 allocates attention to the effortful mental activities that demand it, including complex computations. The operations of System 2 are often associated with the subjective experience of agency, choice, and concentration.
The labels of System 1 and System 2 are widely used in psychology, but I go further than most in this book, which you can read as a psychodrama with two characters.

When we think of ourselves, we identify with System 2, the conscious, reasoning self that has beliefs, makes choices, and decides what to think about and what to do. Although System 2 believes itself to be where the action is, the automatic System 1 is the hero of the book. I describe System 1 as effortlessly originating impressions and feelings that are the main sources of the explicit beliefs and deliberate choices of System 2. The automatic operations of System 1 generate surprisingly complex patterns of ideas, but only the slower System 2 can construct thoughts in an orderly series of steps. I also describe circumstances in which System 2 takes over, overruling the freewheeling impulses and associations of System 1. You will be invited to think of the two systems as agents with their individual abilities, limitations, and functions.

And the rest of the book, indeed, in quite readable prose and with very evocative and illuminating examples, explains these notions in considerable detail.

I think you can summarize Kahneman's book pretty reasonably as: usually, you let yourself be driven by hunches and knee-jerk reactions; yet usually, your hunches and intuitions are pretty reliable, especially in areas where you have lots of experience; sometimes, though your best guess is really bad, and you need to be aware that this can happen so that you can guard against it.

I know: that sounds pretty dry. But overall, this isn't a dry book. It's a surprisingly interesting and compelling book!

Saturday, July 27, 2019

Comfort Me with Apples: a very short review

Ruth Reichl's marvelous Comfort Me with Apples: More Adventures at the Table somewhat defies categorization.

It's primarily a memoir, part of a longer series that includes her earlier Tender at the Bone and her later Garlic and Sapphires and Save Me the Plums (none of which I've read).

It's also sort-of a cookbook. At least, there are actual recipes in it (none of which I've tried, although I'm itching to try both her approach to asparagus as well as a peculiar little tidbit she calls "Swiss Pumpkin" which sounds absolutely marvelous but must be made in January).

And it's definitely full of wonderful tales about celebrities of the (1980's) food world: private meals in Alice Waters's house, tagging along with Wolfgang Puck behind the scenes as he prepares to open Chinois on Main, etc.

And does she ever have stories to tell! Exciting stories from her trips around the world, hilarious tales and scandalous gossip from the heady world of California grand cuisine, warm and emotional insights into her family and her personal life, all of it written in a comfortable and appealing style that makes every page fun to read.

What struck me most about Comfort Me with Apples, however, was how vividly it arose from a very specific time and place: California in the late 1970's and early 1980's was very distinctive and awash with change. The Vietnam War was over, the oil crisis had passed, Ronald Reagan was elected president, and people were moving to California by the millions, drawn by the state's natural beauty and booming economy, attracted by visions of surfers and skateboarders and popular TV shows like CHiPs, Hart to Hart, Baywatch, and the like.

Meanwhile Berkeley was (and still is) a very unusual place, full of fervor and protest and change, and Reichl's descriptions of her life there capture the time wonderfully:

Doug wanted to make art, I wanted to write, and we moved to Berkeley so we could live cheaply and not become part of what we called the success machine. We steered clear of the stuff of ordinary existence, the clothes and cars and furniture that other people spent their money on. We chose a communal household on Channing Way because the rent was forty-five dollars a month and we could support ourselves with part-time jobs. I cooked in a restaurant; Doug did carpentry. We bought our clothes in thrift stores, borrowed our books from the library, and thought of a night at the movies as a major treat.

I'm not sure if I'll ever find the time to read Reichl's other books, but I certainly enjoyed every page of Comfort Me with Apples.

Friday, July 26, 2019

Go East, very Far East

I suspect that most people, overwhelmed by the noise and churn of the mass media, don't realize quite what a big deal an announcement like this actually is: Driving Customer Success With Alibaba

today Salesforce announced a strategic partnership with Alibaba, an innovation leader that helps its customers transform the way they market, sell, and operate through businesses like Alibaba Cloud and Tmall. Alibaba will become the exclusive provider of Salesforce to customers in mainland China, Hong Kong, Macau, and Taiwan, and Salesforce will become the exclusive enterprise CRM product suite sold by Alibaba.

Together, Salesforce and Alibaba will bring Salesforce’s #1 CRM platform — including Sales Cloud, Service Cloud, Commerce Cloud, and Salesforce Platform — to customers in mainland China, Hong Kong, Macau, and Taiwan. Alibaba’s advanced, secure infrastructure and knowledge of these markets will empower our global customers with a solution that meets local business needs.

Most Americans, and even many people elsewhere in the world, are completely unaware of how rapidly the world's center of (financial) gravity is shifting, and how, increasingly, there's only one country that matters, in global commerce.

And it isn't the United States of America.

Thursday, July 25, 2019

The Last Equation of Isaac Severy: a very short review

Came my way: The Last Equation of Isaac Severy: A Novel in Clues

It's a mystery novel about the unexpected death of a Cal Tech mathematics professor, the patriarch of a Pasadena family of troubled geniuses, and the various enigmatic characters trying to get hold of the secret-of-a-lifetime for which he died.

Which all has something to do with Chaos Theory.

The novel fails miserably at the whole "it's a mathematical secret which would change the world" business.

But if you can overlook that (a bit of a challenge, since it's the core of the plot), Jacobs is an entertaining writer and she crafts a number of entertaining characters, and there's plenty of good old family drama, with lots of those Uncomfortable Family Secrets Revealed that writers love to use to add spice to their mystery novels.

Definitely a fine book for making the commute fly by.

Saturday, July 20, 2019

More trouble on the I-880 railroad overpass

Large Pothole Opens Up on I-880 in Oakland; Multiple Lanes Blocked

The pothole, over Jackson Street, opened up in the No. 3 lane on southbound I-880, the CHP said, but the Nos. 1 and 2 lanes also were closed for the repair work.

Lane number 3, in this section, is of course the only lane that the Port of Oakland container cargo trucks are allowed to use through that stretch of the highway.

They spent so much time and effort on the section of 880 in downtown Oakland where it crosses the Union Pacific Railroad Tracks. That was an *enormous* engineering project!

It was partly for seismic retrofit and partly for traffic issues; the southbound on-ramp from 5th & Oak onto southbound 880 is well-known as one of the most dangerous on-ramps in the entire California road system.

But that bridge (12 lanes wide in sections!!) is still very troubled.

Not only was there that giant hole in the southbound lanes yesterday, but the northbound section of the bridge is separating at the earthquake expansion joint near the apex of the bridge just by the Laney College parking lot, and 3 of the four northbound lanes have enormous steel plates covering the gap in the expansion joint.

I have no idea how or when this can be solved, but it's certainly a great illustration of just how hard it is to build adequate civil engineering structures, even when you try very very hard.

Of course, one of the huge problems in this area is that this is the only road that the Oakland port container cargo traffic can use, so it bears a *very* heavy burden of constant fully-loaded cargo traffic.

But still, that was all well-known when Caltrans built the bridge.

Anyone know if there's a Caltrans project page which covers the ongoing issues with this bridge?

Saturday, July 13, 2019

Fermat's Last Theorem

Somehow, I happened across a beat-up, weathered copy of Amir Aczel's Fermat's Last Theorem just before a long airplane trip, and so I happily accepted the gift.

Aczel has written a number of "popular mathematics" books; I think this was one of his first books.

Fermat's Last Theorem, of course, is a wonderful topic, and perhaps one of the best topics for a popular mathematics book, starting from its origin story in Pierre de Fermat's notebooks ("I have discovered a truly remarkable proof of this theorem which this margin is too small to contain") to the marvelous work of Andrew Wiles, who was a great source of quotations himself:

Perhaps I could best describe my experience of doing mathematics in terms of entering a dark mansion. You go into the first room and it's dark, completely dark. You stumble around, bumping into the furniture. Gradually, you learn where each piece of furniture is. And finally, after six months or so, you find the light switch and turn it on. Suddenly it's all illuminated and you can see exactly where you were. Then you enter the next dark room...

(Wiles's evocative quote is pretty much a spot-on description of writing computer software, too, by the way.)

Fermat's Last Theorem is only peripherally about Fermat's Last Theorem. The mathematics in this book stops, more or less, at the level that a strong high school student would encounter. Mostly, it is a sort of history-of-science book, about what the process of "doing mathematics" was like in the second half of the twentieth century.

Which is still a pretty interesting thing to read about.

And, really, the world needs more books about mathematics, of any sort, even if they are just books about mathematicians, rather than books about mathematics. It drives me absolutely crazy when I wander into a magazine rack in a store and I pick up a book full of Sudoku puzzles, and, emblazoned on the cover, it says "No mathematics skills needed!" as if that was something to be happy for. (And anyway they are so wrong: logic and deduction are absolutely mathematics skills. Oh well, what can you do?)

But as it turns out, I already knew most of the story of Fermat's Last Theorem, though perhaps I didn't know quite so much about the individual mathematicians at the heart of the story.

The most interesting part of the book for me, because it was a bit of history that I had somehow never learned, was the discussion of two Japanese mathematicians, Yutaka Taniyama, and Goro Shimura, who together formulated something called the Taniyama-Shimura conjecture when they were both just in their mid-20's; the details of the conjecture turned out to be the critical turning point in "cracking" Fermat's Last Theorem.

If none of this is any interest to you, or if you're not a history of mathematics sort, give Fermat's Last Theorem a pass. But if you think you might find it interesting, it's a fun little book, and perfect for a 6 hour cross-country plane flight!

Thursday, July 11, 2019

Variations in the behavior of the default Java maximum heap size

Since the last millennium, Java implementations have always had system-specific behavior for things such as the maximum amount of memory your Java program can use, also known as the "maximum java heap".

Many (most?) JVM implementations support the -Xmx flag, which allows you to specify the maximum heap size.

But if you don't set that flag, what maximum heap size do you get?

Implementations vary widely in this case.

The most commonly-used JVM implementation is the Oracle JDK, whose behavior is documented here:

In particular, see "Table 2-6 Default Maximum Heap Sizes", which shows that the actual value will

  • depend on your operating system platform,
  • on the choice of a 32-bit or 64-bit JVM,
  • and also on the amount of RAM on the machine,
  • BUT will never exceed 2GB.

However, the OpenJDK, ( behaves differently.

With some experimentation, you will find that the Default Maximum Heap Size on an OpenJDK JVM also depends on various variables, but is NOT hard-limited to 2GB, and instead appears to simply use 25% of the RAM on your machine!

I discovered this when I was trying to figure out why we were experiencing extreme memory pressure on a fleet of machines that I manage. It turns out that our administrators had moved us from OracleJDK to OpenJDK on those machines, and our workloads had a bunch of places where we were NOT specifying -Xmx.

For those workloads, each time we spawned a JVM without specifying the maximum heap size, it had (quietly) changed from using up to 2GB of memory, to using up to 25 % of the system memory, and since we routinely spawned 2 such JVMs, half of our system memory was devoted to those 2 JVMs! Since these were quite large machines, having typically 48GB to 64GB of memory, this meant that a very large memory usage change had occurred: instead of 2 JVMs consuming 4GB of RAM total, the 2 JVMs were now consuming 24-32GB of RAM total!

Big machine or small machine, 25% is a lot! Since our machines routinely run thousands of processes, it took me far too long to notice these two processes quietly occupying half the system ram.

So the overall impact was subtle and it took me a LONG time to notice it (many months, sadly), because all that really happened right away was that the workloads ran more slowly, and the machine performance seemed quite poor, and it took me far too long to understand that the reason was that 2 of the 1000+ processes on the machine were suddenly taking half of the memory on the machine.

Unfortunately, this particular behavior does not seem to be documented anywhere (at least, I haven't found the "openjdk documentation for the -Xmx flag"), although since it is open source you can always "use the source, Luke":

I estimate that I lost, over all of 2019 so far, about 1.5 weeks of my life to this particular detail.

But, happily, I finally figured it out!

Monday, July 1, 2019

Up, up and away

SF’s Brand New Gondola Opens July 1st

One of the most fun ways to get to the Salesforce Rooftop Park isn’t via a boring old escalator or elevator, but by a brand new downtown gondola system with a 20-passenger glass cabin which will connect the Mission Square (the new plaza of the Salesforce Tower at Mission and Fremont) to the rooftop park.


Salesforce Park’s grand reopening will be a subdued affair

San Francisco’s new transit structure, which shuttered six weeks after opening following the discovery of two cracked steel beams in September, will reopen to the public July 1. And while bus service won’t recommence until mid- to late-July, the park level, arguably the public’s preferred portion of the $2.2-billion behemoth, will once again be accessible.

But unlike the first opening, the gondola, which whisks people up two stories from the corner of Mission and Fremont, will be in operation.