local function onTouchBegan(x, y) 层单击事件end local function onTouchMoved(x, y) end local function onTouchEnded(x, y) print("哈哈哈") endlocal function...
分类:
其他好文 时间:
2014-06-18 22:00:39
阅读次数:
235
@Test public void test() throws Exception{ //创建输入数据流对象 InputStream In=new FileInputStream("HellWord.txt"); try { //System.out.print((ch...
分类:
编程语言 时间:
2014-06-18 21:39:04
阅读次数:
226
比较中文是否相等:if str1.decode("GB2312").encode("utf-8") ==str2.decode("GB2312").encode("utf-8"): print "=="注: decode中时str1 str2使用的中文编码方式, encode统一用utf-8形式比....
分类:
编程语言 时间:
2014-06-18 19:26:41
阅读次数:
384
sprintf(vFilter->szOverLay,"movie=%s[wm];[in][wm]overlay=%d:%d[out]",szOverlay,x,y);当szOverlay = “d:\\xxx\xxx.png”; 时返回-2,貌似ffmpeg处理不了路径中的冒号。。。用当前路径下的...
分类:
其他好文 时间:
2014-06-18 19:04:31
阅读次数:
1066
如果在某个函数中包含了yield, 这意味着这个函数已经是一个Generator, 它的执行 会和其他普通的函数有很多不同。比如: def h(): print 'To be brave' yield 5 h()可以看到,调用h()之后,print语句并没有执行, 这就是yi...
分类:
编程语言 时间:
2014-06-18 16:40:47
阅读次数:
235
说明:awk被设计用于数据流,能够对列和行进行操作。而sed更多的是匹配,进行替换和删除。awk有很多内建的功能,比如数组,函数等。灵活性是awk的最大优势。awk的结构awk 'BEGIN{ print "start"}pattern { commands }END{ print "end"}'f...
分类:
其他好文 时间:
2014-06-17 21:20:05
阅读次数:
202
#导入的头from twisted.python import logfrom twisted.python.logfile import *#开始记录,输入日志名和存放的路径,setStdout为0不记录stdout的内容,默认setStdout=1,记录print的输出log.startLog....
分类:
编程语言 时间:
2014-06-17 21:09:45
阅读次数:
332
public static void main(String[] args) {System.out.print("红色的号码为:");Set set=new HashSet();while (true) {int i=(int)(Math.random()*33+1);set.add(i);if ...
分类:
编程语言 时间:
2014-06-17 13:35:14
阅读次数:
748
经常需要根据IP地址统计apache站点访问量,最基本的脚本.根据IP访问量降序排列:#!/bin/bash
#Script_name:access_count
acc_log=/usr/local/apache2/logs/access_log
/bin/awk‘{print$1}‘$acc_log|sort|uniq-c|sort-nr执行效果:[root@zabbix~]#shaccess_count
94989192.168.1..
分类:
移动开发 时间:
2014-06-16 18:18:50
阅读次数:
332
find命令–用途:用于查找文件或目录–格式:find[查找范围][查找条件]常用查找条件–-name:按文件名称查找–-size:按文件大小查找–-user:按文件属主查找–-type:按文件类型查找–-print:以\n为换行符打印出文件(路径)高级查找条件–-perm:按权限查找–-ctime(-cmin?.
分类:
系统相关 时间:
2014-06-16 15:04:40
阅读次数:
260