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
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(column-number-mode t)) | |
(custom-set-faces | |
;; custom-set-faces was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. |
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
/* | |
Functions used for the fade-in effect on Google's home page. | |
To reuse it, link this JavaScript file from your HTML source in a <script> | |
element; then, set the onmousemove attribute of the chosen element (e.g. <p>, | |
or <html> as Google did) to call the google.fade function. | |
<html onmousemove="google.fade()"> | |
(Actually, Google setting is "google&&google.fade&&google.fade()". YMMV.) |
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 oauth2 as oauth | |
import urlparse | |
url = 'http://www.goodreads.com' | |
request_token_url = '%s/oauth/request_token/' % url | |
authorize_url = '%s/oauth/authorize/' % url | |
access_token_url = '%s/oauth/access_token/' % url | |
consumer = oauth.Consumer(key='Your-GoodReads-Key', | |
secret='Your-GoodReads-Secret') |
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
# A web scraper for wish lists on The Book Depository. | |
# | |
# TBD offers a mail notification service for books in a wish list when some | |
# price drops. Unfortunately, you are notified only if prices drop of 10% or | |
# more; also, the message you receive does not contain the new dropped price, | |
# nor the old, higher price. Finally, when I got one of those notifications, | |
# that very day I visited the book page on TBD only to discover that the price | |
# got higher again. Not very effective as a service, you know. | |
# | |
# So I decided to write a script myself. |
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 python2.6 | |
# In probability theory, the birthday problem, or birthday paradox pertains to | |
# the probability that in a set of randomly chosen people some pair of them | |
# will have the same birthday. By the pigeonhole principle, the probability | |
# reaches 100% when the number of people reaches 367 (including February 29 | |
# births). But perhaps counter-intuitively, 99% probability is reached with | |
# just 57 people, and 50% probability with 23 people. These conclusions are | |
# based on the assumption that each day of the year (except February 29) is | |
# equally probable for a birthday. |
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 python2.6 | |
import sys | |
from os.path import basename | |
from string import lowercase, uppercase, maketrans | |
if len(sys.argv) != 2: | |
print 'Usage: %s text' % basename(sys.argv[0]) | |
sys.exit(1) |
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 python2.6 | |
''' | |
For each Python script in the current directory, prints the total | |
number of keywords used and the partial number for each keyword. | |
''' | |
import collections | |
import glob | |
import keyword |
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
package com.example; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.FilenameFilter; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Map; |
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
package com.example; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Map.Entry; |
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
package com.example; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
public class Letters { | |
OlderNewer