ClassLoader.readResourceAsStream 是从 classpath 中读取,也就是说目标资料必须在某个 classpath 节点路径中,比如在某个磁盘文件夹 bin 中或某个 jar 文件里面。放在 src 里面的话,eclipse 会自动在编译时默认地复制到 bin 目录下...
分类:
其他好文 时间:
2014-07-06 22:50:05
阅读次数:
311
1:源代码#!/usr/bin/env pythonname = raw_input('请输入您的姓名:')print 'Hello,', name运行时出错:y@y:~/my_note/my_python$ python 5.py File "5.py", line 3SyntaxError:.....
分类:
编程语言 时间:
2014-07-06 21:57:42
阅读次数:
236
Java在运行已编译完成的类时,是通过java虚拟机来装载和执行的,java虚拟机通过操作系统命令JAVA_HOME"bin"java –option 来启动,-option为虚拟机参数,JAVA_HOME为JDK安装路径,通过这些参数可对虚拟机的运行状态进行调整,掌握参数的含义可对虚拟机的运行模式...
分类:
编程语言 时间:
2014-07-06 21:05:04
阅读次数:
184
后来我发现在eclipse的Preferences -> Android -> Build中有一项“Skip packaging and dexing until export or launch....”,原来这个选项默认是被勾选的,这个选项的意思是“跳过packing和dexing,直到expo...
分类:
移动开发 时间:
2014-07-06 19:43:57
阅读次数:
203
apache本身自带了一个测试工具ab,在apache的安装目录bin目录下ab的使用方法:Usage: ab [options] [http[s]://]hostname[:port]/path-n 测试会话中所执行的请求个数,默认时,仅执行一个请求-c 一次产生的请求个数。默认是一次一个-t 测...
分类:
其他好文 时间:
2014-07-06 19:33:13
阅读次数:
206
Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have the fol...
分类:
其他好文 时间:
2014-07-06 19:31:04
阅读次数:
181
expect自动远程拷贝脚本,利用rsync命令,脚本内容如下:#!/usr/bin/expect --proc Usage_Exit {self} { puts "" puts "Usage: $self ip user passwd port sourcefile d...
分类:
其他好文 时间:
2014-07-06 16:24:17
阅读次数:
333
#!/usr/bin/envpython
#-*-coding:utf8-*-
importsmtplib
fromemail.mime.textimportMIMEText
textfile=‘sendmail.html‘
withopen(textfile,‘rb‘)asf:
msg=MIMEText(fp.read(),‘html‘,‘utf8‘)
msg.set_charset(‘utf8‘)
me=‘xxx@163.com‘
you=‘xxxx@qq.com‘
msg[‘Subject‘]=..
分类:
编程语言 时间:
2014-07-04 06:41:33
阅读次数:
325
由于cocos2d-x的更新,最新版本的创建工程方法又发生了变化,以下是cocos2d-x3.1.1在命令行下创建工程的方法。首先下载cocos2d-x3.1.1,python2.7.(x)(最好是2.7的版本)。将pyton安装目录和\cocos2d-x-3.1.1\tools\cocos2d-console\bin配置到环境变量,不会的同学可以自己..
分类:
其他好文 时间:
2014-07-04 06:32:24
阅读次数:
233
#!/bin/bashwhiletruedo badip=$(lastb-i-a|awk‘/ssh:notty/{print$NF}‘|sort|uniq-c|awk‘($1>3){print$2}‘) foriin$badip do iptables-tfilter-IINPUT-s$i-ptcp--dport22-jDROP done :>/var/log/btmp sleep10sdone
分类:
移动开发 时间:
2014-07-04 06:22:09
阅读次数:
364