This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Connect asynchronously (new constant for bitwise arg 2: PGSQL_CONNECT_ASYNC) | |
if (!$db = pg_connect($conn_str, PGSQL_CONNECT_ASYNC)) { | |
echo "pg_connect() error\n"; | |
} elseif (pg_connection_status($db) === PGSQL_CONNECTION_BAD) { | |
echo "pg_connect() error\n"; | |
} elseif (!$stream = pg_socket($db)) { | |
echo "pg_socket() error\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
$ npm install request | |
$ node bench.js | |
*/ | |
var request = require('request'); | |
var url = 'http://www.google.com'; | |
var total_requests = 100; | |
var i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove dot segments from a URI path according to RFC3986 Section 5.2.4 | |
* | |
* @param $path | |
* @return string | |
* @link http://www.ietf.org/rfc/rfc3986.txt | |
*/ | |
function removeDotPathSegments($path) { |
OlderNewer