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
all: | |
$(MAKE) grammer | |
$(MAKE) lex | |
gcc -c compiler/grammer.tab.c compiler/lex.yy.c | |
mv *.o compiler | |
ar rvs compiler/lexgram.a compiler/grammer.tab.o compiler/lex.yy.o | |
g++ -o bin/freamps -Wall -Wextra compiler/main.cc compiler/lexgram.a | |
grammer: | |
bison -d compiler/grammer.y | |
mv grammer.tab.* compiler |
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 math | |
class Metric(object): | |
"""Abstract class""" | |
def distance(self,x,y): | |
raise NotImplementedError("Derived classes should implement this.") | |
class EuclideanMetric(Metric): | |
"""Calculates distance from origin in R according to Pythagorean distance""" | |
def distance(self,x,y): |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
# In[ ]: | |
# this is a test simulated run on a pruned customer data where customer analytics is a branch of modeling the ecommerce business | |
# this is the analytics for the dataset at https://www.kaggle.com/pankajjsh06/ibm-watson-marketing-customer-value-data | |
# In[1]: |
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
# for parsing http requests to the web | |
import requests | |
# for parsing web service responses from gcloud | |
import json | |
import time | |
# enable pretty printing of lists | |
import pprint | |
#enable system generated interupts | |
import sys | |
class GooglePlaces(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
#!/bin/bash | |
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
# Inspired from https://gist.github.com/faleev/3435377 | |
# Remove any existing packages: | |
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
# Get the dependencies (Ubuntu Server or headless users): | |
sudo apt-get update |