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
#include "stdafx.h" | |
#include <Windows.h> | |
#include <imagehlp.h> | |
#include <locale.h> | |
#pragma comment(lib,"DbgHelp.lib") | |
BOOL CALLBACK CallBackProc( PSYMBOL_INFO pSymInfo, ULONG SymbolSize, PVOID UserContext ) | |
{ | |
printf( "函数名: %s\r\n地址: %08X \r\n\r\n", pSymInfo->Name, pSymInfo->Address ); | |
return TRUE; |
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
#include <Windows.h> | |
#include <stdio.h> | |
#include "dbghelp.h" | |
BOOL WINAPI InitSymHandler( ) | |
{ | |
BOOL bReturn = FALSE; | |
HANDLE hFile; | |
CHAR DirPath[MAX_PATH] = {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
extern GetStdHandle | |
extern WriteConsoleA | |
extern ExitProcess | |
[SECTION .data] | |
align 32 | |
_dummy: | |
dd 0 | |
_message: | |
db 'Hello, world!', 0dh, 0ah |
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
#include <QRubberBand> | |
class RubberBand : public QRubberBand | |
{ | |
Q_OBJECT | |
public: | |
RubberBand(QWidget *parent = 0, QColor c = QColor("red"), Shape s = QRubberBand::Rectangle); | |
void paintEvent(QPaintEvent *); | |
private: | |
QColor color; | |
}; |
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
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; | |
} |
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
auto conn = std::make_shared<QMetaObject::Connection>(); | |
*conn = QObject::connect(obj, &Object::signal, this, [this, conn]() { | |
disconnect(*conn); | |
}); |
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 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 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 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 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" |