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
Persistent<Context> parser_context = Context::New(); | |
parser_context->Enter(); | |
// json_symbol is just "JSON". parse_symbol is just "parse" | |
Local<Object> JSON = Local<Object>::Cast(parser_context->Global()->Get(json_symbol)); | |
Local<Function> parser = Local<Function>::Cast(JSON->Get(parse_symbol)); | |
//Do parsing here | |
Handle<Value> argv[1]; | |
argv[0] = to_parse; |
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
Persistent<String> callback_symbol; | |
Persistent<String> json_symbol; | |
Persistent<String> parse_symbol; | |
Persistent<Object> module_handle; | |
Persistent<Context> parser_context; | |
Persistent<Function> parserfunc; |
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
“Most of our troubles are due to our passionate desire for and attachment to things that we misapprehend as enduring entities.” ~Dalai Lama | |
If there’s one thing we all have in common it’s that we want to feel happy; and on the other side of that coin, we want to avoid hurting. Yet we consistently put ourselves in situations that set us up for pain. | |
We pin our happiness to people, circumstances, and things and hold onto them for dear life. We stress about the possibility of losing them when something seems amiss. Then we melt into grief when something changes—a lay off, a break up, a transfer. | |
We attach to feelings as if they define us, and ironically, not just positive ones. If you’ve wallowed in regret or disappointment for years, it can seem safe and even comforting to suffer. | |
In trying to hold on to what’s familiar, we limit our ability to experience joy in the present. A moment can’t possibly radiate fully when you’re suffocating it in fear. | |
When you stop trying to grasp, own, and control the world around |
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
“Most of our troubles are due to our passionate desire for and attachment to things that we misapprehend as enduring entities.” ~Dalai Lama | |
If there’s one thing we all have in common it’s that we want to feel happy; and on the other side of that coin, we want to avoid hurting. Yet we consistently put ourselves in situations that set us up for pain. | |
We pin our happiness to people, circumstances, and things and hold onto them for dear life. We stress about the possibility of losing them when something seems amiss. Then we melt into grief when something changes—a lay off, a break up, a transfer. | |
We attach to feelings as if they define us, and ironically, not just positive ones. If you’ve wallowed in regret or disappointment for years, it can seem safe and even comforting to suffer. | |
In trying to hold on to what’s familiar, we limit our ability to experience joy in the present. A moment can’t possibly radiate fully when you’re suffocating it in fear. |
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/sh | |
if [ -z $TASK_DIR ]; then | |
TASK_DIR=$HOME/tasks | |
fi | |
help () { | |
echo "Valid subcommands: create, ls, rm, cat, edit" | |
} |
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
### Keybase proof | |
I hereby claim: | |
* I am sridatta on github. | |
* I am sridatta (https://keybase.io/sridatta) on keybase. | |
* I have a public key whose fingerprint is 8F2C 9E84 F93B 8339 0CF4 CA48 A7EC 4B79 DF82 921D | |
To claim this, I am signing this 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
def process_list_2(list_of_items): | |
s = set() | |
rv = [] | |
for item in list_of_items: | |
if item not in s: | |
rv.append(item) | |
return s |
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 argparse | |
from sklearn.model_selection import validation_curve, GridSearchCV, learning_curve, train_test_split | |
from sklearn.metrics import make_scorer, accuracy_score, f1_score, confusion_matrix | |
from sklearn.pipeline import Pipeline | |
from sklearn.preprocessing import StandardScaler | |
from sklearn import datasets | |
from sklearn import tree | |
import numpy as np | |
from collections import namedtuple | |
import matplotlib.pyplot as plt |