自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Dive Deep into The Knowledge

向知识更深处慢溯

  • 博客(45)
  • 资源 (5)
  • 问答 (7)
  • 收藏
  • 关注

原创 C/C++中变量的内存分配和收回

// C:     who mallocs who frees// C++:   who news who deletes// C++11: who owns who does nothingclass Bar {    Public:        Bar();        void doSomething() const;};void fun1(const Bar&amp...

2019-01-31 11:56:30 373

原创 Android中为什么主线程不会因为Looper.loop()里的死循环卡死?

这是很好的一个问题,涉及的知识有:Process/Thread,Android Binder IPC,Handler/Looper/MessageQueue消息机制,Linux pipe/epoll机制暂时还没认识那么深入,等准备充分之后,再来码这一篇.https://www.zhihu.com/question/34652589/answer/59578531消息机制角色:M...

2019-01-30 00:21:19 364

原创 深入理解Java虚拟机 Dive into JVM

一,类加载机制从源代码文件到物理设备执行程序的过程: (1) 加载将class文件(.class)字节码内容加载到内存中(由ClassLoader负责),并将这些静态数据转换成方法区中的运行时数据结构,在堆Heap中生成一个代表这个类的java.lang.Class对象,作为方法区类数据的访问入口.这个过程结束后,在方法区中存储加载进来的类的一些数据,在堆中存储一个对象实例....

2019-01-28 18:14:36 306

原创 Leetcode 112. Path Sum

Related tops: DFS & RecursionGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Note: A leaf i...

2019-01-28 12:05:56 128

原创 Leetcode 984. String Without AAA or BBB

贪心算法Given two integers A and B, return any string S such that:S has length A + B and contains exactly A 'a' letters, and exactly B 'b'letters; The substring 'aaa' does not occur in S; The subst...

2019-01-27 22:57:30 347

原创 Leetcode 561. Array Partition

Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as pos...

2019-01-27 21:45:35 154

原创 Leetcode 784. Letter Case Permutation

backtracking + dfs + recursive 784. Letter Case PermutationEasy49661FavoriteShareGiven a string S, we can transform every letter individually to be lowercase or uppercase to create another st...

2019-01-27 19:29:45 152

原创 Leetcode 856. Score of Parentheses

 递归专题1Given a balanced parentheses string S, compute the score of the string based on the following rule:() has score 1 AB has score A + B, where A and B are balanced parentheses strings. (A) h...

2019-01-27 17:33:23 350 2

原创 Leetcode 982. Triples with Bitwise AND Equal To Zero

Given an array of integers A, find the number of triples of indices (i, j, k) such that:0 <= i < A.length 0 <= j < A.length 0 <= k < A.length A[i] & A[j] & A[k] == 0, w...

2019-01-27 12:54:14 483

原创 Leetcode 7. Reverse Integer

Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we are de...

2019-01-25 23:49:30 122

原创 wifi万能钥匙原理研究

todo

2019-01-25 16:33:40 1325

原创 剑指offer 面试题3

