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 distanceMeasurement(): | |
prev_distance = 0 | |
while 1: | |
ultrasonicSensor_init() | |
time.sleep(2) | |
GPIO.output(TRIG, True) | |
time.sleep(0.00001) | |
GPIO.output(TRIG, False) | |
#Starts the timer | |
while GPIO.input(ECHO)==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
public static List<decimal> arrUSDEUR = new List<decimal>();// globally declaring list for USDEUR | |
public static List<decimal> arrUSDAUD = new List<decimal>();// globally declaring list for USDAUD | |
public static List<decimal> arrUSDCNY = new List<decimal>();// globally declaring list for USDCNY | |
public static List<decimal> arrUSDINR = new List<decimal>();// globally declaring list for USDINR | |
public static Dictionary<string, List<decimal>> ArrayDictMap = new Dictionary<string, List<decimal>>() | |
{ | |
{ "USDEUR", arrUSDEUR }, |
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
handleComment = function(obj,commentObj){ | |
var comment = commentObj.commentsAndMeta.comment[0]; | |
var foundComment = false; | |
var i = 0; | |
while(i < obj.links.length){ | |
if((obj.links[i].type == 1) && (obj.links[i].target.data.comment_id == comment.comment_id) ){ |
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
# Function to close the dashdb connection | |
def dbclose(self): | |
try: | |
retrn = ibm_db.close(self.connection) | |
return retrn | |
except Exception as dbcloseerror: | |
logging.error("dbclose Exception %s"%(dbcloseerror)) | |
return 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
import os | |
import sys | |
import glob | |
import dlib | |
from skimage import io | |
from skimage.draw import polygon_perimeter | |
import traceback |
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
db.get(request.message.userMessage).then((database_value)=>{ | |
console.log("FETCHED DATABASE VALUE",database_value); | |
var feedback = request.message.userMessage; // Extract the feedback from the incoming Message. | |
fetchUserFeedback(feedback); | |
console.log(request.message); | |
}); |
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
var pubnub = PUBNUB({ | |
publish_key : /* YOUR PUBLISH KEY*/, | |
subscribe_key : /* YOUR SUBSCRIBE KEY*/ | |
}) |
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
function pub_publish(pub_msg){ | |
pubnub.publish({ | |
channel : channel_input, | |
message : pub_msg, | |
callback : function(m){ | |
console.log(m); | |
} | |
}); | |
}; |
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
function pub_subscribe(){ | |
pubnub.subscribe({ | |
channel : channel_output, | |
message : function(m){ | |
console.log(m); | |
message_listing(m); | |
}, | |
error : function (error) { | |
console.log(JSON.stringify(error)); | |
} |
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 systemInit(): | |
global port, loraM, client | |
obtain_port() | |
gpio_init() | |
emergencyVehicleState.setdefault("state",0) | |
#loraM handles all the loraEvents | |
loraM = MCLoRa(port) | |
success = loraM.testOK() | |
if success: |