This file contains hidden or 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 datetime_to_timestamp(date, date_format): | |
| """ | |
| Converts date/time string to unix timestamp. Note that | |
| the date/time string will interpreted using the local | |
| timezone on your system. | |
| The resulting unix timestamp will be in GMT time. | |
| """ | |
| dt = datetime.strptime(date, date_format) | |
| return int(time.mktime(dt.timetuple())) |
This file contains hidden or 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
| data = np.array([ | |
| [1.0, 1.1, 1], | |
| [1.0, 1.0, 1], | |
| [0.0, 0.0, 2], | |
| [0.0, 0.1, 2], | |
| ]) | |
| labels = data[:,-1] | |
| points = data[0:,:-1] |
This file contains hidden or 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 csv | |
| import time | |
| import sqlite3 | |
| from datetime import datetime | |
| readings = [] | |
| with open('data.csv', 'r') as csvfile: | |
| data = csv.reader(csvfile) | |
| next(data) | |
| for line in data: |
This file contains hidden or 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 logging | |
| import socket | |
| import SocketServer | |
| import sys | |
| import time | |
| import threading | |
| from ftplib import FTP | |
| from os import listdir, remove, rename, stat | |
| from os.path import isfile, join, splitext, isfile |
This file contains hidden or 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
| #include <unistd.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <iostream> | |
| #include <string> | |
| #include <opencv2/core/core.hpp> | |
| #include <opencv2/highgui/highgui.hpp> | |
| #include "opencv2/imgproc/imgproc.hpp" |
This file contains hidden or 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
| #include <iostream> | |
| #include <math.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <opencv2/imgproc/imgproc.hpp> | |
| #include <opencv2/highgui/highgui.hpp> |
This file contains hidden or 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
| #include <iostream> | |
| #include <math.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <opencv2/imgproc/imgproc.hpp> | |
| #include <opencv2/highgui/highgui.hpp> |
This file contains hidden or 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
| #include <iostream> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <opencv2/imgproc/imgproc.hpp> | |
| #include <opencv2/highgui/highgui.hpp> | |
| #include <X11/Xlib.h> |
This file contains hidden or 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
| #include <SD.h> | |
| #include <String.h> | |
| const int CS_PIN = 10; | |
| char BACKUP_FILE[] = "backup.txt"; | |
| char PENDING_FILE[] = "pending.txt"; | |
| void setup() | |
| { |
This file contains hidden or 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
| #include <fcntl.h> | |
| #include <math.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <sys/time.h> | |
| #include <sys/types.h> | |
| #include <unistd.h> | |
| #include <iostream> | |
| #include <sstream> |