题一:找出数组中重复的数组。在一个长度为n的数组里的所有数字都在0~n-1的范围。数组中某些数字是重复的,但不知道有几个数字重复里,也不知道每个数字重复了几次。请找出数组中任意一个重复的数字。privat List<Integer> findAllRepeats(int[] arr) { Pair<Integer, Integer>[] tem...

2019-01-24 23:38:40 170

原创 试水开发自己的产品

todo

2019-01-23 13:10:18 152

原创 Leetcode 77. Combinations

todo

2019-01-20 13:04:14 143

原创 Leetcode 977. Squares of a Sorted Array

Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order. Example 1:Input: [-4,-1,0,3,10]Output: [0,1,9,...

2019-01-20 12:05:38 590

原创 Leetcode 978. Longest Turbulent Subarray

A subarray A[i], A[i+1], ..., A[j] of A is said to be turbulent if and only if:For i <= k < j, A[k] > A[k+1] when k is odd, and A[k] < A[k+1] when k is even; OR, for i <= k < j, ...

2019-01-20 12:04:26 277

原创 辗转相除法解析

辗转相除法基于如下原理:两个整数的最大公约数等于其中较小的数和两数的相除余数的最大公约数。 to complete

2019-01-19 10:14:29 464

原创 英语流利说20190118

Protein mania: the rich world's new diet obsessionmania, 狂热,热衷,狂爱obsession, 执念,着魔,萦绕Are you getting enough protein? The question provides its own answer: if you are worrying about the amount of...

2019-01-18 23:50:15 631

原创 朝花夕拾--C++再学习

一,寻址通过变量名 通过内存地址取地址运算符&,用来获得变量的地址.void getAddress() { int var; cout<<"var address is: "<<&var<<endl;}输出结果是:var address is: 0x7ffcf4dd4e14为何这里是12位的16进制呢,换成2进制就是4...

2019-01-18 14:08:17 322

原创 英语流利说20190117

Japanese billionaire takes over top spot on Twitter after he offers prize money for retweetsWhat gets Twitter users more excited than a year's supply of Wendy's chicken nuggets? Apparently cold, ha...

2019-01-18 00:05:48 380

原创 一张图道尽C语言指针秘密

指向对象的指针,指向数据成员的指针,指向成员函数的指针; 数组即指针,数组的指针,指针数组; 指向函数的指针,指向类的成员函数的指针,指针作为函数参数,指针函数; 指针的指针,指向数组的指针;常指针,指向常对象的指针; …… what the fuck! 我们不喜欢文字概念,然而图示对人类的理解是友好的,下面一张图总结C语言的指针类型: 转自:https://blog....

2019-01-17 16:59:34 307

原创 2019年计划

一,学习篇(1) 专业技术掌握一套开发语言,上可达前端,下可达底层的几门,经过了解,计划如下精通Java语言 熟练使用C/C++ 会用JavaScript 如有精力,再学习Python(2) 终身学习英语(听说读写,四个维度),小目标雅思6.5 数学(今年的计划是算法,leetcode365计划贯彻执行下去)(3) 兴趣爱好吉他,目标能演奏复杂曲目,能扒谱 Lin...

2019-01-17 08:55:33 217

原创 英语流利说20190116

Why (some) humans are born to have a beer belly?Scientific literature on excess weight and health is expanding along with global waistlines, and yet, it's hard to find a solid, coherent scientific ...

2019-01-16 23:42:28 501

原创 JavaScript我的第n+1次学习

一,数据类型五种原始类型:number,string, 对应的包装类Stringboolean,null,undefined,对象类型:Function, Array, Date。。。相等 vs 严格相等typeof  vs instanceof vs Object.prototype.toStringtypeof,适合基本类型及function...

2019-01-15 23:23:19 3265 10

原创 Node.js学习笔记

参考自菜鸟教程http://www.runoob.com/nodejs/nodejs-tutorial.html

2019-01-15 17:41:52 223

原创 安卓MVVM初体验

Todooooooooooooooooo

2019-01-15 13:58:39 341

原创 英语流利说20190109

No progress towards ending U.S. shutdown in Trump meeting with lawmakersNo agreement came out of a meeting between U.S. congressional leaders and President Donald Trump on Wednesday /// to end a pa...

2019-01-14 23:47:07 292

原创 Leetcode 976. Largest Perimeter Triangle

Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, formed from 3 of these lengths.If it is impossible to form any triangle of non-zero area, return...

2019-01-13 12:17:53 263

原创 Leetcode 973. K Closest Points to Origin

We have a list of points on the plane.  Find the K closest points to the origin (0, 0).(Here, the distance between two points on a plane is the Euclidean distance.)You may return the answer in an...

2019-01-13 12:16:59 312

原创 设计模式之创建型(2)——工厂模式

工厂模式的三种变种:简单工厂模式(也称静态工厂模式),工厂方法模式,抽象工厂模式一,静态工厂模式定义:通过专门定义一个工厂类负责创建其他类的实例,被创建的实例具有共同的父类。三种角色:工厂角色(SimpleFactory),负责创建所有类的内部逻辑。 抽象产品角色(IProduct),工厂角色所创建的所有对象的父类,这里所说的父类可以时接口也可以是抽象类,它负责描述所有实例所共有...

2019-01-12 19:33:33 188

原创 设计模式之创建型(1)——单例模式

定义:保证一个类仅有一个实例,并提供一个访问它的全局访问点。三种写法:(1)懒汉式public class SingletonLazy { private static SingletonLazy instance = null; private SingletonLazy () {} public static SingletonLazy getInsta...

2019-01-12 17:58:15 132

原创 面向对象设计六大原则

一,单一职责原则二,开放封闭原则定义:对扩展开发,对修改关闭。既软件实体应在不修改原有代码的情况下进行扩展。实现:抽象化。典型案例:用一个抽象类代替switch...case三,里氏替换原则定义:子类型必须能够替换它们的基类型。 四,依赖倒置原则定义:要依赖于抽象,不要依赖于具体。客户端依赖于抽象耦合。特点:针对接口编程,不针对实现编程。好处:...

2019-01-12 16:25:27 207

原创 Android Framework 之Activity启动流程

图一 从Activity到AMS​​​​​图二 从AMS到Activity图三 分层关系  

2019-01-11 19:05:19 216

原创 Android平台架构Overview

大体上分五层,自上而下依次是:(1)系统APP,就是一个设备的预装软件,提供一些最必要的/最基本的功能.(2)Java API框架,是安卓官方提供的为上层的应用层提供支持的Java类库,主要有四大组件和一些服务类,以及他们的管理类.使用这些API可以使用 Android OS 的整个功能集.(3)C/C++ 库 & Android Runtime,核心 Android 系统组件...

2019-01-11 19:00:06 276

原创 (装逼神器)vim命令教程

 1.1 移动光标奇葩,既然有上下左右键,干嘛弄个 kjhl 出来?而且效果跟上下左右键无差别 Lesson 1.1:  MOVING THE CURSOR   ** To move the cursor, press the h,j,k,l keys as indicated. **             ^             k              Hin...

2019-01-10 13:16:10 1083

原创 525. 连续数组

https://leetcode-cn.com/problems/contiguous-array/ 给定一个二进制数组, 找到含有相同数量的 0 和 1 的最长连续子数组(的长度)。 示例 1:输入: [0,1]输出: 2说明: [0, 1] 是具有相同数量0和1的最长连续子数组。示例 2:输入: [0,1,0]输出: 2说明: [0, 1] (或 [1, ...

2019-01-10 00:51:13 241

原创 英语流利说20190107

Dog influencers are so popular, they need their own talent agencyIt's almost noon, and Loni Edwards's client is drooling on the carpet in the lobby.Edwards is the founder and CEO of The Dog Agency...

2019-01-08 00:26:59 350

原创 Leetcode 829. Consecutive Numbers Sum

Given a positive integer N, how many ways can we write it as a sum of consecutive positive integers?Example 1:Input: 5Output: 2Explanation: 5 = 5 = 2 + 3Example 2:Input: 9Output: 3Expla...

2019-01-07 01:44:11 261

原创 Leetcode 791. Custom Sort String

S and T are strings composed of lowercase letters. In S, no letter occurs more than once.S was sorted in some custom order previously. We want to permute the characters of T so that they match the ...

2019-01-07 00:37:36 123

原创 复盘2018,展望2019(上)

写这篇博客时2018年已经过完4天了,时间真的是稍纵即逝,尤其是过了25岁以后,感觉时间过得尤其快。2018年年底,我已经步入30岁,就是所谓的而立之年,然而我离“而立”还差太远。现在每天心里面慌的一比,虽然一直都在努力让自己进步,但结果并不那么理想,所有的努力都没有让我的生活有什么变化,我在苦苦寻找答案,或许是自己太笨,或许是那些所谓的努力都只是自我安慰而已,也或许方法没有找对。我想我应该深刻剖...

2019-01-05 01:50:45 707 7

科目四容易忽视的知识点总结

科目四易忽视的知识点总结,包括常见标线、标识、安全文明驾驶等易错点,祝每个人都考100分,祝每个人顺利拿本。

2020-09-23

MyEclipse的基本使用

对于javaee的初学者,你不妨先从最基础的开始,“工欲善其事必先利其器”

2013-07-08

android开发

经典入门书籍,与实际应用开发相结合,以情景分析的方式有针对性地对android的源码进行详细的剖析,深刻揭示了android系统的工作原理。

2013-03-30

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

TA关注的人

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