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
func mySimpleFileRead(path: String) throws -> UnitsData { | |
let fileName = (path as NSString).expandingTildeInPath | |
let url = URL(fileURLWithPath: fileName) | |
let data = try Data(contentsOf: url) | |
return try JSONDecoder().decode(UnitsData.self, from: data) | |
} |
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
/* | |
This code clears the u-blox on a MKR NB 1500 of all certificates. | |
*/ | |
// baud rate used for both Serial ports | |
unsigned long baud = 115200; | |
// Must be large enough to capture all |
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
# have the channels to be the same. | |
DEFAULT_CHANNEL=11 | |
echo "Setting up wifi monitor interface on" $WIPHY | |
#ORIG sudo iw phy $WIPHY interface add mon0 type monitor flags none control otherbss | |
sudo iw $WIPHY interface add mon0 type monitor flags none control otherbss | |
echo "Bringing up $MONIF" | |
#ORIG sudo ifconfig mon0 up promisc | |
# I did this by accident. In case it mattered. I already had the network in use so no telling. |
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
# Background | |
So, filed an issue with the arduino gcp library I am using. Its (here)[https://github.com/GoogleCloudPlatform/google-cloud-iot-arduino/issues/230] | |
# Pivot | |
I was looking through code and getting lost, so I thought it might be helpful to see what happens in wireshark. | |
I figure I don't know SSL/TLS so at least just running a tool might enlighten me about the subject as well as perhaps | |
see where the failure occurs. For instance in GCP I dont see any errors in logs, so I am very concerned that it might be | |
failing after getting time sync from ntp server prior to first reporting of telemetry via mqtt. (From my limited time with | |
the code tracing it fails on the first read with a read failure 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
void setupWifi() { | |
Serial.println("Starting wifi"); | |
WiFi.begin(ssid, password); | |
Serial.println("Connecting to WiFi"); | |
while (WiFi.status() != WL_CONNECTED) { | |
delay(100); | |
} | |
Serial.println("Waiting on time sync..."); |
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
sobel_vertical = nd.array(( | |
(1,0,-1), | |
(2,0,-2), | |
(1,0,-1) | |
)) | |
print("\nSobel vertical transform Gx", end='') | |
print(sobel_vertical) | |
rotation_90_x = nd.array(( | |
( 1, 0, 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 one(): | |
return "this is function one" | |
def two(): | |
return "this is function two" | |
def three(): | |
return "this is function three" | |
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
a min heap implementation for use with micropython | |
class ns_Heap(object): | |
"""" | |
Attributes: | |
heap: List representation of a min heap |
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
# Example usage of state machine class | |
# | |
# | |
# | |
class ns_MouseAction: | |
def __init__(self, action): | |
self.action = action | |
def __str__(self): |
NewerOlder