自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(41)
  • 问答 (1)
  • 收藏
  • 关注

原创 Docker Harbor 安装

docker harbor

2022-06-18 12:04:25 984 1

原创 190.颠倒二进制位 && 191. 位1的个数

public int reverseBits(int n) { int r = 0; for(int i = 0;i < 32 && n != 0;i++){ r= r<<1; r = r|(n&1); n = n>>1; } return r; }public int hammingWeight(int n) { int r = 0...

2021-10-10 22:36:13 132

原创 idea 链接github 无法成功登陆, SpringCloud Config 分布式配置中心配置

Server前面加上https:// 前缀uri要写成链接地址 ,写成[[email protected]:godbar/hello-world.git] 不知道为啥总是报错,Auth fail

2020-07-12 11:42:27 775

原创 (2)Android插件化编程思想

本篇博客是学习《Android插件化开发指南》的一个总结1. 插件化的优势a> 快速修复应用中的bug,不需要重新发版本b> 快速响应需求,能够将应用业务的变化动态的发布给用户其实以上的两个优点也可以总结成一个,就是用户重新不要重新下载安装APK,就可以更新APK的功能。2. 插件化编程需要了解和掌握的知识 a>对Android的框架知识需要有一定的了...

2019-08-30 22:05:00 255

转载 (1)Android动态权限申请

Android权限的申请有两种方式,静态获取和动态获取。静态获取:是在APP安装的时候一次性获取App所需要的所有权限,用户不清楚在什么情况下需要哪些权限动态获取:只有在使用的使用才去获取权限,由用户决定是否授予,用户能够清楚的知道app在哪些场景下申请的了什么权限Android权限的申请由静态方法变到动态方式,体现了Google在手机安全机制上的努力。androd中有各种各样的权...

2019-08-26 23:36:41 484

原创 通过Launcher启动应用的过程分析

通过Launcher启动应用的过程分析通过Lanucher启动 应用时会调用Lanucher的onClick方法。 Lanucher.java /** * Launches the intent referred by the clicked shortcut. * * @param v The view representing the c...

2019-01-29 00:12:54 1128

原创 ActivityManagerService 构造方法分析

                    ActivityManagerService 构造方法分析参考:https://blog.csdn.net/u013122625/article/details/53433064本文主要分析ActivityManagerService的构造方法中所做的事情,先看代码。// Note: This method is invoked on the ...

2019-01-27 22:51:42 309

原创 Handler Messenger 使用

                            Handler Messenger 使用Android中如果所有的线程都可以更新UI那么会造成同步问题,因为UI的访问不是同步的,所以如果所有的线程都更新UI就会造成数据混乱,不为UI加锁进行同步的原因是这样会造成性能问题,所有的线程都想更新UI,造成大量的线程等待,影响性能。所以在android中只允许主线程更新UI,并且主线程也最好应...

2019-01-20 11:31:48 633

翻译 Android Studio 工程目录下各个文件的作用

                        Android Studio 工程目录下各个文件的作用不创造知识,我只是知识的搬运工。本篇文章照抄https://developer.android.com/studio/build/#build-config,建议直接点击链接下面的工程目录示意图1. settings.gradle文件位于项目根目录,用于指示Gradle在构建应用时...

2019-01-12 21:48:13 5033

原创 32. Longest Valid Parentheses

Longest Valid ParenthesesGiven a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parenthe

2017-02-20 21:15:55 430

原创 leetcode31. Next Permutation

Next Permutation参考:https://yq.aliyun.com/articles/863Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement i

2017-02-15 16:45:39 345

转载 leetcode30:Substring with Concatenation of All Words

Substring with Concatenation of All Words转载:www.cnblogs.com/zihaowang/p/4507979.htmlYou are given a string, s, and a list of words,words, that are all of the same length. Find all starti

2017-02-13 14:04:28 394

转载 Java语言中的位运算及总结

Java语言中的位运算及总结 转载:http://blog.csdn.net/ujswml/article/details/5642991二进制运算符  由于计算机内部的数据都以二进制的形式存在,所以在Java语言中提供了直接操作二进制的运算符,这就是下面要讲解的位运算符和移位运算符。  使用二进制的运算符,可以直接在二进制的基础上对数字进行操作,执行的效率比一般的

2017-01-18 17:28:18 472

原创 leetcode29:Divide Two Integers

Divide Two Integers Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.package leetcode;public class leet29 { public static

2017-01-18 16:12:40 412

原创 leetcode28: Implement strStr()

Implement strStrImplement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.对haystack进行遍历,比较当前下标下,长度为needle.length()长的字符串是否与

2017-01-11 17:08:29 435

原创 设计模式:单例模式

单例模式参考:百度百科      单例模式是一种常用的软件设计模式。在它的核心结构中只包含一个被称为单例的特殊类。通过单例模式可以保证系统中一个类只有一个实例     对于系统中的某些类来说,只有一个实例很重要,例如,一个系统中可以存在多个打印任务,但是只能有一个正在工作的任务;一个系统只能有一个窗口管理器或文件系统;一个系统只能有一个计时工具或ID(序号)生成器。如在Wi

2017-01-10 17:05:50 353

原创 leetcode27:Remove Element

Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with cons

2017-01-08 10:34:16 284

原创 leetcode26:Remove Duplicates from Sorted Array

Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate extra space for another

2017-01-08 09:36:48 272

原创 leetcode25: Reverse Nodes in k-Group

Reverse Nodes in k-Group Given a linked list, reverse the nodes of a linked listk at a time and return its modified list.k is a positive integer and is less than or equal to the length of the li

2017-01-07 20:33:01 334

原创 leetcode24:Swap Nodes in Pairs

Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use on

2017-01-04 09:33:55 322

原创 leetcode23:Merge k Sorted Lists

Merge k Sorted Lists  参考:http://www.cnblogs.com/TenosDoIt/p/3673188.htmlMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.解一:因为前面有一道题是两条

2016-12-30 08:41:38 618

原创 leetcode22:Generate Parentheses

Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))", "(()(

2016-12-27 20:51:58 338

原创 leetcode21:Merge Two Sorted Lists

Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.两个单链表的合并package leetcode;

2016-12-23 21:05:18 359

原创 leetcode20:Valid Parentheses

Valid ParenthesesGiven a string containing just the characters '(', ')', '{', '}', '[' and']', determine if the input string is valid.The brackets must close in the correct order, "()" and "

2016-12-22 21:58:04 425

原创 leetcode19:Remove Nth Node From End of List

Remove Nth Node From End of ListGiven a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing

2016-12-15 09:04:19 300

原创 leetcode18:4Sum

18. 4SumGiven an array S of n integers, are there elementsa, b, c, and d in S such that a +b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:

2016-12-10 21:00:03 279

原创 leetcode17:Letter Combinations of a Phone Number

Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone butto

2016-12-07 08:06:08 414

原创 leetcode16:3Sum Closest

3Sum Closest Given an array S of n integers, find three integers inS such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input wo

2016-12-02 20:15:04 367

转载 openflow协议各版本下载(1.0/1.1/1.2/1.3/1.4/1.5)

openflow协议各版本下载(1.0/1.1/1.2/1.3/1.4/1.5)本文包括以下版本的Openflow协议的在线浏览和下载:(英文) Openflow 1.00, 1.10, 1.2, 1.3, 1.31, 1.4, 1.5(中文) Openflow 1.00, 1.3(概要部分)(英文)2009.12.31 OpenFlow® Switch Specifi

2016-12-01 15:45:37 3586

原创 leetcode14:Longest Common Prefix

leetcode14:Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings.循环的判断数组中每一个字符串在相同的下标是否有相同的值(当然还要加入相应的判断匹配终止的条件),这样遍可以找出最长的公共前缀package lee

2016-12-01 11:18:04 335

原创 leetcode15:3Sum

3Sum我觉得做算法题,一般在不能一下子给出最终的解得时候,应该循序渐进的结局问题,先给出一个近似正确的答案,并进行不断地修正,一步一步的逼近最终得答案,就向这道题一样,可以先实现有重复解得程序,再在这个程序的基础上实现无重复的解。package leetcode;import java.util.ArrayList;import java.util.Iterator;impo

2016-12-01 11:14:47 592

原创 《java多线程编程核心技术》读书笔记6:线程中的异常处理

第七章:拾遗增补SimpleDateFormat这个类主要负责日期的转换与格式化,但是在多线程中,使用此类容易造成数据转换及处理的不准确,因为SimpleDateFormat类并不是线程安全的。在多线程的环境下如果每一个线程都使用相同的SimpleDateFormat对象:SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd

2016-09-29 15:48:45 577

原创 readResolve方法

在Java中,序列化可以用于对象的深克隆,此时克隆出来的对象和原来的对象不是同一个对象,但是有时需要用到单例模式,但是反序列化并不满足,所以Java提供了readResolve方法,来保证反序列化以后的对象和原对象是同一个对象。protected Object readResolve(){       return .....}

2016-09-27 14:43:50 1175 1

原创 DCL双检查机制

DCL双检查锁机制双检查锁就是在同步代码块调用之前检查一遍,载再在同步代码块内部再检查一遍。双重保险public class ServiceA { private volatile static ServiceA service; private ServiceA(){ } public static ServiceA getInstance(){ try{

2016-09-27 11:17:45 1883 1

原创 《java多线程编程核心技术》读书笔记5:定时器Timer类的使用

第5章:定时器Timer在JDK库中,Timer类主要负责计划任务的功能,也就是在指定的时间开始执行某一任务,Timer类的主要任务就是设置计划任务,但封装任务 的类是TimerTask,执行计划任务的代码要放到TimerTask的子类中,因为TimerTask是一个抽象类。Timer类的主要方法就是各种重载的schedule方法schedule(TimerTask task,

2016-09-26 19:02:16 641

原创 《java多线程编程核心技术》读书笔记4:Lock的使用

第四章:Lock的使用在Java中,除了通过synchronized关键字进行同步处理意外,Java还提供了另外的方法进行同步,这就是Lock这个类;      Lock lock = new ReentrantLock();      lock.lock()方法获得对象锁,lock.unlock()方法释放对象锁。相对于synchronized关键字这个lockz比较

2016-09-19 15:36:28 756

原创 《java多线程编程核心技术》读书笔记3:线程间的通信

第三章:线程间的通信 Wait()方法:线程放弃锁,进入等待状态;Notify()方法:唤起任意一个等待的线程,只唤起一个,而且是随机的。NotifyAll()方法:唤起所有等待的线程,这些线程,争抢(锁)运行的权利;当调用notify()方法时,当前正在执行的线程并不会马上释放锁,而是要等带当前的同步代码块执行完毕才释放持有的锁。 当线程程wait方法状态的时候,调用in

2016-09-11 16:52:04 493

原创 《java多线程编程核心技术》读书笔记2.2:volatile关键词

第二章 对象及变量的并发访问在我们讲解volatile这个关键词时,我们首先要,了解一下变量在内存中工作的过程:java程序在运行的过程当中有主内存和线程内存之分:程序在启动的时候会将所有的变量加载到主内存当中,线程在运行时有一下工作要做:read和load阶段:线程从主存复制变量到当前线程工作内存use和asign阶段:执行代码,改变共享变量的值;store和writ

2016-09-11 16:04:19 626

原创 《java多线程编程核心技术》读书笔记2.1

第二章 对象及变量的并发访问本节主要总结了一些synchronized的使用方法:在java中:“非线程安全”的问题存在于“实例变量”中,如果是方法内部的私有变量,则不存在“非线程安全“的问题。synchronized加在方法的前部:       synchronized取得的锁都是对象锁,而不是把一段代码或方法当作锁,在线程的执行过程当中,哪个线程先执行了带syn

2016-09-03 10:18:22 1102

原创 《java多线程编程核心技术》读书笔记1

第一章:java多线程技能在学习线程之前我们首先要清楚一下进程的概念:           进程是操作系统结构的基础,是系统进行资源分配的和调度的独立单位。windows上一个运行的word,一个浏览器程序就称之为一个进程。线程:线程是进程的一部分,一个进程由一个或多个线程组成,线程可以理解为进程中独立运行的子任务,如QQ在运行时就有很多子任务同时运行,再如,好

2016-09-03 08:15:04 1207

空空如也

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

TA关注的人

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