Other
30 min
#Lauter_cky.py | |
#An implementation of a probablistic version of the Cocke-Kasami-Younger | |
#parsing algorithm. | |
#Written in Fall 2011 for the course Language and Computation at Yale University | |
#by Miriam Lauter | |
# | |
#The parser takes a weighted grammar file in Chomsky Normal Form | |
#and a sentence file of sentences to be parsed | |
#and returns all possible parses of each sentence and their weights | |
#I have included the grammar and a sentence file (provided in the assignment) |
import sys | |
from pygments.style import Style | |
#from pygments.token import Keyword, Name, Comment, String, Error, Number, Operator, Generic, Token, Whitespace | |
class BpcTracebackStyle(Style): | |
default_style = "" #put something here? | |
styles = { | |
Comment: 'bold #888', | |
Keyword: 'bold #005', | |
Name: '#f00', |
import requests | |
import random | |
import signal | |
import sys | |
import time | |
from datetime import datetime, timedelta | |
import RPi.GPIO as io | |
import os | |
import glob | |
import json |
(vtctld01.c.etsy-vitess-sandbox.internal) ➜ ~ echo $TOPOLOGY_FLAGS | |
-topo_implementation zk2 -topo_global_server_address vttopo03.c.etsy-vitess-sandbox.internal:2181,vttopo01.c.etsy-vitess-sandbox.internal:2181,vttopo04.c.etsy-vitess-sandbox.internal:2181,vttopo02.c.etsy-vitess-sandbox.internal:2181 -topo_global_root /vitess/global | |
(vtctld01.c.etsy-vitess-sandbox.internal) ➜ ~ vtctl -topo_implementation zk2 -topo_global_server_address vttopo03.c.etsy-vitess-sandbox.internal:2181,vttopo01.c.etsy-vitess-sandbox.internal:2181,vttopo04.c.etsy-vitess-sandbox.internal:2181,vttopo02.c.etsy-vitess-sandbox.internal:2181 -topo_global_root /vitess/global ListAllTablets us_central1_a | |
us_central1_a-0000000001 test_keyspace 00-ff replica vttablet-mysqld001a.c.etsy-vitess-sandbox.internal:15306 vttablet-mysqld001a.c.etsy-vitess-sandbox.internal:3306 [] | |
(vtctld01.c.etsy-vitess-sandbox.internal) ➜ ~ vtctl $TOPOLOGY_FLAGS ListAllTablets us_central1_a | head | |
flag provided but not defined: -topo_implementation zk2 -topo_global |
diff --git a/tool/shard_executor/main.go b/tool/shard_executor/main.go | |
index bfb0e01..95bd568 100644 | |
--- a/tool/shard_executor/main.go | |
+++ b/tool/shard_executor/main.go | |
@@ -111,9 +111,17 @@ func consume(msgs <-chan string, done chan<- bool) { | |
queryType := getQueryType(msg) | |
start := time.Now() | |
- _, err := db.Exec(msg) | |
+ rows, err := db.Query(msg) |
I hereby claim:
To claim this, I am signing this object: