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
function FindProxyForURL(url, host) | |
{ | |
if (dnsDomainIs(host, ".pandora.com")) | |
return "PROXY 199.189.84.217:3128" | |
if (dnsDomainIs(host, ".spotify.com")) | |
return "PROXY 54.246.92.203:80" | |
return "DIRECT" | |
} |
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
from __future__ import division | |
from bs4 import BeautifulSoup as bs | |
import requests | |
import re | |
import time | |
from pymongo import MongoClient | |
from time import mktime | |
from datetime import datetime | |
import plotly.plotly as py | |
import plotly.graph_objs as go |
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
from mandrill import Mandrill | |
import base64 | |
mail_client = Mandrill('<api_key>') | |
frm_email = 'email@email.com' | |
frm_name = 'Given Name' | |
# Sending image as attachment | |
img_attachment = base64.b64encode(open('~/sample_image.jpg', 'rb').read()) |
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
# ref: http://www.tfidf.com/ | |
# Example: | |
# Consider a document containing 100 words wherein the word cat appears 3 times. | |
# The term frequency (i.e., tf) for cat is then (3 / 100) = 0.03. Now, assume we | |
# have 10 million documents and the word cat appears in one thousand of these. | |
# Then, the inverse document frequency (i.e., idf) is calculated as log(10,000,000 / 1,000) = 4. | |
# Thus, the Tf-idf weight is the product of these quantities: 0.03 * 4 = 0.12. | |
# | |
# Hence: | |
# 1. Calculate term frequency |
OlderNewer