摘要: 多线程 互斥量 信号量 条件变量 阅读全文
posted @ 2012-10-30 18:08 cs_jin_scor 阅读(14035) 评论(1) 推荐(5) 编辑
  2012年11月1日
摘要: 单例模式也称为单件模式、单子模式,可能是使用最广泛的设计模式。其意图是保证一个类仅有一个实例,并提供一个访问它的全局访问点,该实例被所有程 序模块共享。有很多地方需要这样的功能模块,如系统的日志输出,GUI应用必须是单鼠标,MODEM的联接需要一条且只需要一条电话线,操作系统只能有一 个窗口管理器,一台PC连一个键盘。单例模式有许多种实现方法,在C++中,甚至可以直接用一个全局变量做到这一点,但这样的代码显的很不优雅。 使用全局对象能够保证方便地访问实例,但是不能保证只声明一个对象——也就是说除了一个全局实例外,仍然能创建相同类的本地实例。《设计模式》一书中给出了一种很不错的实现,定义一个单例 阅读全文
posted @ 2012-11-01 20:26 cs_jin_scor 阅读(1514) 评论(0) 推荐(0) 编辑
  2012年9月10日
摘要: #include<iostream>bool Replace(char *ori);void main(){ char * str= "i am happy now"; Replace(str);}bool Replace( char *ori){ if(NULL == ori) return false; int spacenum = 0; int len = strlen(ori); while('\0' != *ori) { if(' ' == *ori){ ++ spacenum; } ++ ori; } char *re 阅读全文
posted @ 2012-09-10 20:19 cs_jin_scor 阅读(214) 评论(0) 推荐(0) 编辑
  2012年6月17日
摘要: #include<iostream>#include<ostream>#include<string>using namespace std;class A{ friend ostream& operator<<(ostream& out, const A & a) { out<<a.str; return out; }public: string str; A(string s):str(s){} A& operator=(const A&); A& operator+=(const 阅读全文
posted @ 2012-06-17 21:25 cs_jin_scor 阅读(945) 评论(4) 推荐(0) 编辑
  2012年6月6日
摘要: 1、mount -o nolock 1921.168.1.114:/home /home2、运行程序带命令-qws -nomouse -display openvg(表示不需要服务器,不需要鼠标,使用openvg图形引擎显示)3、关于framebuffer的基本概念:这个设备来供用户态进程实现直接写屏,其中fb0主要的是UI操作的一块,我们贴的图就在这一层上4、使用Qt编了一个小程序,初步了解Qt下的开发流程5、对于signal slot有了基础的认识 两者通过connect方法联系在一起 使用emit 发送一个signal 便可以在对应的slot上处理PS:细心点啊,很多小错误会导致你花很长 阅读全文
posted @ 2012-06-06 00:07 cs_jin_scor 阅读(281) 评论(0) 推荐(0) 编辑
  2012年6月5日
摘要: 实习日记 阅读全文
posted @ 2012-06-05 00:12 cs_jin_scor 阅读(192) 评论(0) 推荐(0) 编辑
  2012年6月1日
摘要: void reserve(linkNode<char> *head) //头插入的逆置方法{linkNode<char> *q;q=head->next;if(head->next==NULL||head->next->next==NULL)return;elsewhile(q!=NULL&&q->next!=NULL){linkNode<char> *temp;temp=q->next;q->next=temp->next;temp->next=head->next;head-&g 阅读全文
posted @ 2012-06-01 01:19 cs_jin_scor 阅读(1041) 评论(0) 推荐(0) 编辑
  2012年5月29日
摘要: #include<iostream>#include<vector>using namespace std;void out(int,int);void main(){out(5,8);}void out(int a,int b){static vector<int> result;if(a<=0||b<=0)return;if(b>=a){result.push_back(a);int end=b-a;int begin=a-1;if(end>0){out(begin,end);}if(end==0){for(vector<i 阅读全文
posted @ 2012-05-29 23:27 cs_jin_scor 阅读(191) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;bool ifpossible(int*,int*,int);void main(){int lhs[]={1,2,3,4,5};int rhs[]={4,3,2,1,5};cout<<ifpossible(lhs,rhs,5)<<endl;}bool ifpossible(int *in,int *out,int len){int num=0;int *stack=new int[len];int *end=in+len;for(int i=0;i<len;i++){if(n 阅读全文
posted @ 2012-05-29 00:44 cs_jin_scor 阅读(648) 评论(0) 推荐(1) 编辑
  2012年5月28日
摘要: #include<iostream>using namespace std;void main(){//Part1char *a=new char[7];a[0]='x';a[1]='i';a[2]='e';a[3]='x';a[4]='i';a[5]='e';a[6]='\0';*a='h';cout<<a<<endl;//Part2char *b="xiexie";*b='h';cout< 阅读全文
posted @ 2012-05-28 09:58 cs_jin_scor 阅读(194) 评论(0) 推荐(1) 编辑