The human factor and owning your problems

Yesterday, I attempted to register for Google I/O along with thousands of other people. I got a 500 server error at first, and then had to wait in line 5 times (6 minutes each time) before the long-awaited-for ticket opportunity appeared. Long story short, the transaction didn’t work the first time, and the second time it looked like it worked but the timer still ran out and kicked me back to the main page, and tickets sold out quickly thereafter.

I looked at my Google Wallet and lo-and-behold, there was a transaction for the ticket but I had no confirmation email and no form to actually register for the conference. I emailed the Google I/O support email address for help. About an hour later, the transaction was inexplicably cancelled.

I am not alone in my experience. Plenty of my friends had the same problem and were also left without tickets. And just look around Twitter.

This afternoon (more than 24 hours later) I finally got a response to my email:

Hi Zach,

Tickets for Google I/O 2013 have sold out. We understand that you experienced issues with our registration process. If you weren’t shown the registration form during the registration process, the process did not complete, and we apologize that we are unable to provide you a ticket to this year’s conference.  We see that the charge to your account has already been cancelled.

We hope that you will join us for the live stream of the keynote, top sessions and our special Google Developers Live @ I/O programming.

Watch our Google Developers page for future updates on Google I/O. In the next few days we’ll be posting more on how to join a viewing event with I/O Extended. #io13

Regards,
Google I/O Team

I’m an understanding person. I’m a software developer and I know testing your software for the kind of scale they had yesterday is really, really hard. But the problem I have with the response is that it uses indirect wording.

We understand that you experienced issues with our registration process.

No, I experienced a problem. The word issue downplays the actual problem at hand. Google’s servers and code didn’t handle the demand well and I wasn’t able to register. This is their problem. And furthermore the email says nothing about what they are doing to fix it.

Here’s what I wanted to hear:

Hi Zach,

We’re terribly sorry our registration service didn’t scale well with the demand and that our problems prevented you from being able to register successfully for Google I/O 2013. We’re working to fix these problems to make registration better in the future. We would really like to rectify this and get you a ticket, but unfortunately tickets have already sold out and we can’t fit any more people in the Moscone Center. It looks like the charge to your account has already been cancelled.

Even though we can’t get you a ticket, we hope you will join us for the live stream of the keynote, top sessions and our special Google Developers Live @ I/O programming.

Watch our Google Developers page for future updates on Google I/O. In the next few days we’ll be posting more on how to join a viewing event with I/O Extended. #io13

Once again, we are really sorry our problems prevented us from getting you a ticket.

Regards,
Google I/O Team

See the difference? Doesn’t that feel better?

We’re all human, and we make mistakes. Our stuff isn’t always going to work and other humans understand. Willingly taking the blame for your mistakes and problems makes people feel better about them.  Own your code.

Now I’m not going to say that it was the I/O team’s intention to shift blame with their response. I’m sure they’re nice people. I write this more as an example of how a choice of words can make a difference when talking to your customers.

Disclaimer: I will be interning at Google this summer.

Posted in computer science, philosophy | Tagged , | 1 Comment

I’m on This Developer’s Life!

I’m on the latest This Developer’s Life podcast with Scott Hanselman and Rob Conery!  My interview starts at 33:37, but I highly recommend listening to the whole thing.  Check it out here.

Posted in computer science, podcasts | Leave a comment

Daydream on the future

Here’s a little tune I came up with last week while playing my hammered dulcimer, and decided to record and put up on Youtube.  Enjoy!

Posted in music | Tagged , | Leave a comment

Aristotle’s trial

The following is a humorous paper I wrote in high school back in December 2008 – it still makes me laugh. See if you can find all the subtle jokes.  Enjoy! :)

Judge: Mr. Bacon?  For the purpose of court records, what charges do you press and upon what grounds do you hereby bring Mr. Aristotle into this court?

Francis Bacon: I press one charge and it is this: Aristotle is guilty of improper or no experimentation to validate what he sets forth as absolute truth in his books.

