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
syntax = "proto3"; | |
package lw; | |
service GreeterService { | |
rpc SayHello (HelloRequest) returns (HelloResponse) {} | |
} | |
message HelloRequest { | |
string name = 1; |
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
#!/bin/bash | |
# Usage: ./watch.sh watch_id path_to_watch | |
touch "/tmp/watch_${1}_1" | |
ls -x > "/tmp/watch_${1}_2" | |
cat "/tmp/watch_${1}_1" "/tmp/watch_${1}_2" | sort | uniq | |
mv "/tmp/watch_${1}_2" "/tmp/watch_${1}_1" |
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
'use strict' | |
var asyncHooks = require('async_hooks') | |
var ids = new Map() | |
var toReturn | |
var noopHook = asyncHooks.createHook({ | |
init: function initHook(id, type) { | |
if (type !== 'PROMISE') { | |
return | |
} |
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 <cctype> | |
#include <iostream> | |
#include <string> | |
int get_int(const std::string& str, std::size_t& i) { | |
int val = 0; | |
for (; i < str.size() && std::isdigit(str.at(i)); ++i) { | |
val *= 10; |
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
enum class Type : int { | |
Song, | |
Artist, | |
Release, | |
Playlist | |
}; | |
static const std::map< Type, std::string > TypeStrings{ | |
{ Type::Song, "song" }, |
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
natalie@WorkBook:funcSpeed$ g++ -std=c++11 test.cpp main.cpp -o funcSpeed && ./funcSpeed | |
--- Direct Call Tests --- | |
testInline 9317ms. | |
testExternal 9433ms. | |
tester.testInlineMember 9252ms. | |
tester.testExternalMember 9328ms. | |
--- Pointer Call Tests --- | |
(&testInline) 9401ms. | |
(&testExternal) 9642ms. | |
(tester.*(&Test::testInlineMember)) 9515ms. |