Introduce QueryFuture

Summary:
This supports four ways for executing queries against MySQL:

# [[ http://php.net/mysqli.poll | Async queries ]]
# [[ https://github.com/facebook/hiphop-php/blob/363d1bb20fe84b4cdc2dc0f4c7b1dd39d167a1f5/hphp/idl/fb.idl.php#L911 | Parallel queries ]]
# Multi queries: [[ http://php.net/mysqli.multi_query | PHP ]], [[ https://github.com/facebook/hiphop-php/blob/363d1bb20fe84b4cdc2dc0f4c7b1dd39d167a1f5/hphp/idl/mysql.idl.php#L757 | HPHP ]]
# Plain old single queries

This is just a rough concept, I'll improve it later.

Test Plan:
  $result = id(new QueryFuture($conn, 'SELECT 1'))->resolve();
  print_r($result);

  $futures = array(
    new QueryFuture($conn, 'SELECT 1'),
    new QueryFuture($conn, 'SELECT 2'),
  );
  foreach (Futures($futures) as $future) {
    print_r($future->resolve());
  }

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5025
Fix problems with QueryFuture in HPHP

Summary:
`fb_parallel_query()` has a weird semantics for indexing results.
Also, it doesn't support queries with different columns.
`mysql_fetch_result()` raises warning if there's an error.

Test Plan:
  $futures = array(
    new QueryFuture($conn, 'SELECT 1'),
    new QueryFuture($conn, 'SELECT 2 FROM x'),
    new QueryFuture($conn, 'DO 3'),
  );
  foreach (Futures($futures) as $future) {
    try {
      $future->resolve();
      print_r($future->resolve());
    } catch (Exception $ex) {
      echo $ex->getMessage()."\n";
    }
  }

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5057
Move hgsprintf to libphutil

Summary: For simpler linting. Also fix an issue where we throw when loading a library with an out-of-date file in its map.

Test Plan: unit

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D5059
Increase the size of infinity in PhabricatorEditDistanceMatrix

Summary: See D5032.

Test Plan: Unit tests.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D5063
Print info about lint profiler

Test Plan:
  $ arc --trace lint

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5076
Take blocks into account into Diviner highlighter

Summary: This is still far from ideal but at least solves the pretty common use of code block with C++-style comments in Remarkup.

Test Plan:
  lang=plain
  lang=remarkup
  a//b//

    a // a
    b // c

  //d
  e//

  //f

  g//

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5094