Skip to content

Instantly share code, notes, and snippets.

View clarkzjw's full-sized avatar
🌴

Jinwei Zhao clarkzjw

🌴
View GitHub Profile
@clarkzjw
clarkzjw / regex.cpp
Created November 1, 2014 05:58
regex in C/C++
#include <stdio.h>
#include <sys/types.h>
#include <regex.h>
int main(int argc,char** argv)
{
int status,i;
int cflags=REG_EXTENDED;
regmatch_t pmatch[1];
const size_t nmatch=1;
regex_t reg;
@clarkzjw
clarkzjw / cmd.cpp
Created November 3, 2014 04:59
change the background color in cmd
#include <stdio.h>
#include <stdlib.h>
int main()
{
long time;
printf("I Love You");
for(; ;)
{
system("color a");
@clarkzjw
clarkzjw / NestedFunc.c
Created January 1, 2015 12:43
Nested function is supported as an extension in gcc, but not g++.
#include <stdio.h>
double foo(double a, double b)
{
double square(double a) { return a * a; }
return square(a) + square(b);
}
int main(int argc, char **argv)
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cv.h>
#include <highgui.h>
#include <iostream>
#include <queue>
#include <stdio.h>
#include <time.h>
#include <cv.h>
#include <highgui.h>
int main()
{
IplImage *img = cvCreateImage(cvSize(5000, 5000), IPL_DEPTH_8U, 1);
cvZero(img);
@clarkzjw
clarkzjw / video.cpp
Created February 17, 2015 05:41
OpenCV video example
#include <stdio.h>
#include <opencv\cv.h>
#include <opencv\cxcore.h>
#include <opencv\highgui.h>
int main()
{
IplImage* pFrame = NULL;
IplImage* pFrameNew = NULL;
#include <stdio.h>
int main()
{
char *str = "HelloWorld";
int a = *(int *)str;
if (a == 0x6c6c6548)
printf("Little endian\n");
else if (a == 0x48656c6c)
printf("Big endian\n");
return 0;
void CHowOldDlg::OnBnClickedButton1()
{
cv::Mat img = cv::imread("res/Test.jpeg");
CDC *pDC = GetDlgItem(IDC_Pic)->GetDC();
HDC hDC = pDC->GetSafeHdc();
CRect rect;
GetDlgItem(IDC_Pic)->GetClientRect(&rect);
int rw = rect.right - rect.left; //the width of your picture control
int rh = rect.bottom - rect.top;
if (!img.data){
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include <thrust/generate.h>
#include <thrust/sort.h>
#include <thrust/copy.h>
#include <iostream>
#include <algorithm>
#include <ctime>
#include <cstdlib>
Windows Registry Editor Version 5.00
[-HKEY_USERS\S-1-5-21-3156065619-4242713678-38689869-1001_Classes\directory\background\shell\Atom]
[-HKEY_USERS\S-1-5-21-3156065619-4242713678-38689869-1001\Software\Classes\directory\background\shell\Atom]
[-HKEY_CURRENT_USER\Software\Classes\directory\background\shell\Atom]