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
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
#include <stdio.h> | |
#include <dlfcn.h> | |
void ppp() | |
{ | |
} | |
int main(int argc, const char * argv[]) | |
{ | |
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
// For UUID | |
#include <Rpc.h> | |
#pragma comment(lib, "Rpcrt4.lib") | |
int _tmain(int argc, _TCHAR* argv[]) | |
{ | |
// Create a new uuid | |
UUID uuid; | |
RPC_STATUS ret_val = ::UuidCreate(&uuid); |
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
class viewWeb; | |
class view{ | |
public: | |
virtual ~view() {} | |
static view* creat(); | |
protected: | |
view() { } | |
}; | |
class viewWeb : public view{ | |
public: |
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
LONG lStyle = GetWindowLong(hwnd, GWL_STYLE); | |
lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU); | |
SetWindowLong(hwnd, GWL_STYLE, lStyle); | |
LONG lExStyle = GetWindowLong(hwnd, GWL_EXSTYLE); | |
lExStyle &= ~(WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE); | |
SetWindowLong(hwnd, GWL_EXSTYLE, lExStyle); | |
SetWindowPos(hwnd, NULL, 0,0,0,0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER); |
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
import zlib | |
from glob import glob | |
def zipstreams(filename): | |
"""Return all zip streams and their positions in file.""" | |
with open(filename, 'rb') as fh: | |
data = fh.read() | |
i = 0 | |
while i < len(data): | |
try: |
OlderNewer