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 <string.h> | |
const int max_length = 100; | |
int match_result[max_length]; | |
char source[max_length * max_length]; | |
char pattern[max_length]; | |
char dest[max_length]; |
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
/* qmemorypool.c | |
* By ecnelises | |
* 2015.11.10午 | |
* 一个简易的类 deque 数据结构实现 | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> |
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 "expr.h" | |
#include <string.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <stdio.h> | |
#define ISPMO(x) (((x) == '+') || ((x) == '-')) | |
#define ISMDO(x) (((x) == '*') || ((x) == '/')) | |
#define ISO(x) (ISPMO(x) || ISMDO (x)) | |
#define ISDIG(x) (isdigit(x) || ((x) == '.')) |
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 <string.h> | |
#include <ctype.h> | |
#include <stdlib.h> | |
#define currenttype (lexes[ntoken].type) | |
#define currentname (lexes[ntoken].name) | |
#define TOKEN_TYPE_INT 0x01 | |
#define TOKEN_TYPE_DOUBLE 0x02 |
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
/* | |
* regex.c | |
* Qiu Chaofan, 2016/1/12 | |
* | |
* Regular expression engine. | |
* | |
* Features: | |
* Support matching for | * ? + . () | |
* No error handling is considered yet. | |
*/ |
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 <ctype.h> | |
int main(int argc, char const *argv[]) | |
{ | |
char ch, previous = '\0'; | |
FILE *fp_in = fopen("in_1.txt", "r"); | |
FILE *fp_out = fopen("1454001_1_out.txt", "w"); | |
/* |
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 <algorithm> | |
#include <string> | |
#include <cctype> | |
using namespace std; | |
// Case-insensitive Compare | |
bool ci_comp(char c1, char c2) |
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
require 'mechanize' | |
# xuanke.tongji.edu.cn 现采用统一认证登录,原登录方式不再使用 | |
class NewGpaSpider | |
# 学期内所有课程 | |
attr_reader :courses | |
def initialize(userid, password, term) | |
@agent = Mechanize.new |
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
# 一行代表数独实际的一行,而不是一个九宫格 | |
$soduku = [ | |
[6, 0, 0, 0, 0, 0, 0, 0, 0], | |
[0, 4, 1, 2, 9, 6, 0, 0, 0], | |
[0, 2, 5, 0, 0, 3, 6, 0, 4], | |
[0, 3, 0, 6, 7, 5, 8, 0, 0], | |
[8, 0, 6, 9, 0, 4, 5, 0, 2], | |
[4, 0, 9, 0, 0, 0, 0, 6, 0], | |
[7, 9, 0, 0, 6, 8, 0, 2, 0], | |
[0, 0, 8, 4, 5, 0, 3, 0, 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
// Serialize.hpp | |
// 简易的C++二进制序列化类,模仿boost::serialization | |
// 邱超凡 2016.9.9 | |
#ifndef CPP_SERIALIZE_HPP | |
#define CPP_SERIALIZE_HPP | |
#include <fstream> | |
#include <algorithm> | |
#include <type_traits> |
OlderNewer