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
/** | |
* Template for comments and pingbacks. | |
* | |
* To override this walker in a child theme without modifying the comments template | |
* simply create your own twentyten_comment(), and that function will be used instead. | |
* | |
* Used as a callback by wp_list_comments() for displaying the comments. | |
* | |
* @since Twenty Ten 1.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
#!/usr/bin/env python | |
import sys | |
import random | |
import pygame | |
from pygame.locals import * | |
# window shit | |
pygame.init() | |
DS = pygame.display.set_mode((800, 600), 0, 32) |
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 runsimulation(f): | |
def checkrun(): | |
if len(changestate) >= 3 and changestate[-3] == changestate[-1]: | |
m("stuck in loop") | |
elif not len(changestate) or changestate[-1]: | |
f() | |
else: | |
m(len(changestate), " state changes - finished.") | |
return checkrun |
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
#!/usr/bin/env python | |
# Google Code Challenge - Credit Problem | |
# http://code.google.com/codejam/contest/351101/dashboard#s=p0 | |
import itertools | |
import bisect | |
from time import time | |
def last(array, num): |
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 checkpossibility(unsatlist): | |
if len(sorted(unsatlist, key=len, reverse=True)[0]) > 1: | |
return False | |
else: | |
return True |
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 checkpossibility(unsatlist): | |
try: | |
for x in sorted(unsatlist, key=len, reverse=True): | |
if len(x) > 1: | |
raise Exception | |
else: | |
pass | |
return True | |
except: | |
return False |
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 multi-page HTML | |
# books and write to file | |
########################## | |
from BeautifulSoup import BeautifulSoup | |
import urllib2 | |
import re | |
import itertools | |
import bleach |
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
/* palindrome.cpp | |
* C++ implementation of palindrome.py | |
* (https://gist.github.com/4081368) | |
* | |
* - Matthew Martz 2012 | |
*/ | |
#include <iostream> | |
#include <string> | |
#include <sstream> |
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
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <iomanip> | |
using namespace std; | |
/* Practicing examples from http://web.cse.msu.edu/~cse231/python2Cpp.html | |
and http://code.google.com/edu/languages/cpp/basics/getting-started.html */ |
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
Enter number of digits: | |
999 - symmetry | |
start 999999 - stop 100 | |
xx | |
SsSs | |
floor : 1001 ceiling : 999 | |
floor : 999 ceiling : 999 | |
floor : 999 ceiling : 999 | |
997799 | |
999 , 999 |