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 fib(n): | |
if n == 0: | |
return 0, 0 | |
if n == 1: | |
return 1, 0 | |
a, a_cnt = fib(n-1) | |
b, b_cnt = fib(n-2) | |
return a + b, (a_cnt + b_cnt + 2) |
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 fibsy(n, i, g, s): | |
if n > 0 and g == 0: | |
n -= 1 | |
print 0 | |
return fibsy(n, i, 1, s) | |
elif n > 0 and s == True: | |
n -= 1 | |
print 1 | |
return fibsy(n, 1, g, False) | |
elif n > 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
npm ERR! Error: No compatible version found: uglify-js@'^2.4.19' | |
npm ERR! Valid install targets: | |
npm ERR! ["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.1.0","1.1.1","1.2.0","1.2.1","1.2.2","1.2.3","1.2.4","1.2.5","1.2.6", | |
"1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","2.2.0","2.2.1","2.2.2","2.2.3","2.2.4","2.2.5","2.3.0","2.3.1","2.3.2","2.3.3","2.3.4","2.3.5","2.3.6","1.3.5","2.4.0","2.4.1","2.4.2","2 | |
.4.3","2.4.4","2.4.5","2.4.6","2.4.7","2.4.8","2.4.9","2.4.10","2.4.11","2.4.12","2.4.13","2.4.14","2.4.15","2.4.16","2.4.17","2.4.18","2.4.19","2.4.20","2.4.21","2.4.22","2.4.23 | |
"] | |
npm ERR! at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:684:10) | |
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:606:10 | |
npm ERR! at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138:7) | |
npm ERR! at Object.oncomplete (fs.js:107:15) |
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
[Ben] | |
LogLevel=1 | |
FilePrinting=false | |
ConsolePrinting=true | |
ScreenPrinting=false | |
[Bob] | |
LogLevel=1 | |
FilePrinting=false | |
ConsolePrinting=true | |
ScreenPrinting=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
from __future__ import print_function | |
from os.path import basename | |
import math | |
import sys | |
import numpy as np | |
# FIXME: look into decimal type |
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 params_to_dict(param_str): | |
splits = param_str.split(" ") | |
data = {} | |
prev_key = None | |
prev_val = None | |
for s in splits: | |
if "=" in s: | |
key, val = s.split("=") | |
if prev_key: |
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
[Power] GameState.DebugPrintPower() - ACTION_START Entity=[id=55 cardId= type=INVALID zone=HAND zonePos=1 player=2] SubType=PLAY Index=0 Target=0 | |
[Power] GameState.DebugPrintPower() - TAG_CHANGE Entity=Ryan Higdon tag=TEMP_RESOURCES value=0 | |
[Power] GameState.DebugPrintPower() - TAG_CHANGE Entity=Ryan Higdon tag=RESOURCES_USED value=1 | |
[Power] GameState.DebugPrintPower() - TAG_CHANGE Entity=Ryan Higdon tag=NUM_CARDS_PLAYED_THIS_TURN value=2 | |
[Power] GameState.DebugPrintPower() - TAG_CHANGE Entity=[id=51 cardId= type=INVALID zone=HAND zonePos=5 player=2] tag=ZONE_POSITION value=4 | |
[Power] GameState.DebugPrintPower() - TAG_CHANGE Entity=[id=63 cardId= type=INVALID zone=HAND zonePos=4 player=2] tag=ZONE_POSITION value=3 | |
[Power] GameState.DebugPrintPower() - TAG_CHANGE Entity=[id=53 cardId= type=INVALID zone=HAND zonePos=3 player=2] tag=ZONE_POSITION value=2 | |
[Power] GameState.DebugPrintPower() - TAG_CHANGE Entity=[id=43 cardId= type=INVALID zone=HAND zonePos=2 player=2] tag=ZONE_POSITION v |
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 requests | |
import shutil | |
def main(): | |
url_base = "http://wow.zamimg.com/images/hearthstone/cards/enus/animated/{}_premium.gif" | |
card_id = "EX1_067" | |
file_name = "data/card_images/{}.gif".format(card_id) | |
res = requests.get(url_base.format(card_id), stream=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
/** | |
* This file provided by Facebook is for non-commercial testing and evaluation purposes only. | |
* Facebook reserves all rights not expressly granted. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | |
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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 _key_fn(x): | |
return x.first() | |
def main2(): | |
names = golf_name_list(argv[1]) | |
sorted_names = sorted(names, key = _key_fn) | |
for n in sorted_names: | |
print n.first(), n.last() |