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
google.maps.event.addListener(marker, 'click', function() { | |
alert('bubba'); | |
}); |
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
events { | |
worker_connections 1024; | |
use epoll; | |
} | |
http { | |
server { | |
listen 80; | |
server_name 127.0.0.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
Traceback (most recent call last): | |
File "<console>", line 1, in <module> | |
File "/home/lion/.virtualenvs/test/lib/python2.6/site-packages/django/db/models/query.py", line 69, in __repr__ | |
data = list(self[:REPR_OUTPUT_SIZE + 1]) | |
File "/home/lion/.virtualenvs/test/lib/python2.6/site-packages/django/db/models/query.py", line 84, in __len__ | |
self._result_cache.extend(self._iter) | |
File "/home/lion/.virtualenvs/test/lib/python2.6/site-packages/django/db/models/query.py", line 273, in iterator | |
for row in compiler.results_iter(): | |
File "/home/lion/.virtualenvs/test/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 680, in results_iter | |
for rows in self.execute_sql(MULTI): |
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
from base import Language, StaffMember, Faq, FaqTranslation, Testimonial, TestimonialTranslation, Address, Branch, CityPart, District | |
from cms import Page, ContentName, OneColumnRow, TwoColumnRow, ThreeColumnRow, EmptyRow, ThreePictureRow, FourPictureRow, RealMedia, TabbedMedia | |
from news import NewsLetterSubscription, NewsLetter, EmailAlert | |
from property import PropertyDescription, PropertyThumbnail, PropertyCoordinate, Property | |
from static_translation import TextElement, TextElementTranslation |
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 System.Environment | |
fib_gen = 0 : 1 : [a + b | (a, b) <- zip fib_gen (tail fib_gen)] | |
main = do | |
args <- getArgs | |
let first_arg = if null args then "1" else head args | |
let fa = read first_arg :: Int | |
print $ last $ take fa fib_gen |
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
checkers = [ | |
lambda nums: False, | |
lambda nums: True, | |
lambda nums: nums[-1] % 2 == 0, | |
lambda nums: sum(nums) % 3 == 0, | |
lambda nums: (10 * nums[-2] + nums[-1]) % 4 == 0, | |
lambda nums: nums[-1] in [0, 5], | |
lambda nums: sum(nums) % 3 == 0 and nums[-1] % 2 == 0, | |
lambda nums: sum([10 ** i * nums[-(i + 1)] for i in xrange(len(nums))]) % 7 == 0, | |
lambda nums: sum([10 ** i * nums[-(i + 1)] for i in xrange(3)]) % 8 == 0, |
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
""" Computing the number of permutations on n points | |
no fix points in 3 ways. """ | |
from functools import wraps | |
from math import factorial, e, floor | |
from sys import argv | |
CACHE = {} | |
def cache(f): | |
@wraps(f) |
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
from collections import defaultdict | |
from sys import argv | |
def to_dict(word): | |
ret = defaultdict(int) | |
for letter in word: | |
ret[letter] += 1 | |
return ret |
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
""" The problem is an extremely easy linear programming problem. | |
The only issue is that there is no simplex solver in the | |
standard library and scipy is not available on codeforces. | |
""" | |
from scipy.optimize import linprog | |
n, p, q = map(int, raw_input().strip().split()) | |
A = [[], []] | |
b = [-p, -q] | |
c = [1 for _ in xrange(n)] |
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 re | |
PUT_PATTERN = re.compile(r'PUT (?P<what>[0-9]+) INSIDE (?P<to>[0-9]+)') | |
LOOSE_PATTERN = re.compile(r'SET (?P<which>[0-9]+) LOOSE') | |
SWAP_PATTERN = re.compile(r'SWAP (?P<one>[0-9]+) WITH (?P<other>[0-9]+)') | |
class Bag(object): | |
def __init__(self, n, parent=None): | |
self.n = n |