Skip to content

Instantly share code, notes, and snippets.

View sananth12's full-sized avatar
📵
I may be slow to respond.

Anantha Natarajan S sananth12

📵
I may be slow to respond.
View GitHub Profile
@sananth12
sananth12 / .py
Created May 5, 2017 00:09
Artist Recommendation
%pyspark
from pyspark.mllib.regression import LabeledPoint
import numpy as np
from pyspark.sql import Row
from pyspark.sql import functions as sql_functions
from pyspark.sql.types import *
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from pyspark.mllib.recommendation import *
import random
%pyspark
from pyspark.mllib.regression import LabeledPoint
import numpy as np
from pyspark.sql import Row
from pyspark.sql import functions as sql_functions
from pyspark.sql.types import *
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import java.io.File
import scala.io.Source
import org.apache.log4j.Logger
import org.apache.log4j.Level
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.sql.SQLContext
[Grizzly Bear,40.65507,-73.94888,0.0]
[Band Of Horses,40.65507,-73.94888,0.0]
[Converge,40.65507,-73.94888,0.0]
[Eddie Money,40.65507,-73.94888,0.0]
[Matisyahu,40.65507,-73.94888,0.0]
[Margaret Becker,40.65507,-73.94888,0.0]
[Lady GaGa,40.71455,-74.00712,5.11841538158843]
[Wayne Kramer,40.71455,-74.00712,5.11841538158843]
[The Ronettes,40.71455,-74.00712,5.11841538158843]
[The Strokes,40.71455,-74.00712,5.11841538158843]
@sananth12
sananth12 / gist:8efbc80f87918d4e68313552a85265e6
Created April 28, 2017 16:14
Get LinkedIn profiles of recruiters
site:linkedin.com (inurl:in OR inurl:pub) -inurl:dir -inurl:job -inurl:jobs -inurl:jobs2 -intitle:profiles -inurl:groups "University Recruiter at Microsoft"
@sananth12
sananth12 / run_cloudera_docker.sh
Last active February 8, 2017 19:12
Starting Cloudera VM with port mappings (OSX)
docker run --hostname=quickstart.cloudera --privileged=true -t -i -p 8080:80 -p 8888:8888 -p 50000-50100:50000-50100 -P [YOUR_IMAGE_HASH] /usr/bin/docker-quickstart
@sananth12
sananth12 / template.cpp
Created June 5, 2016 17:16
Competitive programming template (C++)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <limits>
#include <vector>
#include <bitset>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <time.h>
Titanic -inurl:(htm|html|php|pls|txt) intitle:index.of “last modified” (mkv|mp4|avi)
hey jude -inurl:(htm|html|php|pls|txt) intitle:index.of “last modified” (mp3|wma|aac|flac)
@sananth12
sananth12 / reddit.py
Last active August 24, 2017 23:00
Reddit r/images scraper
import urllib
import requests
import bs4 as BS
h={'User-Agent': 'Mozilla/5.0'}
url='http://reddit.com/r/pics'
r=requests.get(url, headers=h)
soup=BS.BeautifulSoup(r.text)
imgs=soup.select('a.thumbnail.may-blank')
links = [i['href'] for i in imgs]
@sananth12
sananth12 / __dijkstra__.cpp
Created August 23, 2014 09:35
Dijkstra STL Implementaion
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#define pp pair<int,int>
using namespace std;
class Prioritize
{
public:
int operator() ( const pair<int, int>& p1, const pair<int, int>& p2 )