自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4571)
  • 收藏
  • 关注

转载 nginx 负载策略

1、轮询(weight=1)默认选项,当weight不指定时,各服务器weight相同,每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器down掉,能自动剔除。upstream bakend {server 192.168.1.10;server 192.168.1.11;}2、weight指定轮询几率,weight和访问比率成正比,用于后端服务器性能不均的情况...

2019-09-26 15:05:00 3013

转载 AQS源码解析(1)-CLH

目录 AQS解析 一、简介 二、同步的状态和基本属性 三、入队 addWaiter 3.1 基本步骤介绍 3.2 addWaiter() 3.3 enq(Node node) 四、出队 参考...

2019-09-23 22:02:00 3050

转载 迭代设计-引发的不兼容问题

  在软件工程领域,流行瀑布模型或者演化模型,其他的模型参考博文:https://www.cnblogs.com/kzang/archive/2012/07/06/2578835.html,我们项目组应该使用的是增量模型,在我进入项目组,大体功能都已完备,个版本都是在一些小的改动,也可以说是小步迭代把,但是新的方案设计和原有设计往往会出现冲突,这大概是因为方案设计者也不能对每个细节都十分...

2019-09-22 15:03:00 3072

转载 重构-在实践中理解

  在老大的推荐下买了Martin Fowler的<Refactoring improving the design of existing code>,其实这本书就是作者重构的经验之谈,随便翻一下,尽管你看的多么仔细,如果你没有在实践中感受到它或者应用到它,其实你很难在需要的时候用上。  昨天服务上线的时候,老大就给我上了一课,首先是一个同事定位到我的一个查询接口超时,...

2019-09-22 11:51:00 214

转载 CopyOnWriteArrayList源码解析

目录 一、简介 二、继承体系 三、重要属性 四、重要方法解析 4.1 构造函数 4.2 eq方法 4.2 set方法 4.3 add方法 4.4 add(int,E)方法 4.5 addIfA...

2019-09-20 20:36:00 120

转载 Tomcat安装部署

Tomcat简介官网:http://tomcat.apache.org/Tomcat服务器是一个免费的开源代码的Web应用服务器,属于轻量级应用服务器,在中小型系统和并发访问用户不是很多的场合下使用,是开发和调试JSP程序的首选。Tomcat和Nginx、Apache等Web服务器一样,具有处理HTML页面的功能,另外它还...

2019-09-20 18:46:00 267

转载 C++返回值的引用与非引用

转自:https://blog.csdn.net/qq_22660775/article/details/89854545返回引用与返回非引用的区别:返回引用时,函数内部不会构造一个临时变量,而是直接将返回值返回出去。而当为非引用时,会构造一个临时变量(但不一定),然后返回这个匿名的临时变量。举例:class B {public: B(){ cout...

2019-09-20 18:14:00 200

转载 leetcode 14. Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string"".Example 1:Input: ["flower","flow","flight"]Ou...

2019-09-20 09:37:00 117

转载 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 ...

2019-09-19 22:36:00 144

转载 leetcode 20. Valid Parentheses

Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same ty...

2019-09-19 22:17:00 121

转载 leetcode 463. Island Perimeter

You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water.Grid cells are connected horizontally/vertically (not diagonally). The grid is compl...

2019-09-19 17:42:00 365

转载 leetcode 695. Max Area of Island

Given a non-empty 2D arraygridof 0's and 1's, anislandis a group of1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are s...

2019-09-19 17:15:00 137

转载 leetcode 12. Integer to Roman

Roman numerals are represented by seven different symbols:I,V,X,L,C,DandM.Symbol ValueI 1V 5X 10L 50C 100D ...

2019-09-19 16:46:00 129

转载 leetcode 47. Permutations II

Given a collection of numbers that might contain duplicates, return all possible unique permutations.Example:Input: [1,1,2]Output:[ [1,1,2], [1,2,1], [2,1,1]]思路 1 clas...

2019-09-19 16:04:00 87

转载 leetcode 77. Combinations

Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.Example:Input:n = 4, k = 2Output:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]...

2019-09-18 17:24:00 88

转载 leetcode 46. Permutations

Given a collection ofdistinctintegers, return all possible permutations.Example:Input: [1,2,3]Output:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]思路一:二话不...

2019-09-18 16:35:00 132

转载 leetcode 31. Next Permutation

Implementnext permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possi...

2019-09-18 16:02:00 78

转载 通过金蝶BOS设计系统寻找对应数据表和字段

今天项目导入物料时,同步到金蝶发生错误,原因是导入的型号字段超出了金蝶BOS设计的长度限制那么我进入BOS将对应的字段长度加长:本来以为这样就解决了,刷新一看,又有新的报错:  将截断字符串或二进制数据。\r\n语句已终止这次是因为数据库的字段长度限制,那么问题来了我并不知道物料的型号字段在数据库哪个表的哪个字段!一番辛苦摸索下,发现可以通过BO...

2019-09-18 11:42:00 614

转载 C++11:移动语义与完美转发

转自https://www.cnblogs.com/jianhui-Ethan/p/4665573.htmlC++11 引入的新特性中,除了并发内存模型和相关设施,这些高帅富之外,最引人入胜且接地气的特性就要属『右值引用』了(rvalue reference)。加入右值引用的动机在于效率:减少不必要的资源拷贝。考虑下面的程序:std::vector<string&g...

2019-09-18 10:09:00 117

转载 leetcode 606. Construct String from Binary Tree

