Saturday, March 15, 2014

Slashdot comment of the day

I have said this same thing in different words many times this week.  In the post "Why San Francisco is the New Renaissance Florence", hessian writes:

"Sorry, finding new ways to rent out your car through an iPhone app is not any kind of Renaissance.  If anything, it's the decline of computer science from world-changing to trivial amusements for trivial, pointless people."

Wednesday, August 14, 2013

"I want to play baseball as soon as possible"

That's what my 7-year-old son David said to me just before bed time last night.  I said, "What do you mean?" and the conversation went along like this:

David reiterates "I want to play baseball as soon as possible"
I reiterate "What do you mean?"
David reiterates "I want to play baseball as soon as possible"
I reiterate "What do you mean?"
David reiterates "I want to play baseball as soon as possible"
I reiterate "What do you mean?"
David reiterates "I want to play baseball as soon as possible"

Now David has a _very_ slight speech delay so he was completely patient with me, and I with him, because we are used to misunderstandings.  What I thought David meant was that he wanted to play baseball next season instead of t-ball.  My wife Nancy has forced the vocabulary on us that t-ball is not  baseball.  David had finished watching a Dodger game earlier that evening and I had even suggested we go outside and play baseball during the game (though we ended up playing video games instead).  I don't want to suggest to David that he play baseball instead of t-ball next season because he is bound for success at t-ball but while he would probably be fine at baseball he is likely to be harder on himself than if he is playing t-ball (and he is quite hard on himself unfortunately).  So instead of saying "do you mean you want to play baseball instead of t-ball next season?" I just said "what do you mean" so that in case I was wrong I would not put the idea into his head :-)

Finally, I realized what the other option was, which was that he really just wanted to play baseball with me at the next possible chance, and that right now was not a good idea so instead of setting himself up for a "not right now" he replaced "I want to play baseball now" with "I want to play baseball as soon as possible".  Thus, "as soon as possible" did not mean "next season" but, "right now or as soon as possible".

Once I realized what the two options were I said "Do you mean you want to play baseball instead of t-ball next season, or do you mean you want to go outside and play baseball with me tomorrow?"  He said, "I want to play baseball with you tomorrow, which is as soon as possible."

The subtext in such a simple communication is sort of ridiculous.  Perhaps we humans make this all way too complicated because, when we first learned to communicate as monkeys, we did it to gossip about or endear ourselves to other monkeys.  Thus all communication had a purpose of instilling a point-of-view into another monkey.

I wonder if computers will need to understand language at this level in order to be useful, or if it will be easier for them to learn language and understand "I want to play baseball as soon as possible."  I suspect understanding motivations will be key to understanding communication, but perhaps many communications are simpler and do not require it, and thus computers will be useful users of language without being fully competent.  I suppose it depends on the task and whether there is much drawback to the computer making a mistake or admitting that it does not understand.  Siri makes a decent case that for some tasks, like finding restaurants, those two failure modes are OK.  But once you've found the restaurant, Siri is not much use, and the cell phone goes back to being useful mostly for connecting to humans or human-generated content like websites.

-Andrew

Wednesday, July 31, 2013

CAP theorem for dummies

For some reason, I am a geek and yet it still takes me a while to understand things that are written formally.  In general it feels like I understand something intuitively, or not at all.  Perhaps it is analogous to one of Richard Feynman's great quotes "What I cannot create, I do not understand", with the additional condition that I cannot build what I do not understand intuitively.  If my brain contains an accurate model of a system then it will certainly be easier to build in any case.

The point is that I have at various times come across Brewer's CAP theorem, which states that a system that desires to be "Consistent, Available, and Partition Tolerant" can only have two of these features and not all three.  Consistent means that changes to the system are transactional and no transactions that are partially complete are visible to the user.  Available means that the user will get a good response time to a query.  Partition Tolerant means that the system is resilient to the failure of component systems.  Even with these explanations it can still be quite unclear as to what this theorem really means, or why it is true and important.

The theorem would be better-phrased in three parts and with three example systems being described.

1) If a system is Consistent and Available then it will not be Partition-Tolerant:
A system that performs transactions atomically and is very responsive to queries is not robust to failures. Such a system takes on the form of a single computer holding a database in memory, which performs transactions in a serial order.  The system will be very responsive and transactions will be respected utterly, but if that one computer crashes then the whole system goes down because the system is not redundant ("Unpartitioned").

