Blog | Admin | Archives | Random | Recent | Thanks
    • #howellfest #IOW
    • The shape shifters in their usual form.
    • Clippering under moody clouds.
    • 🌊

The Hobbit & High Frame Rate

Today I went to the Metreon 16 Cinemas in Downtown San Francisco to watch the Hobbit with my CSE buddy Jonathan and another friend of his. We selected a show that boasted enhanced sound, a larger screen, high frame rate, and of course 3D.

First off, the movie was pretty bad. I would not recommend watching this for the movie itself. It dragged on with superfluous content that didn’t advance the stories or characters and seemed primarily designed to justify turning the book into three movies. The best part of the movie,  by far, you can see without even going the the theater — it was released as a trailer, below:

Save yourself the money and just watch that a few times unless you’re really interested in the latest movie technology.

Despite being a failure as a compelling telling of a story, the movie was a success in one way: it was a technological tour de force. What intrigued me the most about the billing was the high frame rate (HFR), a doubling of the normal 24 frames per second of traditional cinema to 48 frames per second. I was watching for it and the result is very good: the many big camera pans over lush landscapes appeared much smoother and much nicer visually. I’ve always been distracted by the jerkiness of 24 frame per second movies during panning. I hope this or an even higher frame rate becomes the new norm.

Again, the technology really shined in the sound arena as well. Apart from being considerably too loud — which I blame the theater for, not the movie — the sound system was still the best I’ve encountered. At one point, in a cave full of snoring dwarves, we all thought we heard someone directly to our right start snoring (Jonathan even turned to see if it was me!). Alas, it was just a better-than-average sound localization. Listening more carefully, I definitely could localize sounds to specific places in the theater much better than I recall being possible normally.

The 3D with the circularly polarized glasses was excellent as usual.

Too bad the movie sucked.

Where is the missing library supposed to live?

For about a month, I was living with a constant stream of warnings whenever I ran a common command at work. While it didn’t make me less productive, since it didn’t affect any functionality I needed, it annoyed me and it bothered me that I didn’t know how to fix it the right way. The error I was getting was a warning about a dynamic library not able to be loaded even though the library existed on the system. Furthermore, when I ran `ldd` on the binary, the dynamic library wasn’t listed.

A quick hack was to find the library and set LD_LIBRARY_PATH to override the normal include paths. However, this didn’t work for automated scripts run from cron without some wrapper to set up the environment, and it felt very hacky anyway. What I wanted to do is find where the system was looking for the library that it couldn’t find so I could put the library in the right place (or at least set up a symlink).

Today, I decided to figure it out, and through some searching I came across this treasure trove that exactly explained the problem and the solution.  Basically, the issue is that linux binaries (including libraries) have an rpath where they look for their shared objects. Setting LD_LIBRARY_PATH overrides this, but as I said, it’s a hack. To figure out the rpath, simply run:

readelf -d <path/to/binary> | grep RPATH

You can run this on any executable or library, so even if a library includes another library, you can just follow the path down until you find where the system is looking for the missing library and fix the problem.

Instantly Social

Facebook’s announcements at f8 earlier today have made socializing any website trivial — instantly. You don’t even need to know how to program. Just add an iframe — one line of html — and you can make your website have an instant social presence. I hacked in the widget just now on my site in a matter of minutes.

This is the one line I added to my blog’s template, in single.php:

<iframe src=";href=<?php
the_permalink() ?>" frameborder="0" scrolling="no" height="61"></iframe>

MySQL Conference Day 1

My first day at my first MySQL conference was a riotous success. I attended the “State of the Dolphin” keynote followed by talks given by Tim O’Reilly and Facebook’s own Mark Callaghan, who also won a MySQL Community Member of the Year Award during the opening talks. Congrats to Mark!

After the Keynotes, I synced up with other Facebookers at our expo hall booth, and then I went to Domas Mituzas’ talk on “High Concurrency MySQL”. The ballroom couldn’t hold all the people who wanted to watch — there was actually a line outside the door of people listening in on his talk! Although I wouldn’t suggest Domas give up his day job to write slides full-time, he had a great presentation overall that kept the audience interested and engaged.

