上一页 1 2 3 4 5 6 7 8 ··· 17 下一页

2014年3月18日

摘要: 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 阅读(221) 评论(0) 推荐(0)
摘要: Java的字符串处理方法trim是如何改变字符串的?下面是一个例子:@Testpublic void testTrim() { String test = "origin"; String ori = "origin\r\n"; assertFalse(ori.equals(test)); String trimmed = ori.trim(); assertTrue(trim... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(192) 评论(0) 推荐(0)
摘要: 安装过程 命令行安装 下载和安装JDK5、Eclipse3.5、Ant 1.8、Ivy 2.2; 安装JDK:成功标志:在命令行下运行java命令,得到java命令行帮助; 安装Ant:解压Ant,在系统环境变量中设置JAVA_HOME(例如c:\Program Files\Java\jdk1.5.0_22)、ANT_HOME,将${ANT_HOME}/bin加入到path中;成功标志:在命令行... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(428) 评论(0) 推荐(0)
摘要: 下面的两个pattern(p1和p2)分别代表了(A or B) and (C or D)和(A and B) or (C and D)的跨行匹配结果,当然还可以用正则表达式构建更复杂的pattern,但这个实例证明了Groovy具备跨行匹配复杂逻辑表达式的能力。 值得注意的是,多行匹配文本时需要在匹配字符串前加“(?ms)”。 该实例同时演示了Groovy闭包的使用方法。 源代码 msg1 =... 阅读全文
posted @ 2014-03-18 08:15 leechau 阅读(1828) 评论(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 阅读(266) 评论(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 阅读(166) 评论(0) 推荐(0)
摘要: Compared aria2c, axel and wget, aria2c is the best. It support multi-thread download (with "-s ") and resume partially downloaded files automatically (you have to use "-c" in wget for this function). ... 阅读全文
posted @ 2014-03-18 08:14 leechau 阅读(211) 评论(0) 推荐(0)
摘要: google: public telnet server listfor example:telnet nethack.alt.orgssh nethack@alt.org 阅读全文
posted @ 2014-03-18 08:14 leechau 阅读(278) 评论(0) 推荐(0)
摘要: 经验总结:首先要把cobertura.jar包含ant的classpath路径中,其次要求它包含在测试用例的classpath中;使用cobertura做代码覆盖率测试中出现的问题:覆盖率始终为0,不论是否有可用的测试用例都如此;解决问题的历程:第一步:在被测工程中增加了一个很简单的方法,在测试工程中增加了一个对前述方法的测试,发现覆盖度仍为0,由此确定是使用cobertura的方法有问题,而不是... 阅读全文
posted @ 2014-03-18 08:14 leechau 阅读(620) 评论(0) 推荐(0)
摘要: The following script auto login to server 49, send 2 commands and exit from the server.Create a automation script named "auto.sh":echo "open 10.0.2.49 -l gcp" sleep 2 echo "gcp" sleep 1 echo "ls" ... 阅读全文
posted @ 2014-03-18 08:14 leechau 阅读(148) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 17 下一页

导航