Skip to content

Instantly share code, notes, and snippets.

View clarkzjw's full-sized avatar
🌴

Jinwei Zhao clarkzjw

🌴
View GitHub Profile
@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>
#include <time.h>
#include <cv.h>
#include <highgui.h>
int main()
{
IplImage *img = cvCreateImage(cvSize(5000, 5000), IPL_DEPTH_8U, 1);
cvZero(img);
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cv.h>
#include <highgui.h>
#include <iostream>
#include <queue>
@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)
@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 / 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;