This file contains hidden or 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
WEBVTT | |
00:11.000 --> 00:13.000 | |
<v Roger Bingham>We are in New York City | |
00:13.000 --> 00:16.000 | |
<v Roger Bingham>We’re actually at the Lucern Hotel, just down the street | |
00:16.000 --> 00:18.000 | |
<v Roger Bingham>from the American Museum of Natural History |
This file contains hidden or 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
from random import random | |
inp = open("input.txt", "r") | |
single = inp.readline().strip() == 'SINGLE' | |
white = inp.readline().strip() == 'WHITE' | |
remain_time = float(inp.readline().strip()) | |
board = [] | |
for i in range(8): | |
board.append( inp.readline().lstrip() ) | |
inp.close() |
This file contains hidden or 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
# vim:ft=zsh ts=2 sw=2 sts=2 | |
# | |
# agnoster's Theme - https://gist.github.com/3712874 | |
# A Powerline-inspired theme for ZSH | |
# | |
# # README | |
# | |
# In order for this theme to render correctly, you will need a | |
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts). | |
# Make sure you have a recent version: the code points that Powerline |
- Process related command
- top - real time view of all process running
- ps -aus - snapshot of all process running
- kill -9 PID - kill a process with PID as process id.
- nohup cmd > logs.out & - Run a process in background and deattach from terminal.
- screen - Start a screen terminal (-r restore, -ls view, Ctrl-A + d deattach screen)
- Filesystem related
- ls -la - list all files in current directory
- **wc -l ** - Count number of lines in a file
This file contains hidden or 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
# Decile chart, LIFT, KS | |
def getDeciles(models, X, y, n=10): | |
probs = predict_probas(gbms,X)[:,1] | |
cuts = pd.qcut(probs,n) | |
df = pd.DataFrame({'DECILE':cuts,"P":probs,'Y':y}).groupby('DECILE').Y.value_counts().unstack(fill_value=0)[::-1] | |
df.index = [ f"{i+1} {df.index[i]}" for i in range(n) ] | |
df.columns = ['ZEROS','ONES'] | |
df['POPULATION'] = df.ZEROS+df.ONES | |
df['EVENT_RATE'] = df.ONES/df.POPULATION | |
df['CUMULATIVE_EVENT_RATE'] = df.ONES.cumsum()/df.POPULATION.cumsum() |
This file contains hidden or 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
from flask import Flask, request | |
from werkzeug import secure_filename | |
import os | |
app = Flask(__name__) | |
app.config['UPLOAD_FOLDER'] = os.path.join(app.root_path,'uploads/') | |
if not os.path.exists(app.config['UPLOAD_FOLDER']): os.mkdir(app.config['UPLOAD_FOLDER']) | |
def make_page(notification=""): | |
return f""" |
This file contains hidden or 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 settleDebt(debt_dict): | |
""" | |
Function to settle debt among group of people | |
Parameters | |
---------- | |
debt_dict : dictionary of names and debt(expenses-paid) | |
sum of debts should be approximately zero | |
-ve means negative debt, +ve means positive debt | |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
This file contains hidden or 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
from bs4 import BeautifulSoup | |
import urllib3 | |
import re | |
import pandas as pd | |
http = urllib3.PoolManager() | |
link = "https://www.sitejabber.com/reviews/dream11.com" | |
#making http get request |
NewerOlder