The input to the CAN Unpack block, if you are sending it a bus, must be a non-virtual bus with the following structure
{ ... 'CAN_MESSAGE_BUS', ... '', ... '', ... 'Auto', ... '-1', ... '0', {...
import numpy as np | |
def checksum_uint8(vec): | |
""" | |
Get uint8 checksum from list-like object | |
Examples: | |
checksum_uint8([0, 1, 2, 3, 4, 5]) --> 241 | |
checksum_uint8([10, 50, 36, 200, 210]) --> 6 | |
""" |
<!-- See https://stackoverflow.com/questions/40858456/how-to-display-a-javascript-var-in-html-body --> | |
<html> | |
<head> | |
<script> | |
function displayNumber(number) { | |
document.getElementById("someID").innerHTML = number.toString(); | |
} | |
</script> | |
</head> | |
<head> | |
<script> | |
function flashBackground() { | |
document.getElementById("element").style.background = 'White'; | |
setTimeout(() => {document.getElementById("element").style.background = 'Yellow';}, 100) | |
} | |
</script> | |
</head> | |
<head> | |
<script> | |
window.setInterval(function() {myFunction()}, 500) | |
function myFunction() { | |
/* Do stuff */ | |
} | |
</script> | |
</head> |
<head><script> | |
function initialize() | |
/* Initialize the web page */ | |
{ | |
/* Do stuff */ | |
} | |
</script></head> | |
<body onload="initialize()"> | |
set root=C:\Users\user\Anaconda3 | |
call %root%\Scripts\activate.bat %root% | |
call activate py37 | |
call cd "C:\Users\TNiederhauser\Dropbox (Medic)\MedicData\Floor Scale" | |
call jupyter lab |
import os | |
import pendulum | |
def create_data_directory( | |
data_kind, # 'VolCal' | |
data_source_id, | |
timezone, | |
parent_directory | |
): |
# See https://stackoverflow.com/questions/7894856/line-contains-null-byte-in-csv-reader-python | |
with open(path_to_csv_file) as f: | |
reader = csv.reader((x.replace('\0', '') for x in f), delimiter=',') # Handle null values | |
while True: | |
try: | |
line = next(reader) | |
except StopIteration: | |
break | |
print(line) # process lines |
def get_ranges_in_between_ranges(df, start_name, stop_name): | |
""" | |
Get range boundaries in between range boundaries arranged to be strictly increasing. | |
For example if we had three range boundaries where the range start and stop values | |
are found in two separate columns in a dataframe, | |
start, stop | |
----------- | |
0, 5 | |
7, 8 |