Skip to content

Instantly share code, notes, and snippets.

@erikfrey
erikfrey / merge_ldb.cpp
Created September 3, 2012 17:17
merge leveldbs
/*
* given a list of input leveldb's, merge them into a single output leveldb
*
*/
#include <iostream>
#include <algorithm>
#include <boost/program_options.hpp>
#include <boost/cstdint.hpp>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <boost/array.hpp>
#include <boost/bind.hpp>
#include <boost/asio.hpp>
namespace posix = boost::asio::posix;
class echo_client
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <boost/array.hpp>
#include <boost/bind.hpp>
#include <boost/asio.hpp>
namespace posix = boost::asio::posix;
class posix_chat_client
erik@roastbeef:~/proj$ time node child.js < bigfile > derp
real 0m6.176s
user 0m4.176s
sys 0m1.916s
erik@roastbeef:~/proj$ time cat bigfile | node child.js | cat > derp
real 0m1.504s
user 0m0.560s
sys 0m0.892s
@erikfrey
erikfrey / gist:1164496
Created August 23, 2011 06:41
node readline
erik@roastbeef:~/proj$ cat child2.js
var readline = require('readline'),
rl = readline.createInterface(process.stdin, process.stdout);
rl.on('line', function(line) {
console.log(line);
});
erik@roastbeef:~/proj$ time node child2.js < bigfile > derp
@erikfrey
erikfrey / gist:1164469
Created August 23, 2011 06:18
python, c++, node on stdio
erik@roastbeef:~/proj$ cat child.py
import sys
line = sys.stdin.readline()
while line:
line = sys.stdin.readline()
erik@roastbeef:~/proj$ time python child.py < bigfile > derp
real 0m0.073s
user 0m0.056s
>>> not None
True
>>> True is not None
True
>>> not not None
False
>>> False is not not None
File "<stdin>", line 1
False is not not None
^
>>> not None
True
>>> True is not None
True
>>> not not None
False
>>> False is not not None
File "<stdin>", line 1
True is not not None
^
>>> not None
True
>>> True is not None
True
>>> not not None
False
>>> True is not not None
File "<stdin>", line 1
True is not not None
^
Philosophy - Wikipedia, the free encyclopedia
Modern philosophy - Wikipedia, the free encyclopedia
Property (philosophy) - Wikipedia, the free encyclopedia
Quantity - Wikipedia, the free encyclopedia
Mathematics - Wikipedia, the free encyclopedia
Finite set - Wikipedia, the free encyclopedia
Information - Wikipedia, the free encyclopedia
Fact - Wikipedia, the free encyclopedia
Knowledge - Wikipedia, the free encyclopedia
Science - Wikipedia, the free encyclopedia