Judge: Thank you, Mr. Bacon.  You may now start us off with your full argument.

Bacon: I shall.  Truth can only reliably be discovered by experimentation.  When experimenting, one must “force [oneself] for a while to lay [one’s] notions by and begin to familiarize [oneself] with facts.”1  Once the facts have been observed, one can then make conclusions from them.  There are some who have “taken for the material of philosophy either a great deal out of a few things, or a very little out of many things, so that on both sides philosophy is based on too narrow a foundation of experiment and natural history.”2  “The most conspicuous example of [these people is] Aristotle”3, whom is standing before you today.  He attempted to discern truth, but did everything in his head—everything was determined theoretically and never in reality.  He “corrupted natural philosophy with his logic”3 and imposed “countless…arbitrary restrictions on the nature of things.”3  Aristotle indeed made use of experiment in his books, but “having first determined the question according to his will, he then resorts to experience, and bending her into conformity with his placets, leads her about like a captive in a procession.”3  “On this count he is more guilty than his modern followers, the schoolmen”3 and those like his lawyer, “who have abandoned experience altogether.”3

Judge: What have you to say to that, defense?

Thomas Aquinas (Aristotle’s lawyer): On the contrary, The Philosopher says: “The end of theoretical knowledge is truth, while that of practical knowledge is action.”4  I answer that, experiment concerns practical knowledge while, as Mr. Bacon himself says, my client’s philosophy is theoretical.  Therefore, the end of the philosophy of my client is truth and that of Mr. Bacon’s “philosophy” is action.  Experiment may help people in a practical way, but truth is best found by theoretical philosophic considerations.  Using experiment to find theoretical and invisible truth would be most absurd.

Aristotle: I would also like to add that “everyone says something true about the nature of things, and while individually we contribute little or nothing to the truth, by the union of all a considerable amount is amassed.”5  Those who come after build upon the foundations laid by their predecessors, and together we progress toward the truth.

Bacon: “Fruits and works are as it were sponsors and sureties for the truth of philosophies.  Now from all these systems of the Greeks, and their ramifications through particular sciences, there can hardly after the lapse of so many years be adduced a single experiment which tends to relieve and benefit the condition of man”6.  I say that philosophization without experimentation, or improper experimentation, gives very little return.

Aquinas: On the contrary, the fact that one’s method of philosophy fails to give tangible benefit is not a sure sign that one’s philosophy is invalid.  I answer that, even though theology is theoretical we still do not say that it or its notions are false or futile.  Also, the mere exercise of the mind by the utility of the theoretical can sharpen it and improve its potential to benefit humankind.

Bacon: Theology does give both physical and spiritual benefits to a person—it still gives fruit; however any comparison to Aristotle’s philosophy is invalid because theology is a different kind of philosophy.  Regarding mental exercise, it is far better and more efficient to intellectually exercise and at the same time attempt to profit humankind rather than first exercise your mind and then later make discoveries.

Judge: Thank you defense and prosecution.  Now the jury will go into deliberations and we will reconvene when they are finished.

Jury exits…

Euclid: In a given trial, to determine whether a given person is innocent or guilty.  Let Aristotle be the given person and this trial the given trial; thus it is required to determine whether Aristotle is innocent or guilty.  I say that Aristotle is innocent.  For if not, he will be condemned for not procuring all knowledge from experimentation.  But justice cannot be measured by instruments in experiments.  Therefore, Aristotle will be guilty of not experimenting on justice.  Similarly it can be proved that Aristotle would be guilty of not experimenting on mercy, love, and the like, and will be condemned for failing to experiment on things which cannot be experimented on, which is absurd.  Therefore Aristotle is not guilty.  Therefore etc.   Q.E.D.

Descartes:  That’s very nice, Euclid, but I would have to doubt it unless you can prove its reasons.  Doubt is the acid of the mind which cleans off all extraneous and false notions and gives you an unshakable foundation upon which to build.

