现在的智能手机不敢说百分百的都是触摸屏,也应该是百分之九九以上为触摸屏了,触摸屏为我们操作无键盘、无鼠标的手机系统带来了很多的便利。当用户触摸屏幕时会产生很多的触摸事件,down、up、move等等。View类有个View.OnTouchListener内部接口,通过重写他的onTouch(View v, MotionEvent event)方法,我们可以处理一些touch事件,如下:public...
分类:
移动开发 时间:
2015-11-24 13:00:23
阅读次数:
282
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization在虚拟机VM下安装的CentOS遇到这个问题,我是将centos.vmx放到其他的VM下打开#dhclient#se...
分类:
其他好文 时间:
2015-11-24 01:04:02
阅读次数:
178
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu...
分类:
其他好文 时间:
2015-11-23 23:27:32
阅读次数:
203
示例:查看系统负载的脚本#!/bin/shwhile truedo uptime >/tmp/uptime.log sleep 1done[root@lamp scripts]# tail -f /tmp/uptime.log 21:37:26 up 5:49, 2 users, loa...
分类:
其他好文 时间:
2015-11-23 23:11:05
阅读次数:
168
Linux下如何查看系统启动时间和运行时间1.uptime命令输出:16:11:40 up 59 days, 4:21, 2 users, load average: 0.00, 0.01, 0.002.查看/proc/uptime文件计算系统启动时间cat /proc/uptime输出: 5113...
分类:
系统相关 时间:
2015-11-23 21:47:45
阅读次数:
232
// 方式一:double f = 3.1516;BigDecimal b = new BigDecimal(f);double f1 = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); // 方式二:new java.text.Deci...
分类:
编程语言 时间:
2015-11-23 16:24:51
阅读次数:
163
题意:一部电梯(共top层),每一楼有一个数字k,在该层只能上k层或者下k层(up和down按钮),问从当前层到目标层按按钮的最小次数。分析:广度优先搜索。总结:初写BFS,仿照别人的代码,这方面要继续加强。代码:#include#include#include#include#includeusi...
分类:
其他好文 时间:
2015-11-23 13:25:04
阅读次数:
192
导入一个Maven项目之后发现有一个如下的错误:Project configuration is not up-to-date with pom.xml. Run project configuration update其实这个问题解决非常简单:在项目上右键——【Maven】——【Update Pr...
分类:
其他好文 时间:
2015-11-22 12:37:39
阅读次数:
199
1、关于执行JavaScript代码的方法:第一种方法是将JavaScript代码放到文档标签中的第二种方法是讲JavaScript代码存为一个扩展名为.js的独立文件,引入方法如下: index mark-up goes here..最好的做法是把2、关于语句:JavaScript语句是构成一.....
分类:
编程语言 时间:
2015-11-22 01:30:11
阅读次数:
216
#import ex25 1 def break_words(stuff): 2 """This function will break up words for us.""" 3 words = stuff.split(' ') 4 return words 5 ...
分类:
编程语言 时间:
2015-11-21 14:25:16
阅读次数:
238