上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 21 下一页
摘要: 美女住酒店一晚结账时账单800元,她抱怨太贵。经理说这是标准收费,酒店附设泳池、健身房和wifi。美女说自己完全没使用,经理说饭店有提供,是她自己不用。 女客人打开皮包掏钱付账,但说要扣除经理和她共度春宵的700元,只拿出100元。经理急呼:“我哪有?”女客人:“我有提供,是你自己不用!”【习惯】乞丐到小王家乞讨,他给十块,第二天乞丐又去,又给十块,持续两年。一天只给五块,乞丐:以前给十块,怎么现在给五块?小王:我结婚了。乞丐一巴掌打过去:妈的,你竟拿我的钱去养你老婆?启示:当提供免费服务让客户成为一种习惯,这种服务就不再是优势,而是劣势。【夫妻】夫妇逛商场,女的看中一套高档餐具,坚持要买,丈 阅读全文
posted @ 2013-11-16 20:43 dorothychai 阅读(308) 评论(0) 推荐(0) 编辑
摘要: Student(S#,Sname,Sage,Ssex) 学生表Course(C#,Cname,T#) 课程表SC(S#,C#,score) 成绩表Teacher(T#,Tname) 教师表 问题:1、查询“001”课程比“002”课程成绩高的所有学生的学号;select a.S#from (select s#,score from SC where C#=’001′) a,(select s#,s... 阅读全文
posted @ 2013-11-14 22:46 dorothychai 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 模板模式(template)在面向对象系统的设计和开发过程中,一定会有这样的情况:对于一些功能,在不同的对象身上展示不同的作用,但是功能的框架是一样的,这就是模板(template)模式的用武之地,我说的不知道你有没有理解,一会代码展示的时候,你就会一目了然,代码很简单。在template模式中,采用的是继承的方式实现上述的内容。template模式的结构图:对于template模式的实现就是运用... 阅读全文
posted @ 2013-11-13 01:05 dorothychai 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 作用:定义了算法家族,分别封装起来,让他们之间可以互相替换,此模式让算法的变化,不会影响到使用算法的客户。 UML图: Strategy模式将逻辑(算法)封装到一个类(Context)里面,通过组合的方式将具体算法的实现在组合对象中实现,再通过委托的方式将抽象接口的实现委托给组合对象实现将算法的逻辑抽象接口(DoAction)封装到一个类中(Context),再通过委托的方式将具体的算法实现委托给... 阅读全文
posted @ 2013-11-13 01:04 dorothychai 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Builder模式要解决的问题是,当我们要创建很复杂的对象时,有时候需要将复杂对象的创建过程和这个对象的表示分离开来。由于在每一步的构造过程中可以映入不同参数,所以步骤相同但是最后的对象却不一样。也就是说将产品的内部表象和产品的生成过程分割开来,从而使一个建造过程生成具有不同的内部表象的产品对象。 Builder模式的关键在于在创建一个复杂对象时,其组合过程往往涉及复杂的处理,同时,这... 阅读全文
posted @ 2013-11-13 00:47 dorothychai 阅读(408) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 class A 4 { 5 public: 6 void sayHi(){ 7 coutsayHi(); 14 p = NULL; 15 p->sayHi(); 16 } 以上输出:(因为A::sayHi()并未使用this指针。因此尽管this指针是NULL,只要不... 阅读全文
posted @ 2013-11-07 12:38 dorothychai 阅读(341) 评论(0) 推荐(0) 编辑
摘要: 1 /*堆排序(大顶堆) 2011.9.14*/ 2 3 #include 4 #include 5 using namespace std; 6 7 void HeapAdjust(int *a,int i,int size) //调整堆 8 { 9 int lchild=2*i; //i的左孩子节点序号 10 int rchild... 阅读全文
posted @ 2013-09-27 13:18 dorothychai 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 1 // 主程序 (.cpp文件) 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include "BobbleSort.h" 8 #include "QuickSort.h" 9 #include "HeapSort.h" 10 11 int main() 12 { ... 阅读全文
posted @ 2013-09-27 12:58 dorothychai 阅读(495) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 4 struct IA 5 { 6 virtual void funInIA() = 0; 7 }; 8 9 struct IB 10 { 11 virtual void funInIB() = 0; 12 }; 13 14 struct C : public IA, publi... 阅读全文
posted @ 2013-09-26 14:47 dorothychai 阅读(220) 评论(0) 推荐(0) 编辑
摘要: http://blog.jobbole.com/46797/#jtss-tsina 一、广泛了解,从科普书籍开始 选择计算机专业的同学,也许是因为原先有一定的基础,也许是因为一时的激情,但更多的人,可能对自己的选择没有深刻的认识,或多或少对计算机专 业有一些神秘的感觉。自己究竟是否喜欢这个学科?才华能够在哪个分支领域有所施展?抑或是真的不适合这个专业?诸多疑问,解决的方法首先便是了解和认识我 们... 阅读全文
posted @ 2013-09-17 20:47 dorothychai 阅读(207) 评论(0) 推荐(0) 编辑
摘要: fdisk -l 无法挂载 NTFS格式的分区:mount: unknown filesystem type ‘ntfs’。 问题: # mount –t ntfs /dev/sdb1 /mnt/usb mount: unknown filesystem type ‘ntfs’ 这是由于CentOS release 5.3(Final)上无法识别N... 阅读全文
posted @ 2013-09-14 10:43 dorothychai 阅读(401) 评论(0) 推荐(0) 编辑
摘要: Declaration Following is the declaration for sprintf() function.int sprintf(char *str, const char *format, ...) Example The following example shows the usage of sprintf() function. #include #include ... 阅读全文
posted @ 2013-08-23 23:27 dorothychai 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 1: #include 2: int system(const char *command); 3: 4: while (something) { 5: int ret = system("foo"); 6: if (WIFSIGNALED(ret) && ... 阅读全文
posted @ 2013-08-23 23:19 dorothychai 阅读(329) 评论(0) 推荐(0) 编辑
摘要: Source code: 1: #include 2: void myStartupFun (void) __attribute__ ((constructor)); 3: void myCleanupFun (void) __attribute__ ((destructor)); 4: 5: /... 阅读全文
posted @ 2013-08-23 22:50 dorothychai 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Source file: 1: #define __USE_GNU //import! 2: #include 3: #include 4: void getFuncNameByAddr(void *this_fn, void *call_site) { 5: Dl_info DlInfo... 阅读全文
posted @ 2013-08-23 22:38 dorothychai 阅读(341) 评论(0) 推荐(0) 编辑
摘要: myFun.h 1: #include 2: 3: void __cyg_profile_func_enter(void *this_fn, void *call_site) 4: __attribute__((no_instrument_function)); 5: void _... 阅读全文
posted @ 2013-08-23 22:27 dorothychai 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 1: int save_out = dup(fileno(stdout));//backup stdout 2: int out = open("cout.log", O_RDWR|O_CREAT|O_APPEND, 0600); 3: int nRet; 4: fflush(stdout); 5... 阅读全文
posted @ 2013-08-23 22:19 dorothychai 阅读(413) 评论(0) 推荐(0) 编辑
摘要: 使用rpm –qa vnc命令如果收到如下信息说明已经安装了vncserver, [root@localhost: ~]#rpm -qa |grep vnc gtk-vnc-python-0.3.2-3.el5 vnc-server-4.1.2-14.el5 gtk-vnc-0.3.2-3.el5 vnc-4.1.2-14.el5 服务器安装:sudo yum install vnc-ser... 阅读全文
posted @ 2013-07-29 20:43 dorothychai 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 机关单位公章的大小与机构的级别有关,级别越高的公章越大,一般直径在3.8-4.2cm,很少有用4.5cm或3.4cm的。但企业的公章一般都很大。首先点击文件新建,新建一个500×500像素(像素大小无关紧要,反正用到Word中是要进行调整的,但像素大清晰度会高一点),背景为透明的文件 为了方便下面的操作,可以在制作前就把前景色和文字颜色设置为正红,也可以在用到颜色时再设置。 显示标尺:为了找准中... 阅读全文
posted @ 2013-06-21 19:38 dorothychai 阅读(816) 评论(0) 推荐(0) 编辑
摘要: 用C#做了个线程间同步的小程序,但每次关闭窗口后进程仍然在,是什么原因?解决方法:要加一句线程.IsBackground = true;否则退出的只是窗体上面的方法没看懂。。。MSDN上说法,Abort不是立即释放线程所用的资源。问下,关闭窗口,当不关闭程序吧。如果关闭程序,你就加上Process.GetCurrentProcess().Kill(); 阅读全文
posted @ 2013-06-20 14:21 dorothychai 阅读(274) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 21 下一页