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 <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
/* | |
combination for get m from num of numbers | |
*/ | |
class combination | |
{ | |
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
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
inline void redirect(void) | |
{ | |
#ifdef DEBUG | |
freopen("input.txt","r",stdin); | |
freopen("output.txt","w",stdout); |
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 <iostream> | |
#include <vector> | |
#include <vcg/complex/complex.h> | |
#include <wrap/io_trimesh/import.h> | |
#include <wrap/io_trimesh/export.h> | |
using namespace std; | |
// Forward declarations needed for creating the used types | |
class CVertexO; |
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 <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <string> | |
#include <sstream> | |
#include <random> | |
#include <assert.h> | |
#include <algorithm> | |
#include <time.h> | |
#include <set> |
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 <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <string> | |
#include <sstream> | |
#include <random> | |
#include <assert.h> | |
#include <algorithm> | |
#include <ctime> | |
#include <utility> |
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 <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <string> | |
#include <sstream> | |
#include <random> | |
#include <assert.h> | |
#include <algorithm> | |
#include <time.h> | |
using namespace std; |
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<cstdio> | |
int main() | |
{ | |
int a[5]={1,2,3,4,5}; | |
printf("sizeof(&a):%d\tsizeof(a)%d\n",sizeof(&a),sizeof(a)); | |
int *ptr=(int *)(&a+1); | |
printf("a=%d,&a=%d,a+1=%d,&a+1=%d\n",a,&a,a+1,&a+1); | |
printf("%d,%d",*(a+1),*(ptr-1)); |
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 <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
void getFromtxt(char *name, vector<int>&nums) | |
{ | |
ifstream input; | |
input.open(name);//read from a txt file |
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
;Code from http://mikeos.berlios.de/write-your-own-os.html | |
;See my cool solution to boot this 'OS‘,i think it's much cool. | |
; http://haiyangxu.github.io/posts/2014/2014-05-21-write_a_bootloader | |
BITS 16 | |
start: | |
mov ax, 07C0h ; Set up 4K stack space after this bootloader | |
add ax, 288 ; (4096 + 512) / 16 bytes per paragraph | |
mov ss, ax |
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
# -*- coding: utf-8 -*- | |
#test on python 3.4 ,python of lower version has different module organization. | |
import http.server | |
from http.server import HTTPServer, BaseHTTPRequestHandler | |
import socketserver | |
PORT = 8080 | |
Handler = http.server.SimpleHTTPRequestHandler |