2014年3月18日

摘要: AllDup的Portable版:AllDupPortable.zip,今天用它查找重复的电子书,效果良好。基本使用方法是:在"Source Folder"里选择要查找重复文件的文件夹,例如e:\mydoc\books,然后在"Search Criteria"里设置好判定为相同文件的条件,一般选择文件名和大小相同,然后点"Start Search"按钮就开始查找了。此类软件介绍见http://ww... 阅读全文
posted @ 2014-03-18 08:16 leechau 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 首先是用python自己的api: shutil.copytree('./build/tested/doc', './build/tested/build/doc')优点是改变平台时不需要修改代码,缺点是doc文件夹下所有的东西都会被拷贝,包括隐藏目录; 其次是使用windows的api: result = subprocess.call(['xcopy', '.\build\tested\doc... 阅读全文
posted @ 2014-03-18 08:16 leechau 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 方法1:安装Ubuntu Server版,好处是默认不安装GUI,且可以自动安装ssh服务和其他很多服务,且消耗系统资源少(约200MB内存,Desktop版启动后需要500MB左右内存),启动和关闭速度快(关机:shutdown -P now);方法2:安装Ubuntu Desktop版,出现用户登录界面时按Ctrl+Alt+F1键进入命令行界面,F1~F6对应tty1~tty6,按Alt+F1... 阅读全文
posted @ 2014-03-18 08:16 leechau 阅读(884) 评论(0) 推荐(0) 编辑
摘要: The following scripts run in ipython demonstrate the differences between instance method and static method.Generally OOP make things complicated for imperative style applications.So when developing th... 阅读全文
posted @ 2014-03-18 08:16 leechau 阅读(261) 评论(0) 推荐(0) 编辑
摘要: VirtualBox version: VirtualBox-4.2.18-88780-Linux_x86.runHost OS: Linux Mint 14 XfceSetup NetworkAdd a virtual network in host: VirtualBox -> File -> Preferences -> NetworkCreate a VM with the first N... 阅读全文
posted @ 2014-03-18 08:16 leechau 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 以下是paramiko-1.7.7.1的安装过程,可以看到整个过程分为步,第一步是build,就是拷贝源文件到build文件夹里,F:\VMFiles\tmpFiles\paramiko-1.7.7.1>F:\Software\Python27\python.exe setup.py install running install running build running build_py cr... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(352) 评论(0) 推荐(0) 编辑
摘要: Check the current sshd status:service sshd statusStart sshd service:service sshd startSet sshd autostart on system startupchkconfig sshd onList the current autostart statuschkconfig --list |grep sshdO... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 下面的程序演示了一个对象被两个线程访问的方法,"monitor.gotMessage();"这一句虽然是monitor对象的方法,但却是运行在"MyObject"的线程里,而不是"monitor"线程里。 BusyWaiting.java:public class BusyWaiting { public static void main(String[] args) { Monitor... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 我们需要将文字保存在磁盘上,但磁盘上只能存储0和1(实际上是存储介质的两种状态),不能存储文字,这就出现了一个问题,如何将文字转换为二进制数字串?文件的编码/解码就是解决文字二进制串这一环节如何相互转换的问题。简单地说,GBK和Unicode分别是一种码表,也就是为每一个字符指定一个两个字节组成的代码,例如 “汉”字的Unicode编码为0x6C49,GBK编码为0xBABA(0x是一个字头,表示... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(186) 评论(0) 推荐(0) 编辑
摘要: http://stackoverflow.com/questions/2014636/how-to-maintain-an-emacs-based-knowledge-base 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 使用shell时经常要知道当前路径,如果将它写在提示符里很节省很多敲pwd的动作,方法是在启动文件(.bash_profile, .bashrc)里加上:export PS1="[\u@\h \w]\$ "效果如下:[godu@NOP2-HWXX /opt/godu/terracotta-2.7.2]$ pwd /opt/godu/terracotta-2.7.2如果想持久化此效果,在~/.bas... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 例如有一段文本,将所有CTRL替换为ctrl,将所有A替换为a,也就是执行了:%s/CTRL/ctrl/g和:%s/A/a/g两条命令,然后进行了很多其他编辑,最后关闭VIM。 后来又有一段文本,也需要将所有CTRL替换为ctrl,将所有A替换为a,这时候不需要重新敲上面两个命令,只需要输入:%s,然后按向上键,:%s/CTRL/ctrl/g就自己跑出来了。 如果不确定以前用过这个命令没有,可... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(616) 评论(0) 推荐(0) 编辑
摘要: 安装词典:选项->词典,出现“词典管理”窗体,点“安装”,从磁盘上选择要安装的词典文件(扩展名为ld2的文件),勾选“添加到索引组”和“取词组”;安装语音库: 第一步:解压语音库。找到Lingoes安装目录下的speech文件夹(例如c:\Program Files\Lingoes\Translator2\speech),根据语音库的名字新建一个文件夹(例如LongmanModern),然后将语音... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(1163) 评论(0) 推荐(0) 编辑
摘要: All these 3 time can be viewed by "stat " command.Access time is influenced by read operation, such as command cat, more, less, head, tail, grep, sed, etc. This time is queried by "find . -atime -1", ... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(708) 评论(0) 推荐(0) 编辑
摘要: 对于ant里拷贝用的标签的用法,此文(来自 http://electiger.blog.51cto.com/112940/39575 )讲得很好,注意其中黑体字部分,今天被这个问题耽误了20分钟。Ant真是太方便了,以前都没注意到它。功能很强大,能创建数据库,配置服务器,部署发布应用……只需要写好build.xml文件,剩下的就交给ant来“安装”你的WEB应用了。Appfuse的第一个ant命令... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(730) 评论(1) 推荐(0) 编辑
摘要: http://www.terracotta.org/confluence/display/docs27/Admin+Console+Guide#AdminConsoleGuide-Roots 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 例如有如下代码:int var_a = 0; int var_b = var_a + 2;当光标在var_a变量上时,Eclipse会将代码进行如下标记: int var_a = 0; int var_b = var_a + 2; 这一特性在编写和分析代码时很有用,当这一功能关闭时,用如下方法打开此功能: Eclipse菜单->Window->Preferences->Java->Editor... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(354) 评论(0) 推荐(0) 编辑
摘要: Mina的TextLineCodecFactory将字符串编码为字节流,将字节流解码为字符串,下面是使用中遇到的两个问题。 TextLineCodecFactory改变了message的类型 acceptor上挂了textCodec后handler的messageReceived方法中的session是String型(用"message.getClass().getName()"查看), [INF... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(1696) 评论(0) 推荐(0) 编辑
摘要: 安装平台:Windows Server 2003 R2 Enterprise x64 Edition软件:EasyPHP-5.3.6.1mantisbt-1.2.6 安装过程:首先安装EasyPHP,一路next即可,安装到默认位置即可,路径中可以有空格;将 mantisbt-1.2.6解压到 EasyPHP的www目录下,具体过程可参考 EasyPHP 3 + Mantis 1.2 快速搭建安装... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Python做图形用户界面(GUI)开发时经常要在界面上显示中文,需要做如下处理(详见[1]和[2]2.3节):在py文件的首行写上:# -- coding:utf-8 --保存py文件时要存为utf-8格式文件。[1] Python2.6 Documentation: The Python Language Reference: 2.1.4 Encoding declarations[2] 孙广... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(206) 评论(0) 推荐(0) 编辑

导航