Next, I attended a presentation on Sqoop by my two-time TA at the UW and now Cloudera co-founder and presenter extraordinaire, Aaron Kimball. Sqoop is a SQL-to-Hadoop translation layer that automates many of the steps of shuttling data from OLTP stores to HDFS for analytics. It is open source and Aaron is it’s primary developer. You can check out the code on github, or use it as part of Cloudera’s Hadoop Distribution.

After lunch, I went to a presentation by Lars Thalmann on new MySQL replication features in 5.1 and 5.5. Lead replication developer Mats Kindall was also there to answer questions. It’s good to see that MySQL is making progress on replication, but it is still woefully limited in a number of ways: not crashproof, single-threaded, and difficulty in replicating to non-MySQL data stores are all weak points of MySQL’s replication system today. These are all on the roadmap, but from the answers to my questions, I got the impression that these ideas are still mostly bullet points on a slide rather than almost-features in MySQL.

Make no mistake, these features are hard to add — I’ve dabbled around in the area myself — and it took Mark a concerted effort to port rpl_transaction_enabled from our 5.0 patch to Facebook’s 5.1 patch. Still, I hope MySQL takes the rpl_transaction_enabled patch and  into 5.1 or 5.5 officially, because in any large deployment, it is incredibly useful to not manually intervene when a slave crashes.

After the replication talk, I went back to the expo hall to talk with people, then I hacked on MySQL in the afternoon. Could there possibly be a better venue for this? Two (small) diffs later, and I was back into the expo hall socializing/recruiting for Facebook. The night ended well with a trip to In-and-Out.

MySQL Conference Begins Tomorrow

The 2010 O’Reilly MySQL Conference starts tomorrow in Santa Clara. Facebook’s Database Engineering team (which includes me!) will be there along with some of our Operations team and our one-man Performance team. Each team will be giving a talk at the conference:

On Tuesday, the Database Performance Team will be presenting on “High Concurrency MySQL.” Domas is an interesting, animated fellow, and I imagine that his talk will be quite entertaining as well as informative.

On Wednesday, the Database Operations Team will be speaking about Database Operations at Scale. Our DB Ops guys are some of the best in the business; they keep our database tiers, which are often under enormous pressure from growth and changing requirements, running remarkably well.

On Thursday, Mark Callaghan, Ryan Mack, and I will be presenting our talk on High-throughput MySQL (we claim that Domas stole our title rather than the other way around). Mark Callaghan is one of the leading advocates for MySQL at Facebook and in the MySQL community. Working with him and the original Ryan (as I call Ryan Mack, who preceded me on this team) has been nothing short of an extraordinary opportunity for me to learn from the best.

On Password Restrictions

Websites should list their password restrictions on their login pages. Sometimes I run into the following problem:

I try to use a password generated by my “standard model” — ie, a standard prefix depending on the nature of the site and some salt determined by the website itself. However, some sites have stupid rules on their password requirements. In real life, I have encountered a wide variety of password requirements:

  • A requirement of an exactly 6-character password
  • A prohibition on “special characters” like any of !@#$%^&*()+=></?{}[]|\/.
  • A requirement for a special character that happens to be one of !@#$%^&*()
  • A requirement for numbers, uppercase, and lower case in the password
  • A requirement for two sets of letters and numbers in the password — ie, fit the regex /([a-zA-Z]+[0-9]+){2}/

When my standard model password doesn’t fit into one of the more esoteric requirements, I have to modify it to fit. Fortunately, I find that on this subject at least, I tend to think the same way over time, so, given the standard model and a set of constraints, I will usually come up with the same password. However, it is uncommon for websites to list their password constraints on the log-in page. Therefore, I will usually try the standard model password first, and only when that fails twice (in case I mistyped the first time), and I’m down to one more try, do I realize that this website might be “special.”

Then I have to go to the trouble to find out what the password requirements are. This is not difficult — usually it involves clicking the “sign up button” and reading a little bit — but it does take some time and it is very annoying. Listing the password requirements at the login screen would make for a much better user experience (since it is so easy to find this information, not displaying it on the login screen can’t be interpreted as a security measure either).

Of course, the real solution is for websites to get rid of their inane password requirements, so I never have to deviate from the standard model.

Safety Agains Reopen

What does this comment in the MySQL source mean? (, 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.