摘要: 如果想在windows下播放音频或视频文件,可以使用api函数中的mcisendstring实现,非常简单。 源代码如下: /****************************************************************/ /* 超简易媒体播放器 */ /* 作者: 卢培培(goodname008) */ /*************************......
摘要: singleton可算是最简单的模式,本文记述小鸡射手遇到的问题及反思。 对于singleton,小鸡射手想能不能: 1. 将private static成员变量直接声明为singleton类? 2. 将要调用的方法直接声明为static? 在项目中,采用vc++按方式1实现singleton类,编译、链接一切ok。运行时却出现了内存方面的exception,经调试发现:static成员变量没有......
哈夫曼编/译码演示系统的C程序 /*==============================================*//* *//* huffman.c(pp) - a huffman arithmetic demonstration *//* smith_135@163.com *//* qq: 58101543 *//* version 0.9 *//* copyright (c) meteor135 *//* 2004.7.13 *//* *//*==============================================*/#include <stdio.h>#include <stdlib.h>#ifdef __cplusplus#include <conio.h>#include <ctype.h>#include <string.h>#endif /*__cplusplus*//*树结构与全局结构指针*/struct node{ int num;/*结点编号*/ char c; int weight; int parent; int lchild,rchild;} * ht;/*常量文件名*/const char *tablefilename = "hfmtbl.txt";const char *sourcefilename = "srctext.txt";const char *codefilename = "hfmcode.txt";const char *decodefilename = "decodetext.txt";const char *treeviewfilename = "treeview.txt";/*打印格式字符串常量*/const char *printformatstr = "%4d %13c %13d %13d %13d %13d\r\n";/*读取格式字符串常量*/const char *readformatstr = "%d %c %d %d %d %d";/*打印参数宏*/#define print_param(i) ht[(i)].num,ht[(i)].c,ht[(i)].weight,\ ht[(i)].parent,ht[(i)].lchild,ht[(i)].rchild/*读取参数宏*/#define read_param(i) &ht[(i)].num,&ht[(i)].c,&ht[(i)].weight,\ &ht[(i)].parent,&ht[(i)].lchild,&ht[(i)].rchild/*打印格式与参数宏*/#define read_format_param(i) readformatstr,read_param(i)/*读取格式与参数宏*/#define print_format_param(i) printformatstr,print_param(i)/******************************************...
下一页 摘要:squid我对它的了解还不够多,下面的测试仅仅是我实战的记录。可以保证按照这样做可以成功,不过squid.conf肯定还有很多地方配置的不完善,还好,这段时间会一直看这方面的文档。 这篇文章是全文的第二部分,第一部分可以参考面向缓存的站点规划1--mod_proxy 实战测试2: 1.实验计划:安装squid2.5 stable1,然后打squid-2.5.stable1-combined-log......