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
client → write request → zk_server_1 | |
↓ | |
↓ | |
write request is sent to the leader | |
↓ | |
↓ | |
leader fans out a transaction proposal to all followers | |
↓ | |
↓ | |
↓ ↓ ↓ ↓ |
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
def gen(v) | |
if v.length == 1 | |
yield v | |
end | |
v.each { |i| | |
gen(v.slice(1, v.length)) { |v1| | |
yield [i] + v1 | |
} | |
} | |
end |
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
def gen(v) | |
if v.length == 1 | |
yield v | |
end | |
v.each { |i| | |
gen(v.select { |j| j != i }) { |v1| | |
yield [i] + v1 | |
} | |
} | |
end |
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
✔ ruby gen.rb mi nombre es alki | |
mi nombre es alki | |
mi nombre alki es | |
mi es nombre alki | |
mi es alki nombre | |
mi alki nombre es | |
mi alki es nombre | |
nombre mi es alki | |
nombre mi alki es | |
nombre es mi alki |
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 <ctype.h> | |
#include <stdio.h> | |
#include <string.h> | |
static int match(const char *query, const char *username); | |
static void do_search(const char *query, char **usernames, int ulen); | |
static int lex_smaller(const char *a, const char *b); | |
void typeahead(char **usernames, int usernames_length, char **queries, int queries_length) { | |
int 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
diff --git a/kazoo/tests/test_client.py b/kazoo/tests/test_client.py | |
index 2c7dcd16bf3b..a2c670dac6ea 100644 | |
--- a/kazoo/tests/test_client.py | |
+++ b/kazoo/tests/test_client.py | |
@@ -1,3 +1,4 @@ | |
+import socket | |
import sys | |
import threading | |
import time | |
@@ -222,7 +223,7 @@ class TestConnection(KazooTestCase): |
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
commit ff99c46b4db900ca7710771a7f7cb5f65e3416e9 | |
Author: Raul Gutierrez S <rgs@itevenworks.net> | |
Date: Fri Apr 25 14:06:20 2014 -0700 | |
Reset watches when entering CONNECTED state | |
Signed-off-by: Raul Gutierrez S <rgs@itevenworks.net> | |
diff --git a/kazoo/client.py b/kazoo/client.py | |
index fb32b97782a5..45908dfad167 100644 |
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
/* | |
* Local Variables: | |
* compile-command: "gcc -Wall -I/usr/include/zookeeper -lzookeeper_mt states.c -o states" | |
* End: | |
*/ | |
#include <errno.h> | |
#include <pthread.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
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
#!/usr/bin/python 2.7 | |
from __future__ import print_function | |
from cmd import Cmd | |
from functools import partial | |
import readline | |
class Param(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
#!/usr/bin/python 2.7 | |
from __future__ import print_function | |
from cmd import Cmd | |
from functools import partial | |
import readline | |
class CompleteParam(object): |
OlderNewer