Skip to content

Instantly share code, notes, and snippets.

@ri-sh
ri-sh / m.json
Created December 22, 2017 08:46
[{'min': 2, 'trait': 6200, 'rank': 20, 'existing': 'Y', 'udf': '24X4X3', 'max': 4, 'select': 'T'}, {'min': 2, 'trait': 6200, 'rank': 20, 'existing': 'Y', 'udf': '24X4X3', 'max': 4, 'select': 'T'}, {'min': 2, 'trait': 6200, 'rank': 20, 'existing': 'Y', 'udf': '24X4X3', 'max': 4, 'select': 'T'}, {'min': 2, 'trait': 6200, 'rank': 20, 'existing': 'Y', 'udf': '24X4X3', 'max': 4, 'select': 'T'}, {'min': 2, 'trait': 6200, 'rank': 20, 'existing': 'Y', 'udf': '24X4X3', 'max': 4, 'select': 'T'}, {'min': 2, 'trait': 6200, 'rank': 20, 'existing': 'Y', 'udf': '24X4X3', 'max': 4, 'select': 'T'}, {'min': 2, 'trait': 6200, 'rank': 20, 'existing': 'Y', 'udf': '24X4X3', 'max': 4, 'select': 'T'}, {'min': 2, 'trait': 6200, 'rank': 20, 'existing': 'Y', 'udf': '24X4X3', 'max': 4, 'select': 'T'}, {'min': 2, 'trait': 6200, 'rank': 20, 'existing': 'Y', 'udf': '24X4X3', 'max': 4, 'select': 'T'}, {'min': 2, 'trait': 6200, 'rank': 20, 'existing': 'Y', 'udf': '24X4X3', 'max': 4, 'select': 'T'}, {'min': 2, 'trait': 6200, 'rank': 20, 'exis
@ri-sh
ri-sh / ManualHough.py
Last active November 29, 2022 10:40
Hough Lines from scratch using opencv and numpy
# imports
import numpy as np
import cv2
import matplotlib.pyplot as plt
# The Hough Transform is a popular algorithm for detecting any shape that can
# be represented in a parametric mathmatical form in binary images. This
# usually means that images need to be thresholded or filtered prior to running
@ri-sh
ri-sh / imports.py
Created September 3, 2016 00:52
imports1
# imports
import numpy as np
import cv2
import matplotlib.pyplot as plt
@ri-sh
ri-sh / googleImageSearch.py
Last active August 9, 2017 14:01
python script for downloading the full resolution original images from google image search
from bs4 import BeautifulSoup
import requests
import re
import urllib2
import os
import cookielib
import json
def get_soup(url,header):
return BeautifulSoup(urllib2.urlopen(urllib2.Request(url,headers=header)),"html.parser")
@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()):
@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
#-------------------------------------------------------------------------------
# Name: ashiyan
# Purpose:
#
# Author: rishabh
#
# Created: 17/08/2015
# Copyright: (c) hp 2015
# Licence: <your licence>
#-------------------------------------------------------------------------------
@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
#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 / 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