- 浏览: 678029 次
- 性别:
- 来自: 西安
最新评论
-
3482561:
Android 面试题目之 线程池 -
daojin:
直接布局。
安卓高手之路之图形系统(6)requestLayout的流程 -
hety163:
没明白楼主所说的最后两段。如果一个相对布局中有多个子view, ...
安卓高手之路之图形系统(6)requestLayout的流程 -
jackuhan:
100篇!!!膜拜
安卓高手之路之 图形系统之 图形框架(1) -
ritterliu:
不错,按照流程把关键代码都贴出来了。谢谢分享
Android输入输出系统之TouchEvent流程
文章列表
1. 缩放RGBA
private byte[] scaleRGBA(final byte[] data
, int scale
, final int cameraWidth
, final int cameraHeight
, int[] outSize) {
int w = cameraWidth / scale;
int h = cameraHeight / scale;
outSize[0] = w;
...
Android native 开发中的 C++技术总结
1. 编译时期出现undefined reference to xxx.h
CMakeLists.txt 中 include_directories 行没有加入对应.h文件
2. 编译时期出现undefined implementation
CMakeLists.txt 中 如果函数的实现是通过
target_link_libraries 的方式引入的,则为动态库函数, 则需要导出符号表。
target_link_libraries(outlib, inlib1, inlib2)//No lib pre
例如以上行,如果函数的实现是在i ...
http://www.voidcn.com/article/p-ujxjbzrr-cm.html
https://github.com/cdcseacave/VCG/tree/master/vcg/complex/algorithms
SQLite的锁的原理:
http://www.cnblogs.com/huozhong/p/5973938.html
http://www.sqlite.org/lockingv3.html
http://www.cnblogs.com/wangmars/p/4530670.html
http://blog.csdn.net/u010205141/article/details/44182461
https://stackoverflow.com/questions/6675240/is-sqlite-database-instance-thread-safe
http://droidyue ...
1.ListView的目标
ListView希望通过复用看不见的View来达到目的。其中最最重要的就是这个
2.RecycleBin--回收站.
回收站并不是垃圾站。
最重要的是两个成员变量 mScrapViews 和mActiveViews, mScrapViews 表示回收站的View. mActiveViews表示激活的View,激活的View是可以直接拿来显示的,不想要重新调用getView填充数据。激活的View(mActiveViews)和废弃的View(mScrapViews) 不同,激活的View不想要调用getView填充数据,而废弃的View需要。
...
写了一个类来理解java 同步机制的算法。这个类并不适合实战,而仅仅是算法层面进行理解。
package multithread;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* The above specifications allow us to determine several properties having to
* do with the interaction of waits, n ...
下面是java 多线程中的异常处理:
package multithread;
public class InterruptException {
public static void main(String[] args) throws InterruptedException {
Thread thread1 = new InterruptThread1();
Thread thread2 = new InterruptThread2();
thread1.start();
thread2.start();
Thread.s ...
public int StrToInt(String str) {
if(str.length()<= 0){
return 0;
}
int firstIndex = 0;
boolean isNegative = false;
char first = str.charAt(0);
if(first == '+'|| first == '-'){
if(first == '-'){
i ...
非递归遍历二叉树的方法
- 博客分类:
- Android面试题目
package interview;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
/**
* None recursive pre-order, post-order and in-order. In order to back trace,
* the main idea here is using a Node that point to the last popped Node.
*
*
*
* The last popped No ...
package interview;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
/**
* None recursive pre-order, post-order and in-order.
* In order to back trace, the main idea here is using a Node that point to the last
* popped Node.
*
*
*
* The last popped No ...
Seperate the Odd and Even
public void reOrderArray(int [] array) {
int top = -1;
int p = 0;
while (true){
if( p>= array.length){
break;
}
if((array[p]&1)!=0){
int temp = array[p];
for(int j = p -1; j>oddE ...
题目描述
输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。
package interview;
/**
* Definition for binary tree
*
*/
public class Solution2 {
public static void main(String[] args) {
int[] pre = new int[] { 1, 2 ...
在深入编译器原理细节之前,很多学习者并没有真正从宏观上理解一个编译器都做了些什么,这其实是非常遗憾的。
从计算机执行过程角度思考,函数调用的尤为重要,面向过程的语言更是将函数调用作为最基本的要素。面向对象的语言也是基于最基本的函数调用实现的。因此本文就从函数调用开始,由浅入深地思考如何构建我们的编译器。
1. 一个函数调用和其子调用之间的结构图。
一个SuperFunction对象 包含很多SubFunction函数,SubFunction 是SuperFunction的子函数。因此我们使用组合模式将他们组合起来。
2. 父函数SuperFunction与子函数SubFunction的 ...
騰訊大廈有39層的問題解決方案。
- 博客分类:
- Android面试题目
問題:
腾讯大厦有39层,你手里有两颗一抹一眼的玻璃珠。当你拿着玻璃珠在某一层往下扔的时候,一定会有两个结果,玻璃珠碎了或者没碎。大厦有个临界楼层。低于它的楼层,往下扔玻璃珠,玻璃珠不会碎,
* 等于或高于它的楼层,扔下玻璃珠,玻璃珠一定会碎。玻璃珠碎了就不能再扔。现在让你设计一种方式,使得在该方式下,最坏的情况扔的次数比其他任何方式最坏的次数都少。也就是设计一种最有效的方式来确定临界楼层
解決方法
用户随机选一层i,扔下去,有两个结果:
碎掉,或者没有碎掉。
1.如果碎掉,去试验前i-1层,那么最多需要i-1次再加上碎掉的那一次,最多就是i次。
2.如果没有碎掉,等于说从第i+ ...