Skip to content

Instantly share code, notes, and snippets.

View cadrev's full-sized avatar

Felan Carlo Garcia cadrev

View GitHub Profile
@cadrev
cadrev / 2.ipynb
Created December 16, 2015 14:24 — forked from karlnapf/2.ipynb
Machine learning assignment 2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Putting wings on the Elephant

[operating-hadoop]

HBase is used widely at Facebook and one of the biggest usecase is Facebook Messages. With a billion users there are a lot of reliability and performance challenges on both HBase and HDFS. HDFS was originally designed for a batch processing system like MapReduce/Hive. A realtime usecase like Facebook Messages where the p99 latency can`t be more than a couple hundreds of milliseconds poses a lot of challenges for HDFS. In this talk we will share the work the HDFS team at Facebook has done to support a realtime usecase like Facebook Messages : (1) Using system calls to tune performance; (2) Inline checksums to reduce iops by 40%; (3) Reducing the p99 for read and write latencies by about 10x; (4) Tools used to determine root cause of outliers. We will discuss the details of each technique, the challenges we faced, lessons learned and results showing the impact of each improvement.

speaker: Pritam Damania

Real-Time Market Basket Analysis for Retail with

@cadrev
cadrev / contours.py
Created April 9, 2016 19:32 — forked from jsundram/contours.py
Convert matplotlib contours into valid (compressed) topojson.
import logging
import matplotlib.pyplot as plt
import numpy as np
import os
import scipy.stats as stats
import sys
def read_data(filename):
"""Reads a data file assumed to have at least 2 columns: 1) lat, 2) lng."""
@cadrev
cadrev / upgrade-postgres-9.3-to-9.5.md
Created June 9, 2016 06:58 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
@cadrev
cadrev / k-fold CV.r
Created July 6, 2016 15:41 — forked from bhoung/k-fold CV.r
starter code for k fold cross validation using the iris dataset
# original example from Digg Data website (Takashi J. OZAKI, Ph. D.)
# http://diggdata.in/post/58333540883/k-fold-cross-validation-in-r
library(plyr)
library(randomForest)
data <- iris
# in this cross validation example, we use the iris data set to
@cadrev
cadrev / elastic_transform.py
Created July 11, 2016 07:58 — forked from fmder/elastic_transform.py
Elastic transformation of an image in Python
import numpy
from scipy.ndimage.interpolation import map_coordinates
from scipy.ndimage.filters import gaussian_filter
def elastic_transform(image, alpha, sigma, random_state=None):
"""Elastic deformation of images as described in [Simard2003]_.
.. [Simard2003] Simard, Steinkraus and Platt, "Best Practices for
Convolutional Neural Networks applied to Visual Document Analysis", in
@cadrev
cadrev / sda.py
Created September 28, 2016 14:23 — forked from pyben/sda.py
import numpy as np
from keras.datasets import imdb
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers import containers
from keras.layers.noise import GaussianNoise
from keras.layers.core import Dense, AutoEncoder
from keras.utils import np_utils
from sklearn.metrics import (precision_score, recall_score,
@cadrev
cadrev / How to download streaming video
Created November 9, 2016 17:15 — forked from danfinlay/How to download streaming video.md
How to download a streaming video with Google Chrome
#How to download streaming video
Streaming just means a download that they don't want you to keep. But Chrome's developer tools make it easy to access what's really going on under the hood.
##Open Developer Tools
From the page where you want to download some things, go into your chrome menu to open the developer tools. You can either:
1. (On a mac): Command-option-J
2. (On a PC): Control-alt-J
@cadrev
cadrev / modern-geospatial-python.md
Created November 10, 2016 14:45 — forked from jqtrde/modern-geospatial-python.md
Modern remote sensing image processing with Python