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
| nohup omxplayer --win 0,0,640,480 -n -1 SampleVideo_640x360_30mb.mp4 & | |
| nohup omxplayer --win 640,0,1280,480 -n -1 SampleVideo_640x360_30mb.mp4 & | |
| nohup omxplayer --win 1280,0,1920,480 -n -1 SampleVideo_640x360_30mb.mp4 & | |
| nohup omxplayer --win 0,480,640,960 -n -1 SampleVideo_640x360_30mb.mp4 & | |
| nohup omxplayer --win 640,480,1280,960 -n -1 SampleVideo_640x360_30mb.mp4 & |
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
| string GBKToUTF8(const char* strGBK) | |
| { | |
| int len = MultiByteToWideChar(CP_ACP, 0, strGBK, -1, NULL, 0); | |
| wchar_t* wstr = new wchar_t[len+1]; | |
| memset(wstr, 0, len+1); | |
| MultiByteToWideChar(CP_ACP, 0, strGBK, -1, wstr, len); | |
| len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); | |
| char* str = new char[len+1]; | |
| memset(str, 0, len+1); | |
| WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL); |
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 <string> | |
| #include <locale.h> | |
| // 需包含locale、string头文件、使用setlocale函数。 | |
| std::wstring StringToWstring(const std::string str) | |
| {// string转wstring | |
| unsigned len = str.size() * 2;// 预留字节数 | |
| setlocale(LC_CTYPE, ""); //必须调用此函数 | |
| wchar_t *p = new wchar_t[len];// 申请一段内存存放转换后的字符串 | |
| mbstowcs(p,str.c_str(),len);// 转换 |
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
| std::string s(std::istreambuf_iterator<char>(Poco::FileInputStream(string("t.txt"))), {}); |
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
| #!/bin/bash | |
| xrandr --newmode "1920x1080_60_001" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync | |
| xrandr --addmode VGA-1 "1920x1080_60_001" | |
| xrandr --output VGA-1 --mode "1920x1080_60_001" |
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
| struct ChannelMixerParameter | |
| { | |
| int output_channel; | |
| double r; | |
| double g; | |
| double b; | |
| }; | |
| void channel_mixer(const cv::Mat &src, cv::Mat &m, const ChannelMixerParameter ¶m) | |
| { |
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
| void main() | |
| { | |
| WSADATA wsaData; | |
| auto success = WSAStartup(MAKEWORD(2, 2), &wsaData); | |
| // ERROR_CHECK | |
| SOCKET m_sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); | |
| // ERROR_CHECK | |
| sockaddr_in addr = { 0 }; | |
| addr.sin_addr.S_un.S_addr = inet_addr("192.168.1.118"); | |
| addr.sin_family = AF_INET; |
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
| void match(Mat &a, Mat &b) | |
| { | |
| Mat r; | |
| matchTemplate(a, b, r, CV_TM_SQDIFF_NORMED); | |
| double minVal; double maxVal; Point minLoc; Point maxLoc; | |
| Point matchLoc; | |
| minMaxLoc(r, &minVal, &maxVal, &minLoc, &maxLoc, Mat()); |
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
| auto conn = std::make_shared<QMetaObject::Connection>(); | |
| *conn = QObject::connect(obj, &Object::signal, this, [this, conn]() { | |
| disconnect(*conn); | |
| }); |
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
| wstring UTF8ToUTF16(const char *strUTF8) | |
| { | |
| int len = MultiByteToWideChar(CP_UTF8, 0, strUTF8, -1, NULL, 0); | |
| wchar_t* wszGBK = new wchar_t[len + 1]; | |
| memset(wszGBK, 0, len * 2 + 2); | |
| MultiByteToWideChar(CP_UTF8, 0, strUTF8, -1, wszGBK, len); | |
| wstring ret(wszGBK); | |
| if (wszGBK) { | |
| delete[] wszGBK; | |
| } |
NewerOlder