Skip to content

Instantly share code, notes, and snippets.

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
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
### 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:
@sridatta
sridatta / task
Last active August 29, 2015 13:56 — forked from anonymous/task
A simple file-based task manager in Bash
#!/bin/sh
if [ -z $TASK_DIR ]; then
TASK_DIR=$HOME/tasks
fi
help () {
echo "Valid subcommands: create, ls, rm, cat, edit"
}
“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.
“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
Persistent<String> callback_symbol;
Persistent<String> json_symbol;
Persistent<String> parse_symbol;
Persistent<Object> module_handle;
Persistent<Context> parser_context;
Persistent<Function> parserfunc;
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;