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
/* | |
* vivi/lib/heap.c: simple dynamic memory allocation routine | |
* | |
* Based on bootldr/heap.c | |
* | |
*/ | |
#include "config.h" | |
#include "machine.h" | |
#include "printk.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 <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <assert.h> | |
int totalRec = 1e8; | |
const int tbl[] = | |
{ | |
#define B2(n) n, n+1, n+1, n+2 | |
#define B4(n) B2(n), B2(n+1), B2(n+1), B2(n+2) |
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 <time.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <stdbool.h> | |
const int STARTYEAR = 1990, | |
STARTMONTH = 1, | |
STARTDAY = 1, | |
ENDYEAR = 2100; |
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
/* | |
* @Copyright chm <prehistoricpenguin@qq.com> | |
* | |
* a simple bit table program | |
* use an array of 8 chars as a bit map,illuminated as below: | |
* 7 6 5 4 3 2 1 0 | |
* <--------------- | |
* 0 0 0 0 0 0 0 0 | 0 | |
* 0 0 0 0 0 0 0 0 | 1 | |
* 0 0 0 0 0 0 0 0 | 2 |
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
/* | |
* simple expression parser | |
* example: 1+2-3 -> 12+3- | |
*/ | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
int lookahead; |
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
/* | |
* cdecl | |
*/ | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define MAXTOKEN 100 | |
enum TokenType {NAME, PARENS, BRACKETS}; |
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 xlrd | |
nameBook = xlrd.open_workbook("/home/chm/Documents/namesheet.xls") | |
markBook = xlrd.open_workbook("/home/chm/Documents/mark.xls") | |
nameSheet = nameBook.sheet_by_index(0) | |
markSheet = markBook.sheet_by_index(0) | |
fullmark = 0 | |
aboveninety = 0 |
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
/* | |
hdoj 1009 | |
@author: chm | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
struct T |
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
/* | |
uva 424 | |
author chm | |
*/ | |
#include <cctype> | |
#include <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
#include <cassert> | |
#include <list> |
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
/* | |
pat 1035 | |
author chm | |
*/ | |
#include <cctype> | |
#include <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
#include <cassert> |
OlderNewer