Sancho Panza: Acid of the mind?  That sounds dangerous!  Won’t that hurt it?  I don’t doubt Don Quixote, I don’t doubt my wife, I don’t doubt my priest, I don’t doubt Senõr curate, I don’t doubt myself, I don’t—

Don Quixote: Please make your point quickly, Sancho.

Sancho: I was only going to say that I don’t doubt anybody unless I know they have lied to me before and I don’t know that Aristotle has lied.  But of course I’ve never read his books—of course, I can’t read either.

Dante: Tradition makes philosophy abound,
Creates the foundations and builds rapport.
Upon this we build, and run not aground.

We doeth not the foundational chore
Or start all over again like Descartes.
But prior men’s writings we do explore,

And then discover things in our art.

Sancho: I don’t care what philosopher so-and-so said who-knows-how-many-years-ago about such-and-such.  What I know is what I experience.  I know that a red sky in the morning means a storm is coming. I know that April showers bring May flowers. I know that rain makes crops grow and hail destroys them.  Experience teaches me, not theoretical philosophers.

Don Quixote: I think we should take a vote now.

Sancho: Do we all get “I Voted” stickers?  I just love those stickers— it’s the small things in life that count, you know, as they say.  I once knew a nice man who liked “I Voted” stickers too—I don’t know him anymore since he died—he had a funeral with lots of food and that’s what makes a good funeral, and even if they don’t have food, I always make sure I go to my friends’ funerals anyway because otherwise they might not come to mine, and—

Don Quixote: Sancho, stop beating around the bush and get to the point, or else we may never finish jury duty!

Sancho: Ok.  Anyway, as I was saying, I once knew a man who collected “I Voted” stickers and counted them as King Midas counted his gold—I did hope he would never be so foolish as to ask that whatever he touched would turn into “I Voted” stickers, but one time—

Don Quixote: Sancho, how you ramble on!  I wish that you would be more like me and make your points quickly enough to not bore your listeners.

Sancho: I shall, master.  I was only asking if we get stickers when we vote.

Don Quixote: I don’t think they have stickers, Sancho.

Sancho: Too bad.  I did hope that—

Don Quixote: Enough, Sancho!

A vote is taken, and then the jury reenters the courtroom as the clock is striking twelve o’clock noon…

Clerk: The jury votes 9 guilty and 3 innocent.

Judge: Aristotle is condemned.  His punishment shall be demotion from Limbo to the City of Dis, the place of heretics—

Don Quixote: Stop!
Jumping out of the jury box, he stands in front of Aristotle and faces the judge…
I shall help the needy, defend the weak, and aid philosophers in distress!  Whoever desires to hurt this innocent man shall have to do single-handed combat with me!

Judge: Order! Order! Order in the—

The court clerk’s cell phone begins to ring “The Lone Ranger” theme song…

Don Quixote: My challenge has been accepted!

The clerk ducks while Quixote slashes at the clerk’s chair, cutting its headrest off.

Don Quixote: “Hold, robber, scoundrel, knave!  I have you now, and your scimitar will not avail you!”7  The whole world shall know that I am the bravest knight ever!

Judge: Stop! — What are you doing, unlawfully disturbing the peace and the lawful proceedings of this court?

Don Quixote: I am not being unlawful; I am only fulfilling my calling as a knight to aid the innocent!  Knights are above the law.  Right now I am doing battle with a knight who desires to hurt Aristotle, the noble father of all true philosophy!
Turning back to the chair…
I’ll get you again, you—

Sancho: But master, that’s an office chair!

Don Quixote: Ah, “I am sure this must be the work of that magician Frestón, the one who robbed me of my study and books [and changed the giants into windmills]; and who has thus changed the [knight into an office chair] in order to rob me of the glory of overcoming [him], so great is the enmity that he bears me, but in the end his evil arts shall not prevail against this trusty sword of mine.”8

Judge: Bailiff, arrest this man who is an enemy of justice and the public!

Sancho: You will “only have to turn him loose again as being a madman.”9

