You can find this at: http://bit.ly/morrita-gist-30-links
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 pandas as pd | |
import json | |
import sys | |
import datetime as dt | |
data = json.load(open(sys.argv[1])) | |
df = pd.DataFrame(data["entries"]) | |
df['date'] = pd.to_datetime(df['date']) |
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 json | |
import sys | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
from optparse import OptionParser | |
def make_dataframe(raw_events, name): | |
#start_ts = {} | |
filtered = [ dict(e.items() + e["args"].items()) for e in raw_events if e["name"] == name ] |
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/env python | |
import json | |
import sys | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
def delay_of(sync, chrd): | |
ret = [] | |
si = 0 |
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
qplot(x=year, y=injuries, data=t_per_year, geom="bar", stat="identity") |
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
status_t InputConsumer::consume(InputEventFactoryInterface* factory, | |
bool consumeBatches, nsecs_t frameTime, uint32_t* outSeq, InputEvent** outEvent) { | |
... | |
*outSeq = 0; | |
*outEvent = NULL; | |
// Fetch the next input message. | |
// Loop until an event can be returned or no additional events are received. | |
while (!*outEvent) { | |
if (mMsgDeferred) { | |
... |
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
int NativeInputEventReceiver::handleEvent(int receiveFd, int events, void* data) { | |
.... | |
if (events & ALOOPER_EVENT_INPUT) { | |
JNIEnv* env = AndroidRuntime::getJNIEnv(); | |
status_t status = consumeEvents(env, false /*consumeBatches*/, -1, NULL); | |
mMessageQueue->raiseAndClearException(env, "handleReceiveCallback"); | |
return status == OK || status == NO_MEMORY ? 1 : 0; | |
} |
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
status_t NativeInputEventReceiver::consumeEvents(JNIEnv* env, | |
bool consumeBatches, nsecs_t frameTime, bool* outConsumedBatch) { | |
.... | |
ScopedLocalRef<jobject> receiverObj(env, NULL); | |
bool skipCallbacks = false; | |
for (;;) { | |
uint32_t seq; | |
InputEvent* inputEvent; | |
status_t status = mInputConsumer.consume(&mInputEventFactory, |
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
IPC_MESSAGE_ROUTED4(ExtensionMsg_Response, int , bool , base::ListValue , std::string ) | |
IPC_MESSAGE_ROUTED5(ExtensionMsg_MessageInvoke, std::string , std::string , std::string , base::ListValue , bool ) | |
IPC_MESSAGE_CONTROL1(ExtensionMsg_SetFunctionNames, std::vector<std::string>) | |
IPC_MESSAGE_CONTROL2(ExtensionMsg_SetSystemFont, std::string , std::string ) | |
IPC_MESSAGE_CONTROL1(ExtensionMsg_ActivateExtension, std::string ) | |
IPC_MESSAGE_CONTROL1(ExtensionMsg_Loaded, std::vector<ExtensionMsg_Loaded_Params>) | |
IPC_MESSAGE_CONTROL1(ExtensionMsg_Unloaded, std::string) | |
IPC_MESSAGE_CONTROL1(ExtensionMsg_SetScriptingWhitelist, extensions::ExtensionsClient::ScriptingWhitelist) | |
IPC_MESSAGE_ROUTED1(ExtensionMsg_ExecuteCode, ExtensionMsg_ExecuteCode_Params) | |
IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdateUserScripts, base::SharedMemoryHandle) |