自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(73)
  • 资源 (2)
  • 收藏
  • 关注

原创 Android界面相关的类

Window是Activity的界面表达,并作为顶层View被添加到WindowManager中。Window提供了标准的UI显示策略:界面背景、标题区域、默认的事件处理。该抽象类只有一个子类PhoneWindow。WindowManager应用和设备窗口管理器(Window Manager)交互的接口

2015-07-10 18:31:11 825

原创 Activity启动流程、Looper及Handler

android.app.ActivityThread该类中的main方法是Android应用的入口,执行main方法的线程为主线程,主线程默认创建一个Looper对象和Handler,用于处理发送给主线程的Message

2015-07-08 15:39:28 2550

原创 Android异步任务

本文主要探讨Android平台提供的各种异步加载机制,包括它们的适用场景、使用方法等。1. AsynTaskAsynTask适用于最长可以持续几秒钟的短时间的操作,对于长时间的操作,建议使用java.util.concurrent包下的多线程框架。定义一个AsynTask时需要提供以下三个泛型参数的实际类型: Params:被传递给后台线程执行的参数的类型 Progress:后台线程执

2015-06-03 17:04:58 799

原创 Android设计中的尺寸问题

Android把屏幕大小分成四种:small, normal, large, xlarge; 屏幕密度分成:low(ldpi), medium(mdpi), high(hdpi), extra high(xhdpi);各个屏幕密度之间的关系如下: 密度名称 密度的参考值(dpi) 关系 对应的屏幕分辨率 xxxhdpi 640dpi xxhdpi 480d

2015-06-02 17:45:11 922

原创 Android事件处理模型

事件处理是Android编程中非常重要的一个部分,因为Android应用在运行过程中会产生许多各种各样的事件(动作),应用必须为这些动作执行对应的响应代码;将产生的动作和响应联系起来的方式就是事件处理机制。Android平台提供了两种事件处理机制,分别是基于监听的模式和基于回调的模式。1. 基于监听的事件处理模型1.1 组成部分 事件源:事件发生的地方,比如某个按钮、文本框等 事件:事

2015-05-28 22:49:35 928

原创 ART

ART(Andorid Runtime)是Google在新版Android系统中引入的运行时环境;在此之前,Android一直使用Dalvik虚拟机作为java的运行平台。用过Android手机的小伙伴们都知道一个不争的事实,Android手机在流畅度方面显然和苹果不在一个层次上,因此,Android团队在一直在对系统的各个方面进行优化,运行环境就是其优化的一个方面。ART特征 编译提前(

2015-05-28 20:46:30 642

原创 Java内存管理及垃圾回收总结

Java和C++的一个非常重要的区别在于内存管理,JVM把内存管理及垃圾回收接管过来,不需要Java程序员显式的管理对象的生命周期,从而避免了诸如内存溢出及内存泄露等问题;但作为一个Java程序员,深刻理解Java的内存管理及垃圾回收机制,对于理解Java对象的创建过程,有效利用内存,构建高性能Java应用将具备非常重要的意义,因此本文对Java的内存管理机制做了一个详细的介绍。

2014-10-06 20:03:04 1290

原创 [LeetCode] Sort List

LeetCode: https://oj.leetcode.com/problems/sort-list/

2014-09-21 22:01:34 432

原创 [LeetCode] Reorder List

Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given {1,2,3,4}, reorder it to {1,4

2014-09-21 21:53:23 565

原创 [LeetCode] Candy

LeetCode: https://oj.leetcode.com/problems/candy/ ti

2014-09-21 21:42:07 417

原创 [LeetCode]Longest Valid Parentheses

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()", which

2014-09-21 21:29:22 564

原创 [LeetCode]Binary Tree Maximum Path Sum

Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 / \ 2 3Return 6.

2014-09-21 18:05:57 417

原创 [LeetCode] Median of Two Sorted Arrays

Median of Two Sorted ArraysThere are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n))LeetC

2014-09-21 17:50:18 458

原创 [LeetCode] Palindrome Partitioning && Palindrome Partitioning II

Palindrome Partitioning Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",

2014-09-21 17:09:17 370

原创 [LeetCode] Word Break && Word Break II

Given a string s and a dictionary of words dict, determine ifs can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet",

2014-09-21 16:23:50 426

原创 [LeetCode]Decode Ways

A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total number

2014-09-21 15:24:59 388

原创 [LeetCode] String to Integer(atoi)

String to Integer(atoi)Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself wha

2014-09-19 16:10:30 442

原创 [LeetCode] Surrounded Regions

Surrounded RegionsGiven a 2D board containing 'X' and 'O', capture all regions surrounded by'X'.A region is captured by flipping all 'O's into 'X's in that surrounded region.For example,

2014-09-19 15:58:59 359

原创 [LeetCode]Merge Intervals && Insert Interval

