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 re | |
from operator import mul, pow, add, sub, div | |
__author__ = 'pravesh' | |
def get_simple_statement(statement): | |
template=r"((\-?\d+(?:\.\d+)?)\%s(\-?\d+(?:\.\d+)?))(?!\^)" | |
for opstr, opfunc in [("^", pow), ("*", mul), ("/", div), ("+", add), ("-", sub)]: | |
template_str = template % opstr | |
while opstr in statement: | |
#todo associativity for ^ operator |
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 google.appengine.api import urlfetch | |
from urllib import urlencode | |
import json | |
def validate_captcha(self): | |
recaptcha_response_field = self.request.params.get("g-recaptcha-response") | |
remote_ip = self.request.remote_addr | |
secret = 'YOUR SECRET HERE' # put recaptcha private key here | |
recaptcha_post_data = { |
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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Simple search engine\n", | |
"#### By Pravesh Koirala\n", | |
"\n", | |
"A search engine that will index given [toy] documents.. just to show how to do it." |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
.model small | |
.stack 300H | |
.data | |
x dw 3 | |
text db "Move from peg " | |
d1 db ? | |
text2 db " to peg " | |
d2 db ? | |
newline db 0AH, 0DH, '$' |
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
;******************************************************************************************************************* | |
; Snake Game By * | |
; HERO-DAI * | |
;******************************************************************************************************************* | |
;code is not well-commented, sorry about that, I'll try to comment it nice and well, but can't make any | |
;promises, Also, this code writes directly into the video memory instead of int 21H (21H is slow) except | |
;at some certain points (like displaying scores and the intro) | |
;and next time someone tells you to not use goto, ask them to code in assembly without goto... :P |
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
;******************************************************************************************************************* | |
; Snake Game By * | |
; HERO-DAI * | |
;******************************************************************************************************************* | |
;code is not well-commented, sorry about that, I'll try to comment it nice and well, but can't make any | |
;promises, Also, this code writes directly into the video memory instead of int 21H (21H is slow) except | |
;at some certain points (like displaying scores and the intro) | |
;and next time someone tells you to not use goto, ask them to code in assembly without goto... :P |
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
""" | |
Back when I wanted to download some online lectures from MIT, I couldn't find anything that can mass download | |
youtube playlists save for some softwares. I didn't want to download and install any software and such and hence | |
I had to create this script (Now, I use ByTubeD to do the same in firefox). | |
Extract videos from your favorite playlist. Enter the playlist id for example, in the playlist | |
http://www.youtube.com/playlist?list=PLE7DDD91010BC51F8 the playlist id is PLE7DDD91010BC51F8. | |
The script will generate downloadable scripts in your desired formats and prompt you for a location to save your files to. | |
Please note that youtube keeps on changing their protocols so if you are using this script in say 2013 | |
or such, then good luck!!! And yes, if this code causes ANY problems with your pcs like for example say your |