- TFTP server
- Network boot files: netboot images
- DHCP server
- NAT
// Console logging | |
#define RED "\x1B[31m" | |
#define GREEN "\x1B[32m" | |
#define CYAN "\x1B[36m" | |
#define RESET "\x1B[0m" | |
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) | |
#define LOG_FORMATTED(COLOR, FORMATTED_MSG, ...) fprintf(stderr, COLOR "[My Lib] %s() in [%s:%i] " RESET FORMATTED_MSG "\n", __func__, __FILENAME__, __LINE__, ##__VA_ARGS__) | |
#define LOG_FORMATTED_INFO(FORMATTED_MSG, ...) LOG_FORMATTED(CYAN, FORMATTED_MSG, ##__VA_ARGS__) |
# List all variables and values in cmake | |
get_cmake_property(_variableNames VARIABLES) | |
list (SORT _variableNames) | |
foreach (_variableName ${_variableNames}) | |
message(STATUS "${_variableName}=${${_variableName}}") | |
endforeach() | |
Mat img = imread("filename.jpg",CV_LOAD_IMAGE_COLOR); | |
unsigned char *input = (unsigned char*)(img.data); | |
int r,g,b; | |
for(int i = 0;i < img.cols;i++){ | |
for(int j = 0;j < img.rows;j++){ | |
b = input[img.cols * j + i ] ; | |
g = input[img.cols * j + i + 1]; | |
r = input[img.cols * j + i + 2]; | |
} |
#include <chrono> | |
#include <utility> | |
/** | |
* @brief find execution time of a function with non-void return type | |
* | |
* @tparam F function signature in form return_type(args...). Eg: double(int, int, char*) | |
* @tparam R set clock resolution from chrono clock (default = std::chrono::microseconds) | |
* @tparam Args varidac typenames for function arguments | |
* @param dt execution time as per resolution given in R |
""" | |
Dependency: | |
Python 2.7 | |
festival (can be downloaded from apt-get)[http://www.cstr.ed.ac.uk/projects/festival/] | |
Raspberry pi audio device select: | |
amixer cset numid=3 0 # auto select (inaccurate) | |
amixer cset numid=3 1 # analog jack 3.5mm | |
amixer cset numid=3 2 # HDMI |
// | |
// Created by sumit on 20/9/17. | |
// | |
#include "Annotate.h" | |
// ----------- draw -------------- | |
template <> void Annotate<cv::Point_<int>>::draw(cv::Mat &showImage) { | |
for(int i=0; i<mArray.size(); i++) |
// usage | |
std::vector<std::string> exts{".jpg", ".png"}; | |
std::vector<std::string> files = getFilesInDir("/path/to/root/directory/", exts, true); | |
// -------------------------------------------------------- | |
#define BOOST_FILESYSTEM_NO_DEPRECATED | |
#include <boost/filesystem.hpp> |