Skip to content

Instantly share code, notes, and snippets.

View saurabhwahile's full-sized avatar

Saurabh Wahile saurabhwahile

View GitHub Profile
@saurabhwahile
saurabhwahile / count-characters.py
Created February 23, 2015 14:15
Count Characters In Image - Using Space Efficient CCL Algorithm With Dilation and Erosion
__author__ = 'Saurabh'
from PIL import Image
IMAGE_NAME = 'RandomText.gif'
inputImage = Image.open(IMAGE_NAME)
inputImageMatrix = inputImage.load()
BLACK = 0
WHITE = 255
@saurabhwahile
saurabhwahile / substitution-analyser.py
Created December 12, 2014 06:40
Analyse Substitution Cipher
from string import ascii_lowercase
ITERATIONS = 3
charMapping = {}
charControl = 0
for char in ascii_lowercase:
charMapping[charControl] = char
charControl+=1
@saurabhwahile
saurabhwahile / sentence-jumbler
Created November 23, 2014 13:05
Jumble sentences in paragraph(s)
import os
import random
import collections
def jumbleSentences(paragraph):
sentences = paragraph.split('. ')
jumbledSentences = collections.OrderedDict()
jumbleCounter = 0
while jumbleCounter < len(sentences):
position = random.randrange(0, len(sentences))
@saurabhwahile
saurabhwahile / backup-winrar.ps1
Created June 16, 2014 19:08
Creating RAR Archives From Windows Powershell
#Set-ExecutionPolicy Unrestricted
$fromFolderPath = $args[0][0]
$toFolderPath = $args[0][1]
$toFilename = ""
if ($fromFolderPath.Split("\")[-1] -eq "")
{
$toFilename = $fromFolderPath.Split("\")[-2]
$fromFolderPath = $fromFolderPath.SubString(0, ($fromFolderPath.length-1))
}