摘要: #include <stdio.h>#include <stdlib.h>#define MAXLENGTH 1000struct linkNode{ int date; struct linkNode *link;};typedef struct linkNode linkNode;linkNode* createLinkNode(){ int i ; linkNode *node ,*p,*_temp; node = (linkNode*)malloc(sizeof(linkNode)); if(!node){ printf("分配内存失败... 阅读全文
posted @ 2012-09-22 18:15 ﹏Sakura 阅读(189) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>#define MAXLENGTH 1000typedef struct{ int total; int date[MAXLENGTH];}lineList;void showList(lineList* list){ int i; if(list->total ==0){ printf("空的线性表\n"); return; } printf("当前线性表状态:"); for(i=0;i<list->total;i++){ printf( 阅读全文
posted @ 2012-09-20 00:21 ﹏Sakura 阅读(191) 评论(0) 推荐(0) 编辑
摘要: phpredis是php的一个扩展,效率是相当高有链表排序功能,对创建内存级的模块业务关系很有用;以下是redis官方提供的命令使用技巧:下载地址如下:https://github.com/owlient/phpredis(支持redis 2.0.4)Redis::__construct构造函数$redis = new Redis();connect, open链接redis服务参数host: string,服务地址port: int,端口号timeout: float,链接时长 (可选, 默认为 0 ,不限链接时间)注: 在redis.conf中也有时间,默认为300pconnect, po 阅读全文
posted @ 2012-09-18 15:38 ﹏Sakura 阅读(162) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h"#define N 5void main(){ int a[5],num,i=0,j,temp; while( i< N ){ printf("请输入1~9的数"); scanf("%d",&num); if(num>9 || num<0){ printf("输入范围不正确\n"); continue; } a[i++] = num; } printf("输入的数为:"); for(i=0;i<N;i++) prin... 阅读全文
posted @ 2012-09-16 14:45 ﹏Sakura 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Varnish是一款高性能的开源HTTP加速器,挪威最大的在线报纸 Verdens Gang 使用3台Varnish代替了原来的12台Squid,性能比以前更好。但与老牌的squid相比,各有各的优劣势,网上大量的相对比较只是在其个人对自己熟悉的应用的最大使用上的发挥而已,可能squid到了有能力的人手上才足以发挥最强大的威力Varnish采用了“Visual Page Cache”技术,在内存的利用上,Varnish比Squid具有优势,它避免了Squid频繁在内存、磁盘中交换文件,性能要比Squid高。通过Varnish管理端口,可以使用正则表达式快速、批量地清除部分缓存,这一点是Squi 阅读全文
posted @ 2012-09-11 11:08 ﹏Sakura 阅读(5542) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h"#include "stdlib.h"void main(){ FILE *fp1 ,*fp2; char c; if((fp1 = fopen("test.txt","w")) == NULL){ printf("can't create the file"); } while((c = getchar()) != '\n') fputc(c,fp1); fclose(fp1); if( (fp2 = fopen("test 阅读全文
posted @ 2012-09-09 17:39 ﹏Sakura 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 大家有好的方法还望赐教<script>reg = /http:\/\//i;str = '周xx的新歌试听地址 http://www.mp3.baidu.com/xxx';ret = str.search(reg);//alert(str.substr(ret));reg = /http:\/\//i;newreg = / /;newstr = '周xx的新歌试听地址 http://www.mp3.baidu.com/xxx 啊啊啊啊';ret = str.search(reg);_newstr = str.substr(ret);newstr = 阅读全文
posted @ 2012-09-09 01:26 ﹏Sakura 阅读(1369) 评论(0) 推荐(0) 编辑
摘要: <?php //初始化gridfs $conn = new Mongo(); //连接MongoDB $db = $conn->photos; //选择数据库 $grid = $db->getGridFS(); //取得gridfs对象 //gridfs有三种方式存储文件 //第一种直接存储文件 $id = $grid->storeFile("./logo.png"); //第二种存储文件二进制流 $data = get_file_contents("./logo.png"); $id = $grid->storeBytes 阅读全文
posted @ 2012-09-04 20:15 ﹏Sakura 阅读(2830) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>void swap(int *p1,int *p2){ int p; p = *p1; *p1 = *p2; *p2 = p;}void main(){ int a,b; int *p1 = &a,*p2 = &b; printf("请输入两个数:"); scanf("%d%d",&a,&b); if(a<b){ swap(p1,p2); } printf("变量a 的值是%d 变量b的值是%d ",a,b); return ;}//通过指针交换两个 阅读全文
posted @ 2012-09-02 00:23 ﹏Sakura 阅读(176) 评论(0) 推荐(0) 编辑
摘要: //生成 100~200的随机数#include <stdio.h>#include <stdlib.h>int min;int find(){ int i, y, x,max; x = rand()%101 + 100; max = x; min = x; printf("生成的随机数为:\n%d\n",x); for(i =0;i<9;i++){ y = rand()%101 + 100; printf("%d\t\n",y); if(y>max) max = y; if(y<min) min = y; } 阅读全文
posted @ 2012-09-01 10:32 ﹏Sakura 阅读(179) 评论(0) 推荐(0) 编辑