- 浏览: 36871 次
- 性别:
- 来自: 杭州
最新评论
文章列表
环境
设备:nexus4 ,系统:Android4.4.2,源代码:Android api 19, debug工具: android studio.
目的
分析Android的touch传递机制,为实现各种hack效果(比如继承listview,实现下拉刷新效果)和复杂的交互效果提供理论支撑。
译文地址:http://developer.android.com/design/get-started/creative-vision.html
如若翻译不周,望各位看官见谅。
android设计所关注的3个首要目标,适用于我们的核心app,以及系统的大部分。当你要设计android app的时,请考虑以下3个目标。
1 令人着迷
美丽不仅仅流于外表。android apps 的美丽,应该是表现在多个层次上的圆滑和赏心悦目。页面切换快速,干净利落,布局和排版干脆而有意义。app的图标应当体现内在的艺术性。就像一个制作精良的工作,你的app应该努力把简约,美丽和目的性结合在一起, ...
A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:
1/2 = 0.5
1/3 = 0.(3)
1/4 = 0.25
1/5 = 0.2
1/6 = 0.1(6)
1/7 = 0.(142857)
1/8 = 0.125
1/9 = 0.(1)
1/10 = 0.1
Where 0.1(6) means 0.166666..., and has a 1-digit re ...
MediaRecorder mMediaRecorder;
int ratio = mMediaRecorder.getMaxAmplitude() / BASE;
int db = 0;// 分贝 也可以理解为定义的音量大小
if (ratio > 1)
db = (int) (20 * Math.log10(ratio));//db就是我们需要取得的音量的值。
//(int) (20 * Math.log10(ratio))振幅和音量 ...
package com.yao.Algorithms;
import java.math.BigInteger;
/**
*
* @author shuimuqinghua77 @date 2012-4-26下午02:33:04
*
*/
public class Problem25 {
public static void main(String[] args) {
/**
* 下面是运用数学上的方式来破解这个1000位数的难题
* 只需要1ms
*/
/**
* 但是Fibonacci sequence还有一个重要的性质就 ...
package com.yao.Algorithms;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author shuimuqinghua77 @date 2012-4-26下午02:01:16
*
*/
public class Problem24 {
/**
* 存放数字
*/
private static List<Integer> list=new ArrayList<Integer>();
private static int MILLI ...
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.
A number n is called deficient if the sum of its proper divisors is les ...
Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name scor ...
Problem 21
05 July 2002
Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where a b, then a and b are an amicable pair and each of a and b are called amicable numbers.
For example, the proper divisors of 220 are ...
这是一个相当不错的 Python 代码自动完成的脚本。
可以实现下面python代码的自动补全:
简单python关键词补全
python 函数补全带括号
python 模块补全
python 模块内函数,变量补全
from module import sub-module 补全
pydiction 插件安装
pydiction 1.0 之后版本安装配置
适用VIM7之后的版本。
1.python_pydiction.vim
将文件 python_pydiction.vim 放到 ~/.vim/after/ftplugin/ 路径下,如果这个路径不存 ...
转:linux 文件解压命令
- 博客分类:
- linux
tar命令
tar 可以为文件和目录创建档案。利用tar,用户可以为某一特定文件创建档案(备份文件),也可以在档案中改变文件,或者向档案中加入新的文件。tar最初被用来在磁带上创建档案,现在,用户可以在任何设备上创建 ...
1.edit and configure pythonstartup file
# python startup file
import sys
import readline
import rlcompleter
import atexit
import os
# tab completion
readline.parse_and_bind('tab: complete')
# history file
histfile = os.path.join(os.environ['HOME'], '.pythonhistory')
try:
readline.rea ...
package com.yao.shuimu.euler;
import java.util.ArrayList;
import java.util.List;
/**
* Created by IntelliJ IDEA.
* User: shuimuqinghua77
* Date: 11-12-15
* Time: 下午1:25
*/
public class Problem20 {
public static void main(String[] args) throws Exception {
byte[] res ...
package com.shui.mu.yao.io.algorithm;
import java.util.Calendar;
/**
*
* @author shuimuqinghua77 @date 2011-12-9上午09:58:49
*/
public class Problem19 {
public static void main(String[] args) {
int count = oneDayTotal(1901,2000,/** 1901年1月1日是周二 **/Calendar.TUESDAY,/**期望获取每个月第一天周日的总 ...
package com.yao.Algorithms;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.Reader;
/**
*
* @author shuimuqinghua77 @date 2011-12-4
*
*/
public class Problem18 {
private final static int SIZE = 100;
public static void main(String ...