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 dict_to_item(raw): | |
if type(raw) is dict: | |
resp = {} | |
for k,v in raw.iteritems(): | |
if type(v) is str: | |
resp[k] = { | |
'S': v | |
} | |
elif type(v) is int: | |
resp[k] = { |
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 parse_dynamo_item(item): | |
resp = {} | |
if type(item) is str: | |
return item | |
for key,struct in item.iteritems(): | |
if type(struct) is str: | |
if key == 'I': | |
return int(struct) | |
else: | |
return struct |
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
//---sends an SMS message to another device--- | |
private void sendSMS(String phoneNumber, String message) | |
{ | |
String SENT = "SMS_SENT"; | |
String DELIVERED = "SMS_DELIVERED"; | |
PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, | |
new Intent(SENT), 0); |