This file contains hidden or 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
| /** | |
| * SyntaxHighlighter | |
| * http://alexgorbatchev.com/SyntaxHighlighter | |
| * | |
| * SyntaxHighlighter is donationware. If you are using it, please donate. | |
| * http://alexgorbatchev.com/SyntaxHighlighter/donate.html | |
| * | |
| * @version | |
| * 3.0.83 (July 02 2010) | |
| * |
This file contains hidden or 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 SimpleCV import * | |
| import time | |
| points = [] | |
| cam = Camera(0) | |
| display = Display() | |
| while display.isNotDone(): | |
| img = cam.getImage().flipHorizontal() | |
| white_ball = img.colorDistance(Color.WHITE) | |
| only_white = img - white_ball |
This file contains hidden or 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 Tkinter import * | |
| import tkMessageBox | |
| class App: | |
| def __init__(self,parent): | |
| self.parent = parent | |
| self.frame_1 = Frame(parent) | |
| self.frame_1.pack() | |
| self.lbl_1 = Label(self.frame_1,text="Current CGPA :") | |
| self.lbl_1.grid(row=0,column=0) |
This file contains hidden or 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
| def quicksort(arr): | |
| len_arr = len(arr) | |
| if(len_arr<2): | |
| return arr | |
| else: | |
| lower = [] | |
| upper = [] | |
| pivot = [] | |
| pivot.append(arr[len_arr-1]) |
This file contains hidden or 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
| def merge(left, right): | |
| result = [] | |
| i ,j = 0, 0 | |
| while i < len(left) and j < len(right): | |
| if left[i] <= right[j]: | |
| result.append(left[i]) | |
| i += 1 | |
| else: | |
| result.append(right[j]) | |
| j += 1 |
This file contains hidden or 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
| import os | |
| import urllib2 | |
| from BeautifulSoup import BeautifulSoup | |
| import re | |
| def imdb(movie_name): | |
| http_proxy_full_auth_string = "http://%s:%s@%s:%s" % ('username','password','proxy','port') | |
| proxy_handler = urllib2.ProxyHandler({"http": http_proxy_full_auth_string}) | |
| opener = urllib2.build_opener(proxy_handler) | |
| urllib2.install_opener(opener) |
This file contains hidden or 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
| import urllib | |
| def xkcd_latest(): | |
| source = urllib.urlopen('http://xkcd.com/').read() | |
| url_start = source.find('img src="http://imgs.xkcd.com/comics/') | |
| start_quote = source.find('"',url_start) | |
| end_quote = source.find('"',start_quote+1) | |
| url=source[start_quote+1:end_quote] | |
| file_name = url[28:end_quote] | |
| print file_name | |
| print url |
This file contains hidden or 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
| import urllib2 | |
| from BeautifulSoup import BeautifulSoup | |
| import re | |
| def imdb(movie_name): | |
| movie_name= movie_name.split() | |
| movie_url='+'.join(movie_name) | |
| url_pref = "http://www.imdb.com/find?q=" | |
| url_suf = "&s=all" | |
| imdb_url = url_pref+movie_url+url_suf; |
This file contains hidden or 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
| import urllib | |
| import re | |
| def songspk(movie_name): | |
| movie_name = "_".join(movie_name.split()) | |
| print movie_name | |
| first_char = movie_name[0:1] | |
| movie_list_url = "http://www.songspk.name/" + first_char.lower()+"_list.html" | |
| print movie_list_url | |
| source = urllib.urlopen(movie_list_url).read() | |
| reg = movie_name.lower()+".*.html" |
NewerOlder