键盘事件keycode表示一个对应的值(按下A键)getAction表示一个对应的动作(按下)@OverridepublicbooleanonKey(Viewv,intkeyCode,KeyEventevent){if(keyCode==KeyEvent.KEYCODE_BACK){Toast.makeText(getApplicationContext(),"返回",1000).show();}//switch(event.getAction(..
分类:
其他好文 时间:
2014-12-03 01:53:15
阅读次数:
116
从《C++标准库》里面看到的一些技巧,以及自己遇到的一些技巧,备忘。从流中读取数据存入容器 1 copy(istream_iterator(cin), istream_iterator(), back_inserter(vInput));//从cin中读取string 类型的数据存入 vI...
分类:
编程语言 时间:
2014-12-03 01:43:41
阅读次数:
193
#!/bin/bashmysql_host="127.0.0.1"mysql_user="root"mysql_passwd="********"back_dir="/www/backup/database/"ignore_db="information_schema|mysql|performan...
分类:
数据库 时间:
2014-12-03 00:09:08
阅读次数:
356
Lua回调函数实例
local m = {}
local list = {name="hello",age=12}
m.call_back_fun_print = function(printID)
print(printID .. "-->" .. list[printID])
end
m.add_list = function(key,value,call_back_fun)...
分类:
其他好文 时间:
2014-12-02 17:16:40
阅读次数:
182
我们有时期望背景图片自动拉伸占据所有空间,使用CSS 3做起来并不麻烦,定义如下的CSS: body { ?? ?background:#3d71b8 url(../back_main.png); ?? ?background-size: 100%; ?? ?background-position:c...
分类:
其他好文 时间:
2014-12-02 12:10:35
阅读次数:
140
#include using namespace std;void main(void){vector array;array.push_back(1);array.push_back(2);array.push_back(3);array.push_back(4);array.push_back(...
分类:
编程语言 时间:
2014-12-01 12:45:12
阅读次数:
270
在有cache的单机系统中,通常有两种写策略:write through和write back。这两种写策略都是针对写命中(write hit)情况而言的:write through是既写cache也写main memory;write back是只写cache,并使用...
分类:
其他好文 时间:
2014-11-28 20:15:21
阅读次数:
375
The easy way to clamp a signal to a given value is to use two zener diodes, connected back-to-back. This method has several disadvantages. The accurac...
分类:
其他好文 时间:
2014-11-28 15:45:51
阅读次数:
158
例如获取body的背景:Jquery代码如下: var back = $('body').css('backgroundImage'); back.substring(start,end); //截取字符串 start 从第几个字符开始截取...
分类:
Web程序 时间:
2014-11-28 09:55:35
阅读次数:
624
C++中的vector是一个非常灵活的数组,它可以自动扩充大小来容纳新的元素,也可以快速地索引存储的元素,然而,这种使用上的便捷也是有代价的,因为vector的底层数据结构确实是一个数组,只是封装了一些便利的操作,像push_back()、reserve()等,下面我们就通过例子来看一下这些简便操作背后的行为...
分类:
编程语言 时间:
2014-11-27 18:33:51
阅读次数:
207