LeetCode: https://oj.leetcode.com/problems/merge-intervals/

2014-09-19 15:34:29 504

原创 进程间同步问题

临界区:临界区是指不同的进程中,有可能fangwen

2014-09-18 16:37:27 1139

原创 进程间通信(IPC)

进程间通信的机制包括共享内存和

2014-09-17 17:06:16 638

原创 [LeetCode] Reverse Words in a String

Reverse Words in a StringGiven an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".click to show clarification.Clarification

2014-09-14 16:43:23 474

原创 [LeetCode] Word Search

Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically n

2014-09-14 16:03:49 376

原创 [LeetCode] Word Ladder

LeetCode: https://oj.leetcode.com/problems/word-ladder/

2014-09-14 15:44:06 538

原创 Java基础类库概述

前言Java在它的基础类库中

2014-09-13 23:21:07 500

原创 Java深度拷贝

基本概念浅拷贝:复制后对象的所有基本类型域的值与原对象相等,所有引用指向的对象和原对象指向的对象相同深拷贝:复制后对象的所有基本类型的值与原对象相等,且他们的引用指向不同的对象,但对象中的基本类型域的值相等,假如其中还包含引用,则指向的对象同样被拷贝了一份,以此类推(即所有引用链上的对象都被拷贝了一份)依赖clone方法的深度拷贝在Java的Object类中有一个clone方法

2014-09-13 22:52:46 1245

原创 Java中equals方法和hashCode方法

《Effective Java》第2版中的第9条条款

2014-09-13 17:43:33 500

转载 Unix Socket编程简介

Unix/Linux操作系统暴露给应用层的网络编程接口时Socket

2014-09-13 13:32:11 449

原创 TCP连接的建立与终止

TCP是通过三次握手建立连接的,其过程如下:

2014-09-12 21:27:07 450

原创 [LeetCode]Combinations

LeetCode: https://oj.leetcode.com/problems/combinations/该题采用DFS的方法来解决,和Permutations,N-Queens的解决方式类似:代码如下:public class Solution { public List> combine(int n, int k) { List> comb

2014-09-12 19:50:20 383

原创 [LeetCode]Binary Tree Maximum Path Sum

LeetCode: https://oj.leetcode.com/problems/binary-tree-maximum-path-sum/

2014-09-12 19:40:15 422

原创 [LeetCode] Path Sum && Path Sum II

Path Sum: https://oj.leetcode.com/problems/path-sum/Path Sum II: https://oj.leetcode.com/problems/path-sum-ii/

2014-09-12 18:54:23 478

原创 [LeetCode] Search in Rotated Sorted Array

LeetCode: https://oj.leetcode.com/problems/search-in-rotated-sorted-array/

2014-09-12 16:20:27 393

原创 树的遍历

本文对树的遍历操作做个总结:1. 前序遍历递归实现:public class Solution { public List preorderTraversal(TreeNode root){ List result = new ArrayList(); preOrder(result, root); return result; } private void pr

2014-09-12 15:26:26 351

原创 多路归并排序

在经典的归并排序中,我们采用的都是二路

2014-09-12 12:33:52 563

原创 网络IO总结

网络IO的模式包括同步IO,异步IO,阻塞IO,非阻塞IO;这些IO模式之间的区别和联系是任何一个搞网络编程(Socket编程)的人必须弄清楚的问题,下面我们就来一层层的揭开他们的面纱吧。在Unix网络编程第一卷第六章中讨论了五种IO模型:1. 阻塞IO(Blocking IO)2. 非阻塞IO(Nonblocking IO)3. IO多路复用(IO multiplexing)

2014-09-10 16:55:05 494

原创 动态规划解决经典问题

动态规划的思想对于解决最优问题通常非常有效

2014-09-09 22:57:58 724

原创 递归思想解决经典问题

递归是一个非常经典的算法思想,很多问题都可以采用递归来解决,特别是对于树、字符串这类本身就具有递归性质的数据结构相关的问题,下面就列出几个可以用递归来解决的经典问题:1. 字符串排列问题(不包含相同字符)该问题要求求出字符串的所有排列,我们可以循环遍历整个字符串,将每次循环遇到的字符和第一个位置的字符交换,然后求剩下字符串的所有排列;对于剩下的字符串,重复前面的过程,所以这是个递归的过

2014-09-09 21:05:30 932

原创 【字符串处理系列】最长回文子串

这是一道非常经典的字符串处理问题,最朴素

2014-09-09 10:36:48 492

原创 【字符串处理系列】最长重复子串

最长重复子串是指在字符串中中找出

2014-09-08 16:10:18 690

verilog语言学习基础

verilog语言学习基础,非常经典的一本指导书,适用于初学者

2011-03-11

编译原理与实践课后习题答案 中文版

编译原理与实践课后习题答案中文版,机械工业出版社

2011-03-11

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除