· UseSingleton: If you have a class that has nothing but static methods, consider making it a Singleton. Note that this doesn't apply to abstract classes, since their subclasses may well include non-static methods.
Also, if you want this class to be a Singleton, remember to add a private constructor to prevent instantiation.
翻译 使用单例:如果有一个类包含的只有静态方法,可以考虑做成单例的。注意这个规则不适用于抽象类,因为它们的子类可能包含非静态方法。还有,如果你想把一个类做成单例的,......
阅读全文
在fedora10下,运行gedit,普通用户下不会出错,但在su到root下会出现如下错误,(gedit:12541): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported
GConf 错误:联系配置服务器失败;某些可能原因是需要为 ORBit 启用 TCP/IP 联网,或者由于系统崩溃,您的 NFS 锁定已失效。请访问 http://www.gnome.org/projects/gconf/ 了解详细信息。(详细信息 - 1: 获取到会话的连接失败:Did not receive a reply. Possible causes include: the remote appl......
阅读全文
文章目录
Machine definitions
Macro definitions
What can go wrong
Debugging
[root@localhost ~]# cat .netrc
machine hostname
login root
password rootpassword
macdef init
cd /root/
bin
put a.txt
quit
机器 hostname
username 用户名
password 密码
宏脚本 macdef
init自动执行
引用: http://www.mavetju.org/unix/netrc.php
How to use ftp in combination with .netrc
After answering a ......
阅读全文