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
bar = {4:'4', 5:'5', 6:'6'} | |
foo = {1:1, 2:2, 3:3} | |
x = zip(foo, bar.values()) | |
for y in x: | |
print "%s:%s" % (y[0], y[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
def averageNpArrays(arr1, arr2): | |
return(arr1 / 2) + (arr2 / 2) | |
def averageTwoArrays(arr1, arr2): | |
copy_pls = arr1 | |
for x in range(len(copy_pls)): | |
for y in range(len(copy_pls[x])): | |
copy_pls[x][y] = (arr1[x][y] / 2) + (arr2[x][y] / 2) | |
return copy_pls |
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 requests | |
from datetime import datetime | |
SJC_HISTORY_URL = "http://api.wunderground.com/api/api_key/history_%s/q/CA/San_Jose.json" | |
def makeRequests(): | |
today = datetime.date.today() | |
temperatures = {} | |
#Start the range at 1 and go to 8 to ensure we go back 7 days. | |
for x in range(1,8): |
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 src="sample.js"> | |
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { | |
console.log("Request test"); | |
if (request.method == "getLocalStorage") | |
console.log("Request received"); | |
sendResponse({data: localStorage[request.key]}); | |
else | |
sendResponse({}); | |
}); | |
</script> |
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 src="sample.js"> | |
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { | |
if (request.method == "getLocalStorage") | |
console.log("Request received"); | |
sendResponse({data: localStorage[request.key]}); | |
else | |
sendResponse({}); | |
}); | |
</script> |
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 src="sample.js"> | |
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { | |
console.log("Request test"); | |
if (request.method == "getLocalStorage") sendResponse({ | |
data: localStorage[request.key] | |
}); | |
else sendResponse({}); | |
}); | |
</script> |