Algorithms: https://leetcode-cn.com/problems/repeated-substring-pattern/ 重复子字符串 Review: “I’m Leaving Google — and Here’s the Real Deal Behind Google Cloud” by Amir Hermelin https://link.medium.com/mPXXS8aBWX Tips: android : init.rc Android初始化语言包含了四…
Algorithms: https://leetcode-cn.com/problems/longest-continuous-increasing-subsequence/ 最长连续子序列. Review: “Learn to code (or do anything): top down, bottom up and other approaches” by Austin Tindle https://link.medium.com/MVvduEYGSY Tips: android lo…
Algorithms: https://leetcode-cn.com/problems/next-greater-node-in-linked-list/ 链表中下一个更大的值,双层循环及优化,后面看可以栈处理,学习了 Review: “Can You Avoid Functional Programming as a Policy?” by Eric Elliott https://link.medium.com/oWci9jdLjY Tips: android : Andorid li…
Algorithms: https://leetcode-cn.com/problems/longest-common-prefix/ Review: https://link.medium.com/NUjceV9oJX The Art of Computer Programming’ by Donald Knuth Tips: c++11 : 1.c++先高一段落,下面补习下android 和java吧,先偷懒一次. Share: 分享下review的文章小结 1.主要讲解了作者对计算机编程艺…
本周review的文章是:https://medium.com/@hakibenita/optimizing-django-admin-paginator-53c4eb6bfca3 改篇文章的题目是:Optimizing Django Admin Paginator,How we finally made Django admin fast for large tables. django分页的时候,大部分时间都会消耗在求count上,本篇文章提到了几点用于提升大表分页的方法: 1.重写默认的分…
现在有这样一种常见,系统中有一个接口,该接口执行的方法忽快忽慢,因此你需要去统计改方法的执行时间.刚开始你的代码可能如下: long start = System.currentTimeMillis(); somemethod(); long end = System.currentTimeMillis(); System.out.println(end-start); 这个方式能够打印方法执行的时间,可是疑问来了,如果系统中很多方法都需要计算时间,都需要重复这样的代码?这个时候,你可以考虑注解…
通常在开发具体项目过程中我们可能会面临如下问题: 统一所有的json返回结果 统一处理所有controller中的异常,并且给不同异常不同的返回状态值 统一对返回的接口做数据校验或者加密,防止篡改 在spring中的处理方式是使用@RestControllerAdvice注解.下面是一个例子,可以将所有的controller中的返回结果,包装成一个CommonResponse. @RestControllerAdvice public class CommonResponseDataAdvice…
7. Reverse Integer import math class Solution: def reverse(self, x: int) -> int: ret = 0 if x >=0: x_str = str(x) ret = int(x_str[::-1]) else: x =abs(x) x_str=str(x) ret = -1*int(x_str[::-1]) if ret>=math.pow(2,31)-1 or ret<=-1*math.pow(2,31):…
Algorithms: https://leetcode-cn.com/problems/single-number/submissions/ Review: “What Makes a Good Developer?” by Jonathan Bluks https://link.medium.com/O0CfiH0QfZ Tips: android handler. 主线程不做处理复杂的问题,创建hanlder发消息到主线程,主线程loop 从messagequeue取消息进行处理. Sha…
Algorithms: https://leetcode-cn.com/problems/balanced-binary-tree/ 平衡二叉树. Review: “What I Learned in My First Two Years as a Software Engineer” by Mitchell Irvin https://link.medium.com/KoBoQlF0GY Tips: PCM/ADPCM : PCM的基本参数是采样频率和采样位深,采样频率就是每秒采样多少次,…
Algorithms: https://leetcode-cn.com/problems/merge-two-sorted-lists/submissions/ 合并两个链表 Review: “Putting comments in code: the good, the bad, and the ugly.” by Bill Sourour https://link.medium.com/XB5EPBBa8X Tips: android : Andorid P 新增的registerAudi…