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 itertools | |
def findPhoneNumbers(phone_name): | |
PHONE_LENGTH = 10 | |
allowed_numbers = ["1","2","3","4","5","6","7","8","9","0"] | |
# Get all permutations for positions not taken by phone name | |
match_length = PHONE_LENGTH - len(phone_name) | |
matches = itertools.permutations(allowed_numbers ,match_length) |
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
<script type="text/javascript"> | |
function initialize() { | |
var latlng = new google.maps.LatLng(36.14, -115.14); | |
var myLatlng = new google.maps.LatLng(36.14,-115.14); | |
var myOptions = { | |
zoom: 12, | |
center: latlng, | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
}; | |
var map = new google.maps.Map(document.getElementById("map_canvas"), |
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
<!-- HIGH SCORES --> | |
<div class="block"> | |
<div class="score-block"> | |
<div class="block-header"> | |
<h2>High Scores</h2> | |
</div> | |
{% if high_scores %} | |
{% for s in high_scores %} | |
<div class="tiny-score"> | |
<div class="player"> |
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
[{ | |
"cursor": true, | |
"id": null, | |
"type": "/games/game", | |
"mid": null, | |
"key": { | |
"namespace": "/user/pak21/boardgamegeek/boardgame", | |
"value": null, | |
"optional": false | |
} |
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 prefetch_refprops(entities, *props): | |
fields = [(entity, prop) for entity in entities for prop in props] | |
ref_keys = [prop.get_value_for_datastore(x) for x, prop in fields] | |
ref_entities = dict((x.key(), x) for x in db.get(set(ref_keys))) | |
for (entity, prop), ref_key in zip(fields, ref_keys): | |
prop.__set__(entity, ref_entities[ref_key]) | |
return entities |
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 google.appengine.ext.webapp import template | |
from django import template as django_template | |
def in_list(value, arg): | |
""" | |
Given an item and a list, check if the item is in the list. | |
Usage: | |
{% if item|in_list:list %} | |
in list | |
{% else %} |
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/python | |
#### | |
# 02/2006 Will Holcomb <[email protected]> | |
# | |
# This library is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU Lesser General Public | |
# License as published by the Free Software Foundation; either | |
# version 2.1 of the License, or (at your option) any later version. | |
# |
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
query = [{ | |
"type": "/games/game", | |
"id": None, | |
"name": None, | |
"!/award/award_honor/honored_for": { | |
"award": { | |
"id": "/en/spiel_des_jahres" | |
}, | |
"year": { | |
"value": None, |
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
[{ | |
"id": "/en/settlers_of_catan", | |
"/common/topic/weblink": [{ | |
"description": "BoardGameGeek", | |
"url": null | |
}] | |
}] |
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
{ | |
"code": "/api/status/ok", | |
"result": [{ | |
"attribution": [ | |
"/user/metaweb" | |
], | |
"creator": [ | |
"/user/metaweb" | |
], | |
"derivative_games": [ |
NewerOlder