This file contains 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 requests | |
import bs4 | |
import io | |
ADD_URI = 'http://en.wikipedia.org/w/index.php?title=Special:Book&bookcmd=add_article&arttitle={0}&oldid=0' | |
BOOK_URI = 'http://en.wikipedia.org/wiki/Special:Book' | |
def wikify(topic): | |
return '+'.join(topic.split(' ')) |
This file contains 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
"3 hundred spartans" == 3 # true |
This file contains 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
#!/usr/bin/env python | |
import sqlite3 | |
import requests | |
import bs4 | |
import datetime | |
SOURCE_URI = 'http://server2.examresults.net/icseX12-res.aspx' | |
def main(args): |
This file contains 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
aviraldg@aviraldg-netbook:~$ ssh -i path.to.key.pem ubuntu@ec2-???-???-???-???.ap-southeast-1.compute.amazonaws.com | |
Welcome to Ubuntu 11.10 (GNU/Linux 3.0.0-16-virtual x86_64) | |
* Documentation: https://help.ubuntu.com/ | |
System information as of Mon Apr 9 17:29:41 UTC 2012 | |
System load: 0.0 Processes: 66 | |
Usage of /: 12.9% of 7.87GB Users logged in: 0 | |
Memory usage: 8% IP address for eth0: ???.???.???.??? |
This file contains 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
# add this to the end of your site.py | |
# (side effects? who cares?) | |
class clear: | |
def __repr__(self): | |
return '\n'*24 | |
builtins.clear = clear() |
This file contains 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 java.io.*; | |
public class BinarySearch { | |
private static void sort(String [] words) { | |
int length = words.length; | |
for(int i=0; i<length; i++) { | |
for(int j=i; j<length; j++) { | |
if(words[i].compareTo(words[j]) > 0) { | |
String temp = words[i]; | |
words[i] = words[j]; |
This file contains 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 generate(inp): | |
inp.reverse() | |
C = int(inp.pop()) | |
C_D = dict() | |
for i in xrange(C): | |
_t = inp.pop() | |
C_D[_t[:2]] = _t[2] | |
C_D[_t[:2][::-1]] = _t[2] |
NewerOlder