You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way.The null node needs to be represented by empty parenthesis pair "()". And...

2019-09-18 09:10:00 120

转载 vue-axios跨域配置

一、vue安装axios:简介:vue2.0之后,就不再对vue-resource更新,而是推荐使用axios。基于 Promise 的 HTTP 请求客户端,可同时在浏览器和 Node.js 中使用。功能特性1、在浏览器中发送 XMLHttpRequests 请求2、在 node.js 中发送 http请求3、支持 Promise API4、拦截请求和响应5、转换请求和响应...

2019-09-17 22:56:00 330

转载 leetcode 709. To Lower Case

Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.Example 1:Input: "Hello"Output: "hello"Example 2:Input: "here"Outpu...

2019-09-17 21:25:00 119

转载 leetcode 22. Generate Parentheses

Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:[ "((()))", "(()())", "(())()", ...

2019-09-17 21:16:00 69

转载 python2.7 操作ceph-cluster S3对象接口 实现: 上传 下载 查询 删除 顺便使用Docker装个owncloud 实现UI管理...

python version: python2.7需要安装得轮子:botofilechunkiocommand: yum install python-pip&& pip install boto filechunkioceph集群user(ceph-s3) 和 用户access_key,secret_key代码:#_*_codi...

2019-09-17 16:23:00 229

转载 MySQL Too many connections

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections" at sun.reflect.Nativ...

2019-09-17 14:19:00 76

转载 leetcode 349. Intersection of Two Arrays

Given two arrays, write a function to compute their intersection.Example 1:Input: nums1 = [1,2,2,1], nums2 = [2,2]Output: [2]Example 2:Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]O...

2019-09-17 11:00:00 67

转载 leetcode 350. Intersection of Two Arrays II

Given two arrays, write a function to compute their intersection.Example 1:Input: nums1 = [1,2,2,1], nums2 = [2,2]Output: [2,2]Example 2:Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]...

2019-09-17 09:57:00 134

转载 SbWebServer的几个设计

基于生产者消费者模型的线程池设计:数据结构:成员:1.一个队列m_queue.其中存放Task,也就是任务,生产者线程,也就是主线程,往这个队列中push;消费者,也就是工作线程,不停地从其中拿走Task去工作。关于Task,原型为boost::function<void()> Task;2.一个表示线程数量的变量m_threadNum3.一个表示队列...

2019-09-17 00:27:00 90

转载 leetcode 278. First Bad Version

You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based o...

2019-09-16 23:30:00 78

转载 leetcode 34. Find First and Last Position of Element in Sorted Array

Given an array of integersnumssorted in ascending order, find the starting and ending position of a giventargetvalue.Your algorithm's runtime complexity must be in the order ofO(logn).I...

2019-09-16 23:22:00 106

转载 明日复习提纲

1.C++11转载于:https://www.cnblogs.com/lxy-xf/p/11530770.html

2019-09-16 22:43:00 81

转载 leetcode 54. Spiral Matrix

Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.Example 1:Input:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]Output: [1,2,3,6,9,...

2019-09-16 22:30:00 67

转载 vue-cli构建项目中组件的使用

在使用vue-cli脚手架构建项目时,组件的使用步骤大致是:创建组件component,编写模板template,抛出组件给项目export,引入组件import,抛出组件给页面export。一、创建组件  在componets文件夹里创建新的组件文件newVue.vue,注意后缀名为.vue  注意:组件名称不能使用html的自有标签或javascript的关键字,...

2019-09-16 17:38:00 218

转载 leetcode 59. Spiral Matrix II

Given a positive integern, generate a square matrix filled with elements from 1 ton2in spiral order.Example:Input: 3Output:[ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6, 5 ]]思路:一次填充矩...

2019-09-16 17:31:00 81

转载 VUE组件注册

一、注册组件1.Vue.component全局注册//全局注册组件Vue.component('component-a', { /* 模板内容 */ })Vue.component('component-b', { /*模板内容 */ })Vue.component('component-c', { /*模板内容 */ })//创建vue跟实例new Vu...

2019-09-16 17:10:00 84

转载 leetcode 44. Wildcard Matching

Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Matches any sequence of characters (includin...

2019-09-16 16:48:00 140

转载 leetcode 10. Regular Expression Matching(正则表达式匹配)

Given an input string (s) and a pattern (p), implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding elem...

2019-09-16 15:58:00 104

转载 leetcode 174. Dungeon Game (地下城游戏)

The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid. Our valiant knight (K) was initiall...

2019-09-16 09:34:00 105

转载 重读STL源码剖析:hashtable

hashtable:hashtable的设计是一个vector数组,每个数组内为一个链表,链表链着hash到同位置的节点,但链表的实现不是list或slisthashtable的节点设计:1.存储元素值的变量val2.一个指向下一个节点(同一个bucket内的)的指针nexthashtable的迭代器:1.内部维护两个成员:指向当前节点的cur指向所属bu...

2019-09-16 09:25:00 88

转载 重读STL源码剖析:map与set

map与set底层都是调用的RBTree首先看RBTreeRBTree红黑树的特性:1.根节点为黑色2.新增节点一定是红色3.节点只有红色或黑色两种颜色4.两个节点颜色不能同为红5.任意一条路径上的黑色节点个数相同红黑树的节点设计:1.表示节点颜色的变量color2.链接左子树的left指针3.链接右子树的right指针4.链接父节点的...

2019-09-16 08:09:00 81

空空如也

空空如也

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

TA关注的人

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