自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

niansiqiao的专栏

一个强者要有三个基本条件:最野蛮的身体,最文明的头脑和不可征服的精神

  • 博客(102)
  • 资源 (9)
  • 收藏
  • 关注

转载 Longest Valid Parentheses (求最长有效匹配括号子串的长度)

转自:http://blog.csdn.net/cfc1243570631/article/details/9304525题目描述:Given a string containing just the characters'(' and')', find the length of the longest valid (well-formed) parenthe

2015-05-23 10:47:52 587

转载 C++ STL next_permutation的实现原理

next_permutation得到下一个排列,如对序列 a, b, c,每一个元素都比后面的小,它的下一个序列即为a, c, bnext_permutation的函数原型如下: template bool next_permutation(      BidirectionalIterator _First,       BidirectionalIterator

2015-05-23 08:53:06 768

转载 strstr的实现

包含文件:string.h函数名: strstr函数原型:1extern char *strstr(char *str1, const char *str2);语法:1* strstr(str1,str2)s

2015-05-19 23:41:49 508

转载 View 事件传递

本文为 Android 开源项目源码解析 公共技术点中的 View 事件传递 部分分析者:Trinea,校对者:Trinea,校对状态:完成本文后面后继续整理。推荐一篇我看到的对传递机制介绍最清楚的国外文章吧。本文略作翻译。1、基础知识(1) 所有Touch事件都被封装成了MotionEvent对象,包括Touch的位置、时间、历史记录以及第几个手指(多指触

2015-05-18 15:07:22 531

转载 View 绘制流程

本文为 Android 开源项目源码解析 公共技术点中的 View 绘制流程 部分分析者:lightSkyView 绘制机制1. View 树的绘图流程当 Activity 接收到焦点的时候,它会被请求绘制布局,该请求由Android framework 处理.绘制是从根节点开始,对布局树进行 measure 和 draw 。整个 View 树的绘图流程在ViewRoo

2015-05-18 15:06:00 389

转载 Android抽象布局——include、merge 、ViewStub

在布局优化中,Androi的官方提到了这三种布局、、,并介绍了这三种布局各有的优势,下面也是简单说一下他们的优势,以及怎么使用,记下来权当做笔记。1、布局重用标签能够重用布局文件,简单的使用如下:[html] view plaincopyprint?LinearLayout xmlns:android="h

2015-05-18 14:10:27 379

转载 leetcode之Regular Expression Matching

Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input st

2015-05-18 11:10:43 394

转载 leetcode之 median of two sorted arrays

利用类似merge的操作找到中位数,利用两个分别指向A和B数组头的指针去遍历数组,然后统计元素个数,直到找到中位数,此时算法复杂度为O(n)。之后还尝试了根据算法导论中的习题(9.3-8)扩展的方法,但是该方法会存在无穷多的边界细节问题,而且扩展也不见得正确,这个可从各网页的评论看出,非常不建议大家走这条路。最后从medianof two sorted arrays中看到了一种非常好的方法

2015-05-16 15:48:38 390

转载 Android内存泄露分析

Android OOM/MemoryLeak各位读者可能都有拿的出手的github或者APP实战项目,但是会使用现成的XX开源组件并不代表你的基础就很好。本文将带你补习Android基础 -- Android中内存泄露实例,分享给大家。1. 基础在阅读本文前,请了解如下基础本文属于java语言上的分析,不涉及到GC,虚拟机,native底层细节的实现。

2015-05-07 16:30:04 521

转载 [leetcode]Fraction to Recurring Decimal

ProblemGiven two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is repeating, enclose the repeating part in pare

2015-05-02 17:51:01 557

原创 [leetcode]Reverse Integer

Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are some good questions to ask before c

2015-05-02 15:37:16 373

转载 Leetcode: Permutation Sequence

The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3):"123""132""213""231""312

2015-05-01 19:25:13 338

转载 LeetCode-Single Number II[位运算]

Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without usi

2015-04-30 07:44:15 437

转载 Best Time to Buy and Sell Stock III -- LeetCode

题链接: http://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/ 这道题是Best Time to Buy and Sell Stock的扩展,现在我们最多可以进行两次交易。我们仍然使用动态规划来完成,事实上可以解决非常通用的情况,也就是最多进行k次交易的情况。这里我们先解释最多可以进行k次交易的算法,然

2015-04-29 18:36:48 365

转载 在Android上实现模糊视图

本文由 伯乐在线 - treesouth 翻译,唐尤华 校稿。未经许可,禁止转载!英文出处:developers.500px.com。欢迎加入翻译小组。模糊效果模糊效果可以生动地表现出内容的层次感,能帮助用户着重关注内容。即便在模糊表面下层发生视差效果或者动态改变,也能够保持当前专题内容。在iOS上,我们首先构造一个UIVisualEffectView得到一类模糊层:

2015-04-27 18:19:32 1805

转载 [LeetCode]Maximum Gap

题目描述:Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 if the array contains less than 2

2015-04-27 08:03:58 405

转载 How Developers Sort in Java?

转自:http://www.programcreek.com/2014/03/how-developers-sort-in-java/While analyzing source code of a large number of open source Java projects, I found Java developers frequently sort in two

2015-04-26 18:11:41 596

转载 Top 10 Algorithms for Coding Interview

转自: http://www.programcreek.com/2012/11/top-10-algorithms-for-coding-interview/The following are the common topics for coding interviews. As understanding those concepts requires much more e

2015-04-24 23:03:22 518

转载 二叉树系列 - [LeetCode] Symmetric Tree 判断二叉树是否对称,递归和非递归实现

转自:http://www.cnblogs.com/felixfang/p/3653811.htmlGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric

2015-04-23 08:25:04 710

转载 LRU cache实现 (Java)

引子:我们平时总会有一个电话本记录所有朋友的电话,但是,如果有朋友经常联系,那些朋友的电话号码不用翻电话本我们也能记住,但是,如果长时间没有联系了,要再次联系那位朋友的时候,我们又不得不求助电话本,但是,通过电话本查找还是很费时间的。但是,我们大脑能够记住的东西是一定的,我们只能记住自己最熟悉的,而长时间不熟悉的自然就忘记了。其实,计算机也用到了同样的一个概念,我们用缓存来存放

2015-04-19 19:42:07 466

转载 Merge k Sorted Lists -- LeetCode

转自: http://blog.csdn.net/linhuanmars/article/details/19899259?utm_source=tuicool原题链接: http://oj.leetcode.com/problems/merge-k-sorted-lists/ 这道题目在分布式系统中非常常见,来自不同client的sorted list要在central

2015-04-18 22:56:31 440

转载 mac 下 nginx 环境的搭建

nginx 是一个轻量级的高性能HTTP 以及反向代理服务器,今天在MAC 上安装成功。我是通过brewhome 来安装的,很简单。brew install nginx 一路顺畅。。。下面是安装信息。hematoMacBook-Pro:~ hechangmin$ brew search nginxnginxhematoMacBook-Pro:~ hechangmin

2015-04-17 10:42:56 415

转载 Container with most water

首先原题描述如下:Given n non-negative integers a1, a2, ...,an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of linei is at (i, ai) and (i,

2015-04-15 08:48:21 343

转载 overdraw优化小结

★ 预备知识在Android的开发过程中,drawing performance往往是我们最关注也是努力去优化的一个点。而造成drawing perfomance的元凶之一就是overdraw。那么1. 什么是overdraw?overdraw发生在应用每次请求在其它物体上绘制内容的时候。例如:一个白色背景的窗口,在它上面有一个按钮。当系统绘制按钮时,要绘制在已存在的白色背

2015-04-14 14:04:17 449

转载 [LeetCode] Best Time to Buy and Sell Stock IV 买卖股票的最佳时间之四

转自:http://www.cnblogs.com/grandyang/p/4295761.htmlSay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. Y

2015-04-11 21:40:35 402

转载 leetCode题解——Majority Element

转自:http://www.xgezhang.com/leetcode_majorigy_element.html?utm_source=tuicool题目描述:Given an array of size n, find the majority element. The majority element is the element that appears

2015-04-09 23:59:17 497

转载 ffplay的音视频同步分析

在ffplay里的视频图像更新是在一个timer里面更新的,当有timer事件时就会调用video_refresh_timer()函数,而在这个函数里面会调用compute_frame_delay()计算下一帧图像显示的时间video_refresh_timer()    /* launch timer for next picture */    schedule_refresh(i

2015-04-08 10:36:02 404

转载 leetcode难度及面试频率

转载自:LeetCode Question Difficulty Distribution       1Two Sum25arraysort    setTwo Poin

2015-04-06 22:58:19 452

转载 LeetCode :: Maximum Subarray 详细分析

Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contiguous subarray [4,−1,2,1] ha

2015-04-05 09:24:32 362

转载 LeetCode – Distinct Subsequences Total

Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from the original string by deleting some (can be non

2015-04-05 08:38:10 531

转载 LeetCode – Triangle

转自:http://www.programcreek.com/2013/01/leetcode-triangle-java/Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.

2015-04-02 20:29:04 366

转载 activity中的onPause()和onSaveInstanceState()解析

当用户在开启一个新activity时,当前的activity可能在内存中处于停止状态也可能由于新activity需要更多内存而被系统杀掉了,但不论怎样,当用户在新activity上按返回键时,他希望看到的是原先的activity的界面。原先的activity如果是被重新创建,那么它要恢复到用户最后看到它的样子。那么我们怎么做呢?其实也不难,跟据上一节所述,在onPause()或onStop()或o

2015-03-31 14:02:15 844

转载 Android view的工作原理

1:View 工作原理,       整个View 树的绘制是在ViewRoot.java 类的performTraversals() 函数展开的,该函数做的执行过程可简单概括为      根据之前设置的状态 判断是否需要重新计算视图大小(measure)是否重新需要安置视图的位置(layout) 以及是否需要重绘(draw)mView :DecorView 对

2015-03-31 13:36:03 463

转载 x264 编码器选项分析 (x264 Codec Strong and Weak Points) 2

转自:http://blog.csdn.net/leixiaohua1020/article/details/39023071======================上篇文章简单翻译了MSU实验室做的X264的Option(即编码选项,后文称其英文名)分析报告《x264 Codec Strong and Weak Points》的前面部分。前面部分部分比较基础,

2015-03-30 16:28:57 464

转载 x264 编码器选项分析 (x264 Codec Strong and Weak Points) 1

转自: http://blog.csdn.net/leixiaohua1020/article/details/39004293======================本文简单翻译了MSU实验室做的X264的Option(即编码选项,后文称其英文名)分析报告《x264 Codec Strong and Weak Points》。看了之后感觉分析得十分透彻,而且其采用

2015-03-30 16:28:13 458

转载 P2P 之 UDP穿透NAT的原理与实现

转自:http://www.cnblogs.com/tianyamoon/archive/2007/04/04/700064.htmlP2P   之   UDP穿透NAT的原理与实现(附源代码)     原创:shootingstars     参考:http://midcom-p2p.sourceforge.net/draft-ford-midcom-p2p-01.txt  

2015-03-30 11:56:12 362

转载 Android性能调优

转自:http://www.trinea.cn/android/android-performance-demo/一、性能瓶颈点整个页面主要由6个Page的ViewPager,每个Page为一个GridView,GridView一屏大概显示4*4的item信息(本文最后有附图)。由于网络数据获取较多且随时需要保持页面内app下载进度及状态,所以出现以下性能问题a.  V

2015-03-30 10:49:31 621

转载 char *和char[]的初始化

char* str1 = "abcd";char str2[] = "abcd";void reverse(char * input, int len){ ...}在调用reverse函数时. 从形式上 reverse(str1,5) 和reverse(str2, 5)都没有错误,传入的参数都是char数组的头指针,但是实际操作时,不能采取str1的初始化形式.

2015-03-30 08:40:08 22431

转载 OpenGL中的原语组装和光栅化

一、什么是原语?       原语就是可以用glDrawArrays和glDrawElements来进行画图的几何对象。原语由一系列顶点来描述,每个顶点包含位置、颜色、法线和纹理坐标。       原语包括:点、线、三角行。二、原语类型1. 三角形原语类型      1)GL_TRIANGLES:三角形顶点互不重用,如顶点{V0,V1,V2,V3,V4,V5

2015-03-29 23:26:35 707

原创 [leetcode] Merge Intervals

import java.util.ArrayList;import java.util.Collections;import java.util.List;/** * Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[

2015-03-28 12:59:07 322

[游戏设计编程电子书合集].GPU.Gems.3.

游戏编程进阶系列,GPU游戏开发人员必备

2010-10-08

Oracle 10g管理二教材

OCP考试必备资料,Oracle自学资料,管理2

2010-09-05

Oracle 10g 管理1教材

OCP考试必备资料,Oracle自学资料,管理1

2010-09-05

Android教程图书大全

Google Android 手机 应用程序 开发必备

2010-06-05

Android Essentials

Android是一种趋势,开发必备,经典,强烈推荐

2010-06-05

图书管理系统(功能相当强大)

功能相当强大的图书管理系统,公司内部学习模板,毕业设计很好的模枋模板!

2009-05-14

学生管理系统(功能完善)

学生管理系统,功能完善,界面友好,是毕业设计的很好的参考材料!

2009-05-14

翔高教育《2009年计算机学科专业基础综合复习指南》试读版.pdf

计算机专业基础综合经典复习参考书,高分必备

2009-03-28

计算机图形学CAD三维旋转体启子

三维旋转体-启子(经过渲染),计算机图形学(AutoCAD)作业,有兴趣的可以看看......

2008-10-28

空空如也

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

TA关注的人

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