- 博客(29)
- 资源 (7)
- 收藏
- 关注
转载 shell 从文件中一行一行地读取
写法一:#!/bin/bashwhile read line<br />do<br /> echo $line #这里可根据实际用途变化done < urfile<br /> <br />_____________________________________________________<br /> <br />写法二:<br />#!/bin/bash<br />cat urfile | while read line<br />do<br /> echo $
2010-09-24 18:16:00
2502
原创 select精确到微秒
<br />#include <stdio.h>#include <sys/time.h>void delay(long int time_amount);int main(void) { long int time_amount; printf("Input the time amount:"); scanf("%ld", &time_amount); delay(time_amount); printf("Finished!/n"); return 0;}vo
2010-09-24 17:24:00
829
原创 A reminder for terminal control
<br />/* For memorial by double*/#include <stdio.h>#include <unistd.h>#include <termios.h>int get_choice(char * str, char ** menu, FILE * in, FILE * out);void check_redirect(void);int set_new_terminal_attr(struct termios * init_attr, struc
2010-06-20 15:03:00
337
原创 A remander for C to mysql
debian-lenny安装mysql-server: apt-get install mysql-server安装mysql-client: apt-get install mysql-client安装开发库: apt-get install libmysqlclient15-dev
2010-03-21 15:13:00
607
原创 已知某结构体变量中某一元素的地址求结构体变量的地址。
#include typedef struct abc { int a; int b; int c; struct abc * next;}abc;int main(void) { abc t1; abc * l; printf("add1 = %u/n", &t1); printf("add2 = %u/n", &(t1.next))
2009-11-14 17:02:00
1993
原创 巨数 阶乘
#include #include #define N 10000int main(int argc, char ** argv) { int i, j, k, l, m; int result[N] = {1, 1}; if (argc != 2 || (m = atoi(argv[1])) <= 0) { printf("Parameter error
2009-11-14 14:04:00
442
原创 递归调用的栈变化及函数调用示意
#include void main() { int a = 2; void e(int n); e(a); } void e(int n) { if (n > 0) { e(--n); printf("*%d*/n* ", n); e(n);
2009-11-11 12:45:00
945
原创 王爽 《汇编语言》课程设计2
; 王爽《汇编语言》的课题2,之前已经做过初步的调试。测试环境:VMware 6.5,操作系统DOS6.22;课题要求的功能都能实现。但在细节上还有些不尽如人意的地方。;比如程序的结构安排和设置时钟的输入格式等。等我有时间再做调整。;by:double; date:2009-10-07; ver:0.1assume cs:codesgcodesg segmentstar
2009-10-08 01:08:00
2301
原创 C语言实现的简单的print函数,只支持%c和%d。
/* 由C实现的简单的print函数,在屏幕的中间打印。*/void print_double(char *str,char a, int b) { int n,quot,rem,flag ; char ch1; n = 0; flag = 10; while (*str) { if (*str == %) { ch1 = *++str; if
2009-10-07 11:38:00
4652
原创 C语言中函数参数传递的方式。
/* Windows 环境下,C语言中我们所写的main函数在生成exe文件之后只是整个可执行文件的一部分。当然, * 是最关键的一部分。在main函数中,我们只需要关心如何定义变量,如何赋值,如何进行参数运算等问 * 题,至于如何向系统申请资源,如何在程序结束后释放资源,参数之间如何进行值传递等等问题我们一 * 概不用关心。但对一个完整的程序而言,这同样是至关重要的。这些工作是由我们
2009-10-07 00:16:00
5900
1
原创 When ESC is pressed, change the color of the character.
;The code is to display the 26 characters in the;center of the screen.When ESC is pressed,the character;change color.;INT 9 is replaced by my program.;by: double; date:2009-09-26; ver:0.1a
2009-09-26 17:05:00
684
原创 display CMOS time
;To display CMOS time on line 5 col 12.;It can be terminated by ^c;;by:double; date:2009-09-26; ver:0.1assume cs:codesg,ds:datasg,ss:stacksgdatasg segment db ??/??/?? ??:??:??,
2009-09-26 02:15:00
419
原创 print numbers on the screen.(show_str and dtoc function)
;show_str, dtoc functions.;by:double; date:2009-09-20; ver:0.1assume cs:codesg,ss:stacksg,ds:datasgdatasg segment dw 123,12666,1,8,3,38,339,284,374,11124 db 12 dup (0)datas
2009-09-20 22:46:00
492
原创 print 'welcome to masm!' in the center of the screen.
;by:double; date:2009-09-19; ver:0.1assume cs:codesg,ds:datasgdatasg segment db welcome to masm!datasg endscodesg segmentstart: mov ax,datasg mov ds,ax
2009-09-19 15:56:00
409
原创 addressing manner in structured data accessing
;by:double; date:2009-09-19; ver:0.1assume cs:codesg,ds:datasg,es:tablesgdatasg segment db 1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985 db 1986,1987,19
2009-09-19 09:36:00
306
原创 100001 devided by 376
;100001 devided by 376;by:double; data:2009-09-17; ver:0.1assume cs:codesg,ds:datasgdatasg segment dd 100001datasg endscodesg segmentstart: mov ax,datasg mov ds,ax mov ax,ds
2009-09-18 12:15:00
476
原创 balanced binary searching tree(BBST)
/* As we all know that, binary searching is a efficiency searching method, * but, there is a precondition that the elements must be sorted in * either ascending or descending. So when the data are
2009-08-23 18:18:00
421
原创 dynamic searching tree
/* Dynamic searching tree, DST is created in searching progress. * If the element is found in the tree, TRUE will be returned * as well as the tree node.Otherwise, if element is not found * , n
2009-08-13 23:16:00
312
原创 binary_search
/* sequence search and binary search,Nothing to say*/#include "/usr/c/head.h"#define EQ(x, y) ((x) == (y))#define LT(x, y) ((x) < (y))#define LQ(x, y) ((x) <= (y))typedef int key_type;
2009-08-13 10:25:00
302
原创 Huffman decoding.
/* Huffman decoding. * In order to get huffman codes of elements with different weights, we * build a huffman tree, which is also called strict binary tree ,and then * we trace from leafs to th
2009-08-02 01:29:00
620
原创 Huffman coding.
/* Huffman coding is widely used in video audio and image compression. * It can greatly reduce the size of files. The following codes show the * basic principle of huffman coding. * by: double;
2009-08-01 17:22:00
417
原创 binary threading tree
/* Binary threading tree can be used where frequent searching are needed. * Because there is no recursive function and the codes run quite efficiently. */#include "/usr/c/head.h"typedef ch
2009-07-25 13:48:00
282
原创 Floyd algorithm
/* Dijkstra algorithm can only calculate the lowest cost from one root vertex to others. The time-complexity is n*n. * For vertex-to-vertex lowest cost calculating, you can use Dijkstra for n times.
2009-07-12 16:08:00
299
原创 Dijkstra algorithm.
/* As we all know that, in routing protocol OSPF, algorithm Dijkstra is used to calculate the shortest path. * The following codes show us the basic operation in Dijkstra. But there are still many f
2009-07-12 13:29:00
360
原创 critical_path
/* Critical_path is much more useful in our life. * just be opposite to the so called "Bucket Principle", * the total time of one project is detemined by the cumulative * longest time of its co
2009-07-05 16:22:00
326
原创 mini_spanning_tree
/* * So, maybe this is the core of the spanning-tree protocol used between * switches to avoid link redundancy which will definitely cause broadcast * storm. Of course, in the IOS of CISCO cat
2009-06-21 12:16:00
422
原创 UDG To CS_tree
/* The purpose of this code is to creat Child-Sibling Tree * from Non-connected UG. * version:0.1 * by double * date:2009-06-16 */#include "/usr/c/head.h"#define MAX 20#ifndef
2009-06-16 22:53:00
386
原创 有向图的DFS和BFS算法实现
/*OL_graph.c无向图的DFS和BFS遍历。 *该代码是对教科书中算法的实现 *由于水平所限,代码雍肿在所难免,欢迎批评指正,欢迎讨论切搓 * by: double; version: 0.1; date: 2009-06-13 */ #include "/usr/c/head.h"#ifndef MAX_INT#define MAX_
2009-06-13 21:45:00
3829
原创 无向图的DFS和BFS算法实现
/*AML_graph.c无向图的DFS和BFS遍历。 *该代码是对教科书中算法的实现 *由于水平所限,代码雍肿在所难免,欢迎批评指正,欢迎讨论切搓 * by: double; version: 0.1; date: 2009-06-13 */ #include "/usr/c/head.h"#ifndef MAX_INT#define MAX
2009-06-13 21:43:00
1391
国内某大型公司IDC机房技术建议书
2010-07-11
国内某大公司IDC方案设计
2010-07-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人