Judge: If he shall return to the jury box and not interfere anymore, I shall be satisfied.

Don Quixote returns to his seat…

Judge: Well then, as I was saying, Aristotle is sentenced to the City of Dis.  Officer Virgil, take custody of him and lead him to fiery sepulcher 1123A straight away.

Aristotle:  This is not justice!  This is not according to the essence of justice!  Retrial! I demand a retrial!

The bailiff, Officer Virgil, leads Aristotle out of the courtroom.

References:
Francis Bacon, The New Organon, Aphorisms, XXXVI
2 Ibid., at LXII
3 Ibid., at LXIII
4 Aristotle, Metaphysics, II.1, line 20
5 Ibid., at line 4
6 Bacon, op. cit., at LXXIII
7 Miguel de Cervantes, The Ingenious Gentleman, Don Quixote de la Mancha, 368
8 Ibid., at 72
9 Ibid., at 483

Posted in humor, philosophy | Tagged , , , , , , | Leave a comment

Volumote coming soon to the marketplace

A few weeks ago, we had the computer playing Christmas music through the stereo system in the living room.  While we were all sitting around talking, the song changed to a much louder one.  I didn’t really want to get up off the couch and walk all the way over to the computer to turn the volume down, so I exclaimed, “Wouldn’t it be nice if I could just use my Windows Phone to turn the volume down?”

Then I paused for a moment.

“Hey, that’s actually not a bad idea!”  I jumped off the couch and ran upstairs, and spent the next few hours hacking together a prototype.  It worked!  I decided this would be a good app to publish to Windows Phone Marketplace, so I started polishing it up and taking it beyond a hack.  You can see the results here, and even give it a spin if you have a Windows Phone.  If you don’t happen to have a Windows Phone, you should really take a look at them the next time you’re due for a new phone. The user experience is fantastic. :D

(I later found out that such apps have been created before, but most of the ones I’ve seen in the marketplace aren’t very polished and/or feel out of place in the Metro interface of Windows Phone.)

 

Posted in projects | Tagged | Leave a comment

Rainbow tables (number systems)

I just finished a discrete mathematics class here at UCSD, and part of the course was on number systems.  I want to share a very interesting technique I invented for taking the complements of numbers, which I and my classmates have found immensely helpful.

Why number complements?  Number complements are important because they allow us to do subtraction through addition. This makes computers cheaper because they eliminate the need for extra hardware to perform subtraction.  If you already know what complements are or just want to see the magic rainbow table in action, feel free to skip to the Rainbow Table section.

Number Complements

There are two complements for binary numbers: ones’ complement and two’s complement.

Ones’ Complement

Ones’ complement is defined as 2k - x - 1, where k is the number of digits and x is the positive number you want the negative version of. Interestingly, this can be easily found by “flipping” all the digits in the original positive binary number.  (We’ve known this for years.)  Make all 1s become 0s, and all the 0s become 1s.  For example, the ones’ complement of 0101 (5) is 1010 (-5 in ones’ comp).  Ones’ complement is nice since it allows us to subtract through addition, but there are a few small problems with it.  First, if you take the binary representation of 0 (0000 if we have 4 digits) and take its one’s complement, you get 1111, or -0.  This doesn’t really make sense, since there is no negative zero.  Second, the addition is a bit more involved than we optimally would like, because you have to add the carry-out digit back on the other side.  For example, let’s say you want to subtract 2 from 3 in ones’ complement binary with 4 bits.  You have:

 111
 0011 (3)
