- 博客(22)
- 资源 (10)
- 收藏
- 关注
转载 canvas.save() canvas.restore() 作用
暂时先看此博客,待以后再研究这里canvas.save();和canvas.restore();是两个相互匹配出现的,作用是用来保存画布的状态和取出保存的状态的。这里稍微解释一下.onDraw方法会传入一个Canvas对象,它是你用来绘制控件视觉界面的画布。 在onDraw方法里,我们经常会看到调用save和restore方法,它们到底是干什么用的呢?
2015-01-29 19:54:27 624
转载 随笔之如何实现一个线程池
转自:http://www.cnblogs.com/innost/archive/2011/11/24/2261454.html一 缘由: 最近因工作问题,需要实现一个简单的线程池,满足以下要求: 1 可伸缩,即一旦发现线程不够用,则可以动态增加线程。(至于缩减线程,这个可能难度比较大,暂时不考虑)。 2 支持超时任务。比如提交一个Task,可以设置5秒后
2015-01-29 12:22:41 709
转载 Android权限之sharedUserId和签名
最近在做个东西,巧合碰到了sharedUserId的问题,所以收集了一些资料,存存档备份。 安装在设备中的每一个apk文件,Android给每个APK进程分配一个单独的用户空间,其manifest中的userid就是对应一个Linux用户都会被分配到一个属于自己的统一的Linux用户ID,并且为它创建一个沙箱,以防止影响其他应用程序(或者其他应用程序影响它)。用户ID 在应用程序
2015-01-27 17:20:56 597
原创 LeetCode:Count and Say
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off a
2015-01-22 21:09:20 464
原创 LeetCode:Implement strStr()
Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update (2014-11-02):The signature of the function had been updated
2015-01-22 11:32:14 661
原创 LeetCode:Plus One
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.public class Solutio
2015-01-22 11:23:55 502
原创 LeetCode:Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is def
2015-01-21 18:12:41 455
转载 从输入 URL 到页面加载完的过程中都发生了什么事情
Cache一个HTTP请求的过程为了简化我们先从一个HTTP请求开始,简要介绍一下一个HTTP求情的网络传输过程,也就是所谓的“从输入 URL 到页面下载完的过程中都发生了什么事情”DNS Lookup 先获得URL对应的IP地址Socket Connect 浏览器和服务器建立TCP连接Send Request 发送HTTP请求Conte
2015-01-21 16:19:08 570
原创 LeetCode:Excel Sheet Column Title
Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB Credits:S
2015-01-20 17:10:24 539
转载 LeetCode:Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the fol
2015-01-19 15:32:27 459
转载 ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L
2015-01-16 17:13:18 532
转载 LeetCode:Two Sum
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 numbers such that they add up to the target, w
2015-01-15 12:58:58 503
原创 LeetCode : Largest Number
Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.Note: The result may be
2015-01-13 18:00:06 553
转载 LeetCode:Binary Tree Postorder Traversal
Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,1].Note: Recursive solution is t
2015-01-13 17:07:00 399
原创 LeetCode:Single Number
Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using e
2015-01-13 16:18:05 425
原创 LeetCode:(LRU) cache
import java.util.LinkedHashMap;import java.util.Map;/** * Design and implement a data structure for Least Recently Used (LRU) cache. * It should support the following operations: get and set.
2015-01-13 16:12:05 553
转载 LinkedHashMap和HashMap的比较使用
import java.util.HashMap;import java.util.Iterator;import java.util.LinkedHashMap;import java.util.Map;public class TestLinkedHashMap { public static void main(String args[]) { System.out
2015-01-13 15:44:22 470
原创 jvm网站资料整理
一、编译器jvm性能优化和编译器的概述:http://www.importnew.com/2009.html字节码的基础介绍:http://www.javaworld.com/article/2077233/core-java/bytecode-basics.html二、gcgc的概述:http://www.importnew.com/2233.html#rdc
2015-01-09 11:31:25 623
转载 Kendall's tau
Kendall's tau是数学统计中一个常用的系数,用来描述两个序列的相关系数。如果两个序列完全一致,则Kendall's tau值为1,两个毫不相关的序列的Kendall's tau值为0,而两个互逆的序列的Kendall's tau系数为-1.具 体的计算方式为: 1 - 2 * symDif / (n * (n -1)),其中n为排列的长度(两个序列的长度相同),symDif为对称距离
2015-01-07 12:32:23 11603 1
转载 索引优先队列的实现
/************************************************************************* * Compilation: javac IndexMinPQ.java * Execution: java IndexMinPQ * * Minimum-oriented indexed PQ implementation u
2015-01-07 11:31:44 1408
原创 网易游戏面试面经搜集
@笔试 10.22网易游戏笔试,三个小时的题,题量还是非常大的,设计计算机各们核心课程,操作系统原理,c/c++,基础数据结构与算法,数学推理题,网络等。题特别多,题特别杂,几乎没有童鞋做完吧。多多益善吧。经历过考研,一些基础课程还是蛮扎实,前40分的题答的不错,后面的算法题做的一般,我只会最笨重的方法。@一面 10.24晚上通知11.1下午2点面试最次给各位同学提个醒,简历一定要多带
2015-01-06 14:32:45 2952
驱动和应用层的三种通信方式
2014-03-12
《模式分类》第二版的配套的Matlab源代码
2013-07-29
Adaboost matlab代码
2013-07-26
PCA人脸识别C++源代码
2013-02-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人