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 <mutex> | |
#include <thread> | |
#include <async> | |
using namespace std; | |
template <typename T> | |
struct locked_queue | |
{ | |
typedef lock_guard<mutex> lock_guard; |
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 <map> | |
#include <vector> | |
#include <string> | |
#include <future> | |
#include <numeric> | |
#include <iterator> | |
#include <boost/lexical_cast.hpp> | |
using namespace std; | |
using boost::lexical_cast; |
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 <map> | |
#include <vector> | |
#include <string> | |
#include <future> | |
#include <boost/lexical_cast.hpp> | |
using namespace std; | |
using boost::lexical_cast; | |
typedef map<string, string> object; |
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
struct echo_service | |
{ | |
struct handler : public handler_base | |
{ | |
handler(ip::tcp::socket& socket) : handler_base(socket) {} | |
void handle_data(const std::string& readbuf) | |
{ | |
io::async_write(socket_, buffer(readbuf), ignore()); | |
} |
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 <cstdlib> | |
#include <iostream> | |
#include <boost/coroutine/all.hpp> | |
using namespace boost::coroutines; | |
using namespace std; | |
int main() | |
{ | |
coroutine< int() > c( |
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 <cstdlib> | |
#include <iostream> | |
#include <boost/coroutine/all.hpp> | |
using namespace boost::coroutines; | |
using namespace std; | |
int main() | |
{ | |
coroutine< int() > c( |
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
## The enabled Yokozuna set this 'on'. | |
yokozuna = off | |
## The port number which Solr binds to. | |
yokozuna.solr_port = 8093 | |
## The port number which Solr JMX binds to. | |
yokozuna.solr_jmx_port = 8985 | |
## The arguments to pass to the Solr JVM. Non-standard |
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
simple_test() -> | |
{ok, EC} = erasuerl:new(), | |
{ok, Bin} = file:read_file("/usr/share/dict/words"), | |
{MD, KBins, MBins} = erasuerl:encode(EC, Bin), | |
[K1, K2, K3, K4, K5, K6, K7, K8, K9] = KBins, | |
[M1, M2, M3, M4] = MBins, | |
KBins2 = [undefined, undefined, undefined, K4, K5, K6, K7, K8, K9], | |
MBins2 = [undefined, M2, M3, M4], | |
Bin = iolist_to_binary(erasuerl:decode(EC, MD, KBins2, MBins2)). |
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
➜ riak git:(jrw-dynamic-ring) ✗ bin/riak-admin cluster resize-ring 128 | |
Success: staged resize ring request with new size: 128 | |
➜ riak git:(jrw-dynamic-ring) ✗ bin/riak-admin cluster plan | |
=============================== Staged Changes ================================ | |
Action Details(s) | |
------------------------------------------------------------------------------- | |
resize-ring 64 to 128 partitions | |
------------------------------------------------------------------------------- |
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
import Data.List | |
myalist = [("foo", (1, 2))] | |
getFirst :: String -> [(String, (Int, Int))] -> Maybe Int | |
getFirst key alist = fmap fst $ lookup key alist | |
-- shouldn't this work? | |
getFirst' :: String -> [(String, (Int, Int))] -> Maybe Int |
NewerOlder