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 badr(n): | |
return 1 if n is 1 else n * badr(n - 1) | |
n = 1; | |
while(reduce(lambda x, y: int(x) + int(y), str(badr(n))) != 8001): | |
n = n + 1 | |
print 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 math; | |
import urllib | |
from xml.dom import minidom | |
def std(n): | |
return math.sqrt(sum(map(lambda x: (x - float(sum(n))/ len(n))** 2, n))/len(n)) | |
article = minidom.parse(urllib.urlopen("http://apply.embed.ly/static/data/2.html")).getElementsByTagName("article")[0] | |
tags = (); |
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
freqWords = map(lambda x : 2520.0 / x, range(1,901)) | |
wordTotal = 0; | |
wordHalfTotal = sum(freqWords)/2 | |
for wordCount in range(1,901): | |
wordTotal += freqWords[wordCount - 1]; | |
if wordTotal >= wordHalfTotal: | |
print wordCount; | |
break; |
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
# distance units | |
Mile | |
Meter | |
Kilometer | |
Foot | |
Laps (25 meters) | |
Laps (50 meters) | |
Yard | |
Inch |
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
[{ | |
"inputs": [{ | |
"effort_max": 600.0, | |
"display_name": "weight", | |
"effort_min": 0.0, | |
"allowed_units": ["kg", "lb"], | |
"hidden_by_default": false, | |
"type": "weight", | |
"id": 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
{ | |
"date": "2011-11-11", | |
"timestamp": "2011-11-11T12:00:00", | |
"id": 1429543, | |
"root_group": { | |
"children": [{ | |
"type": "exercise", | |
"id": 2783919, | |
"sets": [{ |
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
""" | |
In [56]: a = [1,[2,3,4], 4,5,6, [7,8], 9, 10] | |
In [57]: normalize = lambda x : x if type(x) == list else [x] | |
In [58]: list(itertools.chain(*map(normalize, a))) | |
Out[58]: [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10] | |
In [59]: a |
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
ROMANS = (('M', 1000), | |
('CM', 900), | |
('D', 500), | |
('CD', 400), | |
('C', 100), | |
('XC', 90), | |
('L', 50), | |
('XL', 40), | |
('X', 10), |
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 time | |
def rate_limited(num_calls, interval): | |
minInterval = float(interval) / float(num_calls) | |
def decorate(func): | |
lastTimeCalled = [0.0] | |
def rate_limited_function(*args, **kargs): |
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
1. Sky temple. I was Morales. Lost game because only warrior decided to go solo jungle all game and only responded to chat in curses or insults (same during draft) | |
2. cursed hollow. I was Zag. Won game - our team was waaay better than theirs. their lili took dragon?? Got cocky and died some, but still had 2x their kills. Only won 50 points. | |
3. Dragon Shire. I was Morales. Major loss with 4 level lead for other team. Hero raynor liked to charge in solo and focus tanks. 0 death Lili with 107k heals because of it. Asked Raynor multiple times to focus Lili, but he told me to shut up because he's top damage. 80k hero damage against mostly diablo and artanis. | |
4. Spider Queen. I was Muradin. Hero gaz solo all game. talked trash to rest of team because he was top damage, lost every team fight. | |
5. Dragonshire. I was DPS Tass. Won game. Close match until I got the dragon (other 3 times we got dragon our team would full wipe with dragon push). Got all dragons tho. |
OlderNewer