Algorithm Single Number https://leetcode.com/problems/single number/ 1)problem 2)answer 数组中其他数出现两次,仅有一个出现一次的。逐个字符进行异或来,当某个数字出现第二次时候数字就归为0。二进制计算逻辑如下: 3 ...
分类:
其他好文 时间:
2019-02-10 00:06:28
阅读次数:
154
最终目的:高内聚,低耦合 1) 开放封闭原则 (OCP,Open For Extension, Closed For Modification Principle) 类的改动是通过增加代码进行的,而不是修改源代码。 2) 单一职责原则 (SRP,Single Responsibility Princ ...
分类:
其他好文 时间:
2019-02-09 00:53:47
阅读次数:
193
一,基础预备知识 1,十进制转换为二进制 1.1 整数部分: 连续,除以2,取余数,余数为0或1,53 / 2 = 26R1 26 / 2 = 13R0 13 / 2 = 6R1 6 / 2 = 3 R0 3 / 2 = 1 R1 1/2 = 0R1 ,对应二进制为110101(从右往左) 1.2 ...
分类:
其他好文 时间:
2019-02-07 20:34:44
阅读次数:
434
算法描述: Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one. Note: Y ...
分类:
其他好文 时间:
2019-02-06 13:20:55
阅读次数:
178
描述Single对象: main测试方法: 执行结果: 以上案例 内存图分析: ...
分类:
移动开发 时间:
2019-02-05 09:17:37
阅读次数:
175
#备份数据库:导出全部数据库:--all-databases, -A导出几个数据库。参数后面所有名字参量都被看作数据库名:--databases, -B导出存储过程以及自定义函数:--routines, -R导出事件:--events, -E不缓冲查询,直接导出到标准输出。默认为打开状态,使用--s ...
分类:
数据库 时间:
2019-02-02 13:00:52
阅读次数:
184
Codeforces 1107G 线段树最大子段和 + 单调栈 G. Vasya and Maximum Profit Description: Vasya got really tired of these credits (from problem F) and now wants to ear ...
分类:
其他好文 时间:
2019-02-02 11:11:48
阅读次数:
219
单例模式,是一种常用的软件设计模式。在它的核心结构中只包含一个被称为单例的特殊类。通过单例模式可以保证系统中,应用该模式的一个类只有一个实例。即一个类只有一个对象实例。 在我们平常的开发中,我们需要一些辅助类,比如Redis辅助类,一般把一些初始化的工作放在构造函数中,然后写一些方法来完成Redis ...
分类:
其他好文 时间:
2019-01-31 20:52:42
阅读次数:
240
1、springmvc的自动配置 文档:https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#boot-features-spring-mvc WebMvcAutoConfiguration.java ...
分类:
编程语言 时间:
2019-01-31 00:18:16
阅读次数:
195
Unit test: Specify and test one point of the contract of single method of a class. This should have a very narrow and well defined scope. Complex depe ...
分类:
其他好文 时间:
2019-01-30 14:23:15
阅读次数:
106