+1101 (-2, one's complement of 2 in binary: 0010)
10000

Everything has to happen inside the 4 digits, so the extra digit on the end is ignored in the final result, but in order to get the proper result in ones’ complement, the carry out digit has to be added back on the other side of the number.  That gives us:

 0000
+   1
 0001

0001 is 1 in binary, which is what we would expect since 3-2=1.

Two’s Complement

Two’s complement is the most widely used way to represent negative numbers in computers. The way you get two’s complement is by taking the value of ones’ complement and adding 1 to it.  For example, the two’s complement of 0101 (5 in binary) is 1010 + 1, or 1011 (-5 in two’s comp).  Two’s complement is better than one’s complement because it allows us to merely add numbers together and not worry about adding the carry out digit back on the other side. It does not have the problem of negative zero. 0000 flipped is 1111 + 1. Adding that gets us 10000, but we ignore the 1 since the number has to fit inside 4 digits. Let’s use the example of subtracting 2 from 3 again to demonstrate two’s complement.  This time, you have:

 11
 0011 (3)
+1110 (-2, two’s complement of 2 in binary: 0010)
10001

We ignore the carry out digit on the left and get 0001 as our answer, as expected.

The generalized version of binary’s ones’ complement is called the diminished radix complement, and the generalized version of binary’s two’s complement is called the radix complement.  This comes from the fact that binary is a base 2, because radix is another word for a number system base.

The Rainbow Table

As it turns out, this idea of number complements goes beyond binary.  In fact, it works with regular decimal numbers too!  The only problem is, how do we “flip” the digits to get the complements for regular decimal numbers?

Enter my invention, the Rainbow Table.
(Not to be confused with the cryptographic rainbow table.)

List all the digits for the base you are working with (in the case of decimal, 0-9) vertically and divide it through the middle horizontally.

partial rainbow tableNow, start at the middle and draw lines between pairs of numbers until there are no more numbers.  This is what it ends up looking like:

The full rainbow tableYou can begin to see why it was aptly named The Rainbow Table by my friend, Vincent Romo. (Hint: it looks like a rainbow turned sideways).

This rainbow table makes complements easy.  To flip a digit, just find the digit in the table and follow its line to the corresponding flipped value.  This gets you nines’ complement (the equivalent of binary’s ones’ complement).  To get ten’s complement, just add 1 like we did earlier for binary’s two’s complement.  Let’s look at the example of 60 – 40 to see ten’s complement in action:

At minimum, we need 3 digits (one digit needs to carry the sign of the number), so let’s pad the numbers with 0‘s.

 060
-040

Now, let’s transform -040 into ten’s complement using the rainbow table.

0 becomes 9
4 becomes 5
0 becomes 9

This gives us 959 as the 3 digit nines’ complement representation of -40. Adding 1 gives us 960 as the 3 digit ten’s complement representation.

Now, we can finally do the subtraction through addition.

 1
 060 (3)
+960
1020

Since we are only working in 3 digits, we ignore the 1 on the end. This gives us 020 (20) as the result, which is what we expected from 60 – 40! How cool is that?

Rainbow Tables and Other Number Bases

Flipping 0s and 1s in binary is just a specialized case of a rainbow table with only 0 and 1:

Binary Rainbow TableIn fact, Rainbow Tables work for all bases.  Hexadecimal, octal, ternary…you name it.  Just list out the digits for that base starting from 0, draw a line through the middle, and draw the rainbow.

Odd Bases

All the number bases discussed so far have been even (i.e. base 2 and base 10).  Base 3 (ternary) is an example of an odd base.  Rainbow Tables for odd bases are pretty much the same as before, with one slight difference – the middle digit stays fixed in the flipping process.  For example, this is a base 3 Rainbow Table:

Ternary Rainbow TableWhen you flip a ternary number, the 1s stay 1′s but everything flips the same way as before – just find the digit and follow the rainbow.  If you aren’t convinced, try some examples.

Conclusion

While you’re not likely to find yourself needing to take the complements of numbers regularly (you’re probably faster at doing regular subtraction), it is still an interesting topic to explore.  Rainbow tables make taking complements quite easy.  Another interesting topic to think about is how to determine the sign of a number in a base other than binary.  (It’s easy in binary, just look at the leftmost digit.  If it is a 1, it’s negative.  If it’s a 0, it’s positive.)  But enough for this post – that would make a good subject for another time.

Posted in academic, computer science, mathematics | Tagged , , , , | 1 Comment