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
-- Create a table that will contain all the JSON object keys | |
CREATE TABLE KEYS (attrname STRING, expr STRING); | |
INSERT INTO KEYS | |
SELECT DISTINCT(e.key), e.fullkey AS key | |
FROM json_each(log.line) e, log; | |
-- Generate the CREATE TABLE with all the JSON object keys | |
.once eval.sql | |
SELECT 'CREATE TABLE exploded (k_' || group_concat(attrname,' TEXT, k_') || ' TEXT);' | |
FROM (SELECT attrname FROM keys); |
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
final IsEqual<Boolean> passwordCheckIsEqual = new IsEqual<Boolean>() { | |
@Override | |
public boolean apply(final Boolean control, final Boolean experiment) { | |
final List<String> mismatches = new ArrayList<>(); | |
final IsEqualUtil.MismatchConsumer consumer = IsEqualUtil.consumeToList( | |
mismatches); | |
final boolean success = checkNullity(control, experiment, consumer) | |
&& startCompare(consumer) | |
.dotEquals(control, experiment, "checkmatches") | |
.get(); |
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
final IsEqual<Throwable> makeBothOrNeitherThrow = new IsEqual<Throwable>() { | |
@Override | |
public boolean apply(final Throwable control, final Throwable experiment) { | |
final boolean result = ((control == null) == (experiment == null)); | |
if (!result) { | |
/// log relevant info to Kafka | |
} | |
return result; | |
} | |
}; |
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
final ThreadPoolExecutor experimentExecutor = new ThreadPoolExecutor( | |
1, 1, 0, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1)); | |
trial = new Trial( | |
experimentExecutor, | |
metricRegistry, | |
"password.succession", | |
() -> WhichReturn.valueOf(featureService.getFeature("password.succession")), | |
Trial.IDENTITY_WRAPPER, hibernateWrapper); |
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
final Observable<Boolean> result = trial.doTrial( | |
control, experiment, trialIsEqual, "checkpassword"); |
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
final IsEqual<TrialResult<Boolean>> trialIsEqual = Trial.makeIsEqual( | |
bothOrNeitherThrow, passwordCheckIsEqual.pairwiseEqual()); |
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
final Callable<Observable<Boolean>> control = | |
() -> oldPasswordCeckingApi.matches(username, password); | |
final Callable<Observable<Boolean>> experiment = | |
() -> authService.doPasswordCheck(username, password); |
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
[ see https://github.com/drewcsillag/rebaseit ] | |
[note | |
gls = git log --format='format:%h : %s' | |
] | |
This is a theoretical example based off of real events. | |
So I'm in my git repo for my project and I start doing work. | |
Because git is awesome and I do stupid things, I commit *all* the | |
time. Between refactoring passes and tests passing, I just | |
commit, because editor undo only goes so far sometimes. Not only |
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 purge lxc-docker lxc-docker-1.3.1 | |
sudo rm -rf /var/lib/docker | |
sudo sppuppet agent -t -v |
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
etcd --name=localkubernetes & | |
kubelet -etcd_servers=http://localhost:4001 & | |
apiserver -etcd_servers=http://localhost:4001 machine_list=localhost:10250 & | |
...more servers here... | |
echo "Press enter to stop everything>!" | |
read blah |