2018计划
1. 加强锻炼,减轻体重
在新的一年里,这是最重要的
2. 持续写博客
锻炼自己的写作能力
3. 加强英文阅读能力
不会英文阅读能力的程序员不是好程序员,不会走很远的
有时候在移动端服务器侧开发的时候,某些接口的性能得不到优化,可以看看是不是该接口做了太多的事情,提取了太多的数据,看看能否将这一个接口做的事情拆分为几个接口来做。
有时候我们总想着一个接口提供大而全的数据供前端使用,但是却没有去想提供的数据是不是会马上就用到,如果提供的部分数据永远不会被用到或者是很小概率会用到,那么我们为什么还需要在这个接口里面返回,是不是可以考虑延迟加载。
移动APP的位置有限,所以都十分重要,越浅的层级就需要越快的加载速度,越高的并发性能,所以首页等页面一定要做到非常轻量。
Given 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 constant memory.
The order of elements can be changed. It doesn’t matter what you leave beyond the new length.
1 | Given input array nums = [3,2,2,3], val = 3 |
We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11).
Now given a string represented by several bits. Return whether the last character must be a one-bit character or not. The given string will always end with a zero.
1 | Input: |
zookeeper是非常著名的分布式开源软件,在选主、配置管理、分布式锁等应用方面表现出色。那么在php环境下如何使用zookeeper呢?
zookeeper源码版本 | zookeeper扩展版本 |
---|---|
3.4.10 | 0.4.0 |
首先需要下载zookeeper的源码进行编译安装,源码下载地址为为zookeeper源码
1 | # tar -xzf zookeeper-3.4.10.tar.gz |