引言: 之前一篇文章梳理了String的不变性原则,还提到了一段源码中注释"avoid getfield opcode",当时通过查阅资料发现,这是为了防止 getfield(获取指定类的实例域,并将其值压入到栈顶)这个操作码的执行,这篇文章想从字节码的角度去分析一下. 先看一段代码吧 /** * Created by chenqimiao on 16/11/29. */ public class Main { public char[] chars = new char[10]; p…
原文链接:http://www.huffingtonpost.com/syed-balkhi/10-biggest-business-mista_b_7626978.html When I started my first business, I made a lot of mistakes (everyone does). While mistakes are unavoidable, you can use the lessons learned by others to prevent t…
在android开发中,写了一个关于继承Fragment的类时,如果有重载构造函数时,会提示“Avoid non-default constructors in fragments: use a default constructor plus Fragment#setArguments(Bundle) instead”的错误, 这时.在类的前面加上@SuppressLint("ValidFragment")即可.…
Avoid The Lakes Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8173 Accepted: 4270 Description Farmer John's farm was flooded in the most recent storm, a fact only aggravated by the information that his cows are deathly afraid of wate…
com.mysql.jdbc.CommunicationsException: The last packet successfully received from the server was58129 seconds ago.The last packet sent successfully to the server was 58129 seconds ago, which is longer than the server configured value of 'wait_timeou…
11 Clever Methods of Overfitting and how to avoid them Overfitting is the bane of Data Science in the age of Big Data. John Langford reviews "clever" methods of overfitting, including traditional, parameter tweak, brittle measures, bad statistic…
use sentinel to avoid boudary testing, use swap trick to avoid extra copy. original version #include <cstdio> #include <algorithm> int main() { //freopen("input.txt","r",stdin); const int MAXSIZE=22, dimSize=20; int bacnums…
Database Design Rule Description Value Source Problem Description 1 Excessive sorting and RID lookup operations should be reduced with covered indexes. Sys.dm_exec_sql_text Sys.dm_exec_cached_plans Large data warehouse can benefit from more index…
Database Design Rule Description Value Source Problem Description 1 High Frequency queries having a high number of table joins. >4 Sys.dm_exec_sql_text Sys.dm_exec_cached_plans High frequency queries with lots of joins can be too normalized for h…
Principle Strings are poor substitutes for other value types. Such as int, float or BigInteger. Strings are poor substitutes for enum types. As discussed in Item 30. Strings are poor substitutes for aggregate types. A better approach is simply to wri…