上一页 1 ··· 5 6 7 8 9 10 11 12 13 14 下一页
摘要: 为了驳回编译器自动提供的功能, 可将相应的成员函数声明为private并不予实现。如果在成员函数或friend函数调用这些, 连接时会报错。将连接错误移至编译期是可能的,设置一个专门为了防止copying动作的base classs:class Uncopyable{protected: //允许derived对象构造和析构 Uncopyable(){} ~Uncopyable(){}private: //阻止copying Uncopyble(const Uncopyable&); Uncopyable& operator=(const Uncopyable&);}; 阅读全文
posted @ 2012-01-07 23:09 lidan 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 编译给会为一个空类声明一个default构造函数、一个copy构造函数、一个copy assignment操作符、和一个析构函数。所有这些都是public且inline: class Empty{}; 就像是写了这样的代码: class Empty{ Empty(){…} Empty(const Empty& rhs) {…} ~E... 阅读全文
posted @ 2012-01-07 15:36 lidan 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 对象的成员变量的初始化动作发生在进入构造函数本体之前。ABEntry::ABEntry(const std::string& name, const std::list<PhoneNumber>& phones){ theName = name; //这些都是赋值,不是初始化 thePhones = phones; numTimesConsulted = 0;}这个构造函数首先调用default构造函数为theName, thePhones设初值,然后立刻对他们赋予新值ABEntry::ABEntry(const std::string& name, con 阅读全文
posted @ 2012-01-07 10:16 lidan 阅读(536) 评论(0) 推荐(0) 编辑
摘要: const 修饰指针:如果关键字const出现在星号*左边,表示被指物是常量,如果const出现在*右边表示指针自身是常量, 如果出现在两边表示被指物和指针都是常量; const std::vector<int>::iterator iter = vec.begin(); //iter的作用就像是T* const; ++iter;错误 std::vector<int>::const_iterator cIter = vec.begin(); //cIter的作用像个const T*; *cIter = 10;错误 const 修饰函数返回值:将operator*的返回值 阅读全文
posted @ 2012-01-05 23:11 lidan 阅读(290) 评论(0) 推荐(0) 编辑
摘要: Ubuntu 11.04已经发布了,想必很多同志已经迫不及待的尝鲜了~对于有2台电脑的同志,一台win7,一台Ubuntu可能是比较实际,比较符合国情的搭配。 于是乎,怎样高效的同时使用两台电脑就成为问题了。有的朋友可能倾向于用Ubuntu做主操作系统,然后远程桌面连上Win7使用,但是对于要使用VS编 程的朋友(比如我),最好的方法就是使用Win7做主系统,然后远程桌面连上Ubuntu~好了,废话不多说,昨晚装好Ubuntu之后,在网上搜了一圈远程桌面的方法,不敢独享,在此小小整理一下,不是本人原创……具体方法:Ubuntu下的操作1、首先你要有Ubuntu11.04,其实10.04也可以使 阅读全文
posted @ 2012-01-04 19:10 lidan 阅读(676) 评论(0) 推荐(0) 编辑
摘要: 错误是 xxxx的 pre-remove 脚本引发的,导致不能正常卸载 这个包, 一个简单的解决办法: /var/lib/dpkg/info 中找到 xxxx.prerm 修改它 把里面的脚本都清了。让他没有机会报错... 然后删除这个受损的包,可以利用 apt-get remove --purge xxxx 这样可以直接删除这个包。 删除 /var/lib/... 阅读全文
posted @ 2011-11-20 14:42 lidan 阅读(2872) 评论(0) 推荐(0) 编辑
摘要: 6.4.1. Dumping Data in SQL Format with mysqldumpThis section describes how to use mysqldump to create SQL-format dump files. For information about reloading such dump files, see Section 6.4.2, “Reloading SQL-Format Backups”.By default, mysqldumpwrites information as SQL statements to the standard ou 阅读全文
posted @ 2011-11-20 11:32 lidan 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 比较弱智的方法: 关闭虚拟机后,打开主界面里的 编辑——编辑网络参数,在最左下角有一个“恢复默认”,点击后让其重新分配子网IP地址,完毕后重新打开安装的XP或Linux就行了 阅读全文
posted @ 2011-11-19 20:23 lidan 阅读(4008) 评论(0) 推荐(0) 编辑
摘要: 安装:apt-get install -y mysql-server apache2 libapache2-mod-python python-mysqldb python-django下面这些暂时没装xfsprogs python-imaging subversion php5 phpmyadmin也可以源码安装:setuptools-0.6c11.tar.gz./setup.py install 安装setuptools后再安装MySQL-python,Django-1.3.1python setup.py installMySQL-python-1.2.3.tar.gzDjango-1. 阅读全文
posted @ 2011-11-19 20:14 lidan 阅读(495) 评论(0) 推荐(0) 编辑
摘要: 在读mod_python的安装文档时候遇到点问题,现在解决了,和大家分享下。 我的系统是ubuntu的9.04版本,用apt-get安装apache和mod_python的 这里是我参考的mod_python的中文文档 在2.3.2 配置 Apache小节中,因为apt-get安装的,在/etc/apache2/mods-available/python.load文件,里... 阅读全文
posted @ 2011-11-15 14:33 lidan 阅读(396) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 14 下一页