Skip to content

Instantly share code, notes, and snippets.

View moandcompany's full-sized avatar
💭
Meow

Andrew Mo moandcompany

💭
Meow
  • Mo and Company
  • Internet
View GitHub Profile
@moandcompany
moandcompany / machine_server.py
Created February 24, 2017 00:01 — forked from gitpraetorianlabs/machine_server.py
Example code to communicate with "Machine Learning Binaries" technical challenge.
import requests
import logging
import base64
import time
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
class Server(object):
url = 'https://mlb.praetorian.com'
@moandcompany
moandcompany / gist:e75ace3d5094ee8b4e9b5eea5b557163
Created May 9, 2016 06:43 — forked from why-not/gist:4582705
Pandas recipe. I find pandas indexing counter intuitive, perhaps my intuitions were shaped by many years in the imperative world. I am collecting some recipes to do things quickly in pandas & to jog my memory.
"""quick way to create a data frame to try things out"""
df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd'])
df['A'] """ will bring out a col """ df.ix[0] """will bring out a row, #0 in this case"""
"""to get an array from a data frame or a series use values, note it is not a function here, so no parans ()"""
point = df_allpoints[df_allpoints['names'] == given_point] # extract one point row.
point = point['desc'].values[0] # get its descriptor in array form.
@moandcompany
moandcompany / System Design.md
Created April 18, 2016 07:17 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. 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?
set background=dark
syntax on
set showcmd
set cmdheight=1
set laststatus=2
set number
set cursorline