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
//Build this with something like: g++ json_serializer.cpp -std=c++11 -I/usr/include | |
//Requires you at least have boost base library | |
#include <ostream> | |
#include <boost/variant.hpp> | |
#include <memory> | |
#include <string> | |
#include <cinttypes> | |
#include <cstddef> | |
#include <unordered_map> |
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
#ifndef __LOGGING_HPP__ | |
#define __LOGGING_HPP__ | |
/* | |
Test this with something like: | |
g++ -std=c++11 -x c++ -pthread -DLOGGING_LEVEL_ALL -DTEST_LOGGING logging.hpp -o logging_test | |
./logging_test | |
*/ | |
#include <string> |
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
#ifndef __TESTING_HPP__ | |
#define __TESTING_HPP__ | |
/* | |
* Test this with something like: | |
* g++ -std=c++11 -x c++ -DTEST_TESTING testing.hpp -o testing_test | |
* ./testing_test | |
*/ | |
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
cat <<EOF > ~/.gdbinit | |
set history save | |
set history size 10000 | |
set history filename ~/.gdb_history | |
define f | |
finish | |
end | |
document f | |
Step out of a function, finish it |
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
#include <fstream> | |
#include <string> | |
#include <iostream> | |
#include <cinttypes> | |
#include <utility> | |
#include <algorithm> | |
#include <unordered_map> | |
#include <unordered_set> | |
#include <list> |
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
/* | |
sudo apt-get install libkyotocabinet-dev | |
g++ kyotocabinet_hash_map_test.cpp -o kyotocabinet_hash_map_test -std=c++11 -O2 -lkyotocabinet | |
./kyotocabinet_hash_map_test 500000 | |
./kyotocabinet_hash_map_test 500000 threaded_read | |
*/ | |
#include <fstream> | |
#include <string> | |
#include <iostream> |
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
/* | |
g++ sequence.cpp -o sequence -std=c++11 -O2 | |
./sequence_t 100000000 | |
*/ | |
#include <iostream> | |
#include <cstring> | |
#include <chrono> | |
#include <fstream> |
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
/* install libzmq-dev: | |
* | |
* wget http://download.zeromq.org/zeromq-4.1.0-rc1.tar.gz | |
* tar pxvf zeromq-4.1.0-rc1.tar.gz | |
* cd zeromq-4.1.0 | |
* ./autogen.sh | |
* ./configure | |
* make | |
* sudo make install | |
* |
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
/* | |
* sudo apt-get install memcached libmemcached-dev libboost-all-dev | |
* have a look in /etc/memcached.conf and set some reasonable defaults | |
* changed the following: | |
* -m 4096m -I 10m | |
* | |
* sudo service memcached restart | |
* | |
* g++ memc.cpp -o memc -std=c++11 -g -O2 -lboost_system -lboost_filesystem -lmemcached | |
* memc /some/directory/with/files 2147483648 |
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
/* | |
* sudo apt-get install libboost-all-dev | |
* #if you want to mmap more files than what `sysctl vm.max_map_count` says | |
* sudo sysctl -w vm.max_map_count=some_larger_number | |
* g++ blob_cache.cpp -o blob_cache -std=c++11 -g -O2 -lboost_system -lboost_filesystem | |
* blob_cache /some/directory/with/files 1073741824 | |
* blob_cache /some/directory/with/files 1073741824 mm | |
*/ | |
#include <boost/filesystem.hpp> |
OlderNewer