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
""" | |
Simple twitter API wrapper for python | |
Useage: | |
twitter = Twitter() | |
twitter.set_user_pass(user, passwd) - Set the user password for authenticated requests | |
twitter.friends_ids(user) - pass username or id to get list of all friend ids | |
twitter.update(text) - send an update for the current user ("tweet") |
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
""" | |
Download all document links from a web page. | |
Used to extract all the docouments from a Sharepoint document library. | |
by Mike Koss, September, 2009 | |
Notes: | |
9/14/09 mck: | |
Using Beautiful soup version 3.0.7a. The current version (3.1.0.1) is NOT resilient |
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 httplib | |
import urllib2 | |
import sys | |
# TODO: Speed up by searching on multiple connections, say, 10 | |
def DictSearch(sAfter): | |
dict = open("dict.txt") | |
f = open("output.csv", 'a') |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title>Twitter Rate Calculator - Find the rate that any keyword is being Twittered.</title> | |
<style> | |
table { | |
border-collapse:collapse; | |
} | |
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
def Select(a, i, first=0, last=None): | |
if last is None: | |
last = len(a)-1 | |
p = Pivot(a, first, last) | |
if p == i: | |
return a[p] | |
if p < i: | |
return Select(a, i, p+1, last) | |
return Select(a, i, first, p-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
""" | |
The McNugget Problem | |
Find the smallest n s.t. there exists a solution to: | |
n = 6x + 9y + 20z | |
for n, n+1, n+2, ... , n+5 | |
Result is: |
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
class tuples(object): | |
""" | |
Iterator that generates all tuples in lexicographical order. | |
For example: | |
for t in tuples((2,3)): | |
print t | |
produces: |
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
The master repository for the AppEngine-Base project is stored on GitHub: | |
http://github.com/mckoss/appengine-base | |
Windows users can install the Git client: http://code.google.com/p/msysgit/ | |
I use these settings: | |
- Add Git Bash Here, Add Git GUI Here | |
- Run Git and included Unix tools from the Windows Command Prompt | |
- Use OpenSSH |
NewerOlder