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 is_list(p): | |
return isinstance(p, list) | |
def deep_reverse(p): | |
if is_list(p): | |
result = [] | |
for i in range (len(p) - 1, -1, -1): | |
result.append(deep_reverse(p[i])) | |
return result | |
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
def stirling(n, k): | |
if k > n: | |
return 0 | |
elif k == n or k == 1: | |
return 1 | |
else: | |
return (k*stirling(n-1, k) + stirling(n-1, k-1)) | |
def bell(n): | |
bell = 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
def split_string(source,splitlist): | |
output = [] | |
atsplit = True | |
for char in source: | |
if char in splitlist: | |
atsplit = True | |
else: | |
if atsplit: | |
output.append(char) | |
atsplit = 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
brew install elasticsearch | |
brew info elasticsearch |
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
{ | |
”ok” : true, | |
”status” : 200, | |
”name” : “Destroyer”, | |
”version” : { | |
”number” : “0.90.5″, | |
”build_hash” : “c8714e8e0620b62638f660f6144831792b9dedee”, | |
”build_timestamp” : “2013-09-17T12:50:20Z”, | |
”build_snapshot” : false, | |
”lucene_version” : “4.4″ |
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
{"ok":true,"acknowledged":true} |
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
{ | |
"badger": { | |
"properties": { | |
"name": {"type": "string"}, | |
"role": {"type": "string"}, | |
"bio": {"type": "string"} | |
} | |
} | |
} |
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
{ "create" : { "_index" : "animal", "_type" : "badger", "_id" : "1" } }\n | |
{ "name" : "Cain Ullah", "role": "Founder", "bio": "Cain is a Founder of Red Badger, the non-techy responsible for business operations. He's worked on lots of innovative projects - from prototype to delivery - for some very big brands. He also likes to clog up the Red Badger mailroom with a constant influx of vinyl purchases to add to his ever-increasing collection." }\n | |
{ "create" : { "_index" : "animal", "_type" : "badger", "_id" : "2" } }\n | |
{ "name" : "David Wynne", "role": "Founder", "bio": "Founder, developer, and lover (not a hater). David has been making stuff work really well for over 14 years, five of those at Microsoft in the UK, USA and around Europe. He has lead teams, introduced agile into organisations and loves the detail. One day David will write a novel. A really long and interesting one." }\n | |
{ "create" : { "_index" : "animal", "_type" : "badger", "_id" : "3" } }\n | |
{ "name" : "Stuart Harris", "role": "Founder", "bio": |
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
{{ipconfig}} localhost workspace.local | |
54.229.63.199 login.dev.local | |
54.229.64.203 workspace.dev.local | |
54.229.79.21 workspace1.dev.local | |
255.255.255.255 broadcasthost |
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
{ | |
"name": "http-server", | |
"preferGlobal": true, | |
"version": "0.3.0", | |
"author": "Nodejitsu <support@nodejitsu.com>", | |
"description": "a simple zero-configuration command-line http server", | |
"contributors": [ | |
{ | |
"name": "Marak Squires", | |
"email": "marak@nodejitsu.com" |