2011年8月16日

摘要: 1:语法 a:每一行语句必须以分号(;)结束 b:[declare declare_var] begin execute_statement [exception exception_handle_statements ] 2:变量和类型和赋值 定义变量: var type; var_1 table.filed%type; 第一种和第二种的区别在于:第二种var_1的类型,和数据库中表的类型一样。... 阅读全文
posted @ 2011-08-16 17:10 51Liuda 阅读(203) 评论(0) 推荐(0) 编辑

2011年7月22日

摘要: ssh密码登录ssh-keygen -t rsacat ~/.ssh/id_rsa.pub | ssh lintj@10.10.6.183 "cat - >> ~/.ssh/authorized_keys" 阅读全文
posted @ 2011-07-22 07:29 51Liuda 阅读(222) 评论(0) 推荐(0) 编辑

2011年7月19日

摘要: 最近想实现一个基于reactor模式的网络库 1:不支持多线程。 2:不跨平台,只支持linux 3: 两种方式I/O复用方式:select和epoll 4: 不搞阻塞模式。 =================================== 第一次写这种库,敬请期待。 阅读全文
posted @ 2011-07-19 21:05 51Liuda 阅读(224) 评论(0) 推荐(0) 编辑

2011年7月4日

摘要: #include <stdio.h>#include <sys/types.h>#include <sys/socket.h>#include <sys/ioctl.h>#include <netinet/in.h>#include <net/if.h>#include <net/if_arp.h>#include <arpa/inet.h>#include <errno.h>#include<string.h>#define ETH_NAME "eth1" 阅读全文
posted @ 2011-07-04 14:05 51Liuda 阅读(385) 评论(0) 推荐(1) 编辑
摘要: 噢,还有正则的。 阅读全文
posted @ 2011-07-04 09:26 51Liuda 阅读(252) 评论(0) 推荐(0) 编辑
摘要: strcpy strncpymemcpy#include <string.h>char *strncpy(char *restrict s1, const char *restrict s2, size_t n);DESCRIPTION The strncpy() function shall copy not more than n bytes (bytes that follow a null byte are not copied) from the array pointed to by s2 to the array pointed to by s1. If copyin 阅读全文
posted @ 2011-07-04 09:18 51Liuda 阅读(429) 评论(0) 推荐(0) 编辑

2011年7月3日

摘要: 前几天一同学说去**面试,被问到现场写一个string类出来。要写出这个类,主要知道几个默认构造函数,这个也是面试中常考的。第一:拷贝构造函数。string(const string &lhs);第二:赋值构造函数。string & operator=(const string &lhs)//这里就有2个问题第一:赋值构造函数为什么是返回string &//这里是一个引用。第二,operator=(const string &lhs)这里为啥只有一个参数。对于第一个问题。我们知道,=(赋值)操作符,在c++语言在的意义是 a=b。就是b赋值给a。所以,当 阅读全文
posted @ 2011-07-03 14:28 51Liuda 阅读(307) 评论(0) 推荐(0) 编辑
摘要: 很早就听过对象池(object pool)这种技术。今天在C++ primer的第641页看到也介绍了这种技术。基本思路是:将用过的对象保存起来,等下一次需要这种对象的时候,再拿出来重复使用,从而在一定程度上减少频繁创建对象所造成的开销。并非所有对象都适合拿来池化――因为维护对象池也要造成一定开销。对生成时开销不大的对象进行池化,反而可能会出现“维护对象池的开销”大于“生成新对象的开销”,从而使性能降低的情况。但是对于生成时开销可观的对象,池化技术就是提高性能的有效策略了。 阅读全文
posted @ 2011-07-03 13:50 51Liuda 阅读(174) 评论(0) 推荐(0) 编辑

2011年5月22日

摘要: 期待~~~ 阅读全文
posted @ 2011-05-22 13:11 51Liuda 阅读(111) 评论(0) 推荐(0) 编辑

2011年5月19日

摘要: #include<iostream>#include<algorithm>#include<vector>#include<string>#include <functional>using namespace std;class Student{ int m_iChinese; int m_iMath; std::string m_strName; public: Student(const string& strName,const int iChinese,int iMath) :m_iChinese(iChinese) 阅读全文
posted @ 2011-05-19 14:53 51Liuda 阅读(244) 评论(0) 推荐(0) 编辑

导航