Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
"""
msmt.py
Functions to access the Microsoft Translator API HTTP Interface, using python's urllib/urllib2 libraries
"""
import urllib, urllib2
@ri-sh
ri-sh / gist:9249407
Created February 27, 2014 12:48
translator
#!/usr/bin/python
"""
msmt.py
Functions to access the Microsoft Translator API HTTP Interface, using python's urllib/urllib2 libraries
"""
import urllib, urllib2
@ri-sh
ri-sh / getPremLeague.py
Created December 15, 2014 01:44
Scraping Wikipedia Premier League Data
from bs4 import BeautifulSoup
import numpy as np
import pandas as pd
import urllib2
soup=''
def getPremLeague(wiki):
"""
input takes the wiki url of football club season list url is
in form <"http://en.wikipedia.org/wiki/List_of_"+" FOotball team name"+"_F.C._seasons">
returns a dictionary containing
@ri-sh
ri-sh / getTeamData.oy
Created December 15, 2014 02:30
Scraping Wikipedia Premier League Data
from bs4 import BeautifulSoup
import numpy as np
import pandas as pd
import urllib2
soup=''
def getPremLeague(wiki):
"""
input takes the wiki url of football club season list url is
in form <"http://en.wikipedia.org/wiki/List_of_"+" FOotball team name"+"_F.C._seasons">
returns a dictionary containing
@ri-sh
ri-sh / googleImage_grab.py
Last active October 13, 2015 07:55
Download full sized images using google search
import json
import os
import time
import requests
from PIL import Image
from StringIO import StringIO
import socket
from requests.exceptions import ConnectionError
import urllib2
#include<iostream>
#include<algorithm>
#include<vector>
#include<stdio.h>
using namespace std ;
long long mergeSort(vector<int> &v) {
if (v.size() <= 1) {
return 0;
}
@ri-sh
ri-sh / Way2sms.py
Last active December 29, 2016 14:54
way2sms message
#-------------------------------------------------------------------------------
# Name: Way2sms
# Purpose: send sms way2sms #
# Author: Rishabh Roy
#
# Created: 09/08/2015
# Copyright: (c) Rishabh 2015
# Licence: <GPL>
#-------------------------------------------------------------------------------
import urllib2
#-------------------------------------------------------------------------------
# Name: ashiyan
# Purpose:
#
# Author: rishabh
#
# Created: 17/08/2015
# Copyright: (c) hp 2015
# Licence: <your licence>
#-------------------------------------------------------------------------------
@ri-sh
ri-sh / module.py
Created September 8, 2015 15:18
work
def factorial (n ):
if n<= 1 :
return 1
fact = 1
for i in range(1,n+1):
fact = fact*i
return fact
@ri-sh
ri-sh / ques1.py
Last active September 15, 2015 18:39
def my (a , b ):
#function declaration a , b parameters hai
#question mein my(12,'abc123') likha hai toh a mein 12 jayega aur b= 'abc123'
ans =0
for i in b:
#agar i digit hai . if( ord(i)>=ord('0') and ord(i)<=ord('9')) iske jagah yeh bhi likh skta hai //
if(i.isdigit()):