2) If a system is Consistent and Partition-Tolerant then it will not be Available:
A system made of multiple computers that each store a copy of essential data will be robust to failures.  This system can accept transactions but in order to provide a Consistent view of the data to the user, each replica must execute the transaction and verify when it completes before proceeding.  Because subsequent queries must wait for the previous transaction to finish on all replicas the performance will be bad, and hence said to be "Unavailable".

3) If a system is Available and Partition-Tolerant then it will not be Consistent.
A system made of multiple computers that each store a copy of essential data will be robust to failures.  Such a system will be very responsive to user queries if, when the queries arrive at the computers, they are handled right away and do not wait for previous transactions to complete.  Unfortunately, the state of the data will be inconsistent while old transactions are still running, so the view of the data is said to be "Inconsistent".

If I have simplified something in the above text that must not be, then by all means leave a comment and I will attempt to correct the error.  In the interim it shall be entered into dailycircuitry canon.

Wednesday, February 13, 2013

Slashdot Comment of the Day #5

Today's comment of the day comes from epine regarding new developments in asteroid mining.  The cherry on top is the zinger at the end:

"The real reason a supermodel isn't going to sleep with you is not because you're boring and ugly and proud of your Costco luxury goods—it's because you're living the wrong life, with the wrong crowd, on the wrong spiral arm of the social graph.

It's there, you're here, and never the twain shall meet."

Burn!  lololol

Courage

If you've never heard Rilo Kiley I must highly recommend them as they are one of my favorite bands.  My brother-in-law Daniel introduced me to their music as we traveled across the country during my move to Palo Alto from Hanover NH (which I told him at the time was a once-in-a-lifetime adventure, to which he responded that it was a 50-hour drive that could be done whenever.  I responded, "yeah, but it will never be the first time again".  The epic-ness of that adventure has only increased in my mind over time... I love it when I'm right :-P  ).

My favorite song of their's is "Close Call".



I get tingles down my spine when I think about foreseeing that something is going to be chancy, and if it succeeds it will be by the skin of teeth, and doing it anyway with teeth and fists clenched.  It is the feeling of being consumed by hope and fear at the same time.  To me that is what defines courage.

Monday, October 8, 2012

Are you as smart as a 6-year-old?

"Maybe the Dingo ate your baby."  ... "I said, the DINGO ate your BABY!".


There was a montage of Seinfeld clips on TV last night - which meant I was watching the hundredth episode of Seinfeld on reruns.  The clip above played, and I elbowed my wife who was nodding off.  She said "Haha" and started falling asleep again.  I said "Isn't it funny how much the kids love that clip?" (I have showed it to them many times on YouTube).

"Mm-hmm."

"They don't even know why it's funny."

"Hah, yeah," she said.

"Wait, you know what.. I don't know why it's funny either.."

The next day I was thinking about how my 6-year-old boy David is growing up and discussing it with Nancy again.  I said "He is so innocent.  He doesn't know why people are mean.  He knows some people are, and I'm glad he does because he reacts by keeping his distance and toughening up his feelings a bit (just a bit).  But he has no idea why they're mean."

"Mm-hmm"

"Wait, you know what, I don't know why people are mean either."

With two such occurrences in two days I realized I may not have much on David, or perhaps any 6-year-olds.  On a moral and social level I wonder how much more he really has to learn?

Wednesday, August 29, 2012

Rest in peace Paul Steed

I remember meandering through the aisles of the UCI bookstore between classes and coming across "Modeling a Character in 3DS Max" by Paul Steed.  Flipping through the pages, I realized that the book would take me through every step of creating a professional-quality 3D video game character.  The step-by-step nature of the book made it seem simple, causing a light to go off in my brain when I realized... I could do this!  My jaw dropped, and I bought the book instantly.  Ever since, I knew if I ever wrote a book then it had to be in the same spirit as Steed's: to enable the reader to build something really cool.


My favorite memories from high school classrooms were building things in Physics class like a 6-foot tower made from a single sheet of paper, an electric car with pie-tin wheels, and a kayak built entirely out of milk cartons (winning 2nd prize).  Outside of those projects, I also remember that instead of paying attention in class I would make games on my TI-82 calculator programming in BASIC.

While those projects seem trivial, they are the kinds of learning experiences that change lives.  Paul Steed brought such an experience to life in his book, inspiring me that some day I might also try my hand, and for that I will always be grateful.

Paul died on August 11, 2012, may he rest in peace.