码迷,mamicode.com
首页 > 其他好文
不要创建非必要对象
原文地址:http://leihuang.net/2014/11/10/avoid-creating-unnecessary-objects/ 首先我们来看下面两个语句的区别: String s = new String("hello world!") ; String s = "hello world!" ; 当你循环调用上面两个语句的时候,你会发现:第一条语...
分类:其他好文   时间:2014-11-14 17:52:55    阅读次数:143
禁止使用finalize方法
原文地址:http://leihuang.net/2014/11/13/Avoid-Finalizers/ Don´t use Finalizers, mainly because are unpredictable and we don´t know when will be executed, "don't try to be smarter than the JVM" ...
分类:其他好文   时间:2014-11-14 17:51:48    阅读次数:328
POJ 3616 Milking Time 动态规划
http://poj.org/problem?id=3616 题意:一个奶牛在0~N时间段内可被取奶,每次挤奶以后必须休息至少R分钟才能下次继续挤奶。有M次可以挤奶的时间段,每次取奶对应三个值:开始时间、结束时间、效率值,每次挤奶的过程不能中断。求出最大效率值。 解法:首先按照结束时间从小到大排序(按照结束时间排序方便后边的dp);dp[i]表示第i个挤奶时间段后,效率最大值。 转移...
分类:其他好文   时间:2014-11-14 17:51:59    阅读次数:155
层的缓冲运动
缓冲运动 #divMove { width: 100px; height: 100px; posit...
分类:其他好文   时间:2014-11-14 17:52:27    阅读次数:155
POJ 2229 Sumsets (递推&整数划分变形)
http://poj.org/problem?id=2229 思路:假设加数按从小到大的顺序。当n为奇数时,第一个数必须为1,此时f(n)=f(n-1);当n为偶数时,分两种情况讨论,若第一个数为1,则f(n)=f(n-1),若第一个数不为奇数,则所有数都不为奇数,提出一个公因子2出来,就是f(n/2),所以,f(n)=f(n-1)+f(n/2) 完整代码: /*63...
分类:其他好文   时间:2014-11-14 17:50:27    阅读次数:275
[LeetCode]Partition List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of...
分类:其他好文   时间:2014-11-14 17:50:06    阅读次数:137
IE8下div中2个按钮只显示一个
IE下div中2个按钮只显示一个...
分类:其他好文   时间:2014-11-14 17:49:16    阅读次数:160
DM8168 DVRRDK软件框架研究
DM8168 DVRRDK软件框架研究...
分类:其他好文   时间:2014-11-14 17:50:45    阅读次数:387
POJ 3176 Cow Bowling (简单DP)
Cow Bowling http://poj.org/problem?id=3176 Time Limit: 1000MS Memory Limit: 65536K Description The cows don't use actual bowling balls when they go bowling. They each ta...
分类:其他好文   时间:2014-11-14 17:50:52    阅读次数:224
Invalid Subledger (XLA) Packages In Release 12.1.3
In this Document   Goal   Solution   1.- Information about These Packages   2.- Solution   References APPLIES TO: Orac...
分类:其他好文   时间:2014-11-14 17:48:12    阅读次数:201
图片剪裁控件——ClipImageView
图片剪裁控件,轻松实现对图片的剪裁...
分类:其他好文   时间:2014-11-14 17:46:44    阅读次数:172
UVA991 - Safe Salutations(catalan数)
UVA991 - Safe Salutations(catalan数) 题目大意:一个圆上有n对点,要求这些点两两相连但是形成的直线又不相交。求这样的组合方案数。 解题思路:一开始不知道要怎么做,但是发现了样例的数据有点像catalen的前几项,后面看了别人的题解发现也是catalan数。做法:选一个点,与任意一个点相连,那么这条直线就将这个圆上的点分成了两部分。但是分成两个部分也是有...
分类:其他好文   时间:2014-11-14 17:47:51    阅读次数:149
游标的使用
定义游标: cursor calenderStatus_cur is select * from ut_calenderStatus ; vr_calenderStatus ut_calenderStatus % rowtype; 打开游标,提取游标中的数据到游标行中: open calenderStatus_cur; ...
分类:其他好文   时间:2014-11-14 17:46:57    阅读次数:147
前端编程提高之旅(十二)----position置入值应用
这次内推项目用到的遮罩及其页面下方按钮都涉及一个概念position置入值得概念。效果图如下:                一个元素position属性不是默认值static,那么该元素被称为定位元素。定位的元素生成定位框,其定位基于四个特性(置入值):'top','right','bottom','left'。           现在的问题在于当置入值在声明与...
分类:其他好文   时间:2014-11-14 17:47:08    阅读次数:258
POJ 2739 Sum of Consecutive Prime Numbers(素数)
POJ 2739 Sum of Consecutive Prime Numbers(素数)...
分类:其他好文   时间:2014-11-14 17:45:15    阅读次数:160
HDU 1358 Period(kmp)
next数组的应用 #include #include #include #include #include #include #include #include #define L(x) (x<<1) #define R(x) (x<>1) #define eps 1e-8 using namespace std; #de...
分类:其他好文   时间:2014-11-14 17:46:33    阅读次数:199
【权值分块】bzoj3685 普通van Emde Boas树
权值分块,虽然渐进复杂度不忍直视,但其极小的常数使得实际运行起来比平衡树快,大多数情况和递归版权值线段树差不多,有时甚至更快。但是被zkw线段树完虐。 1 #include 2 #include 3 #include 4 using namespace std; 5 #define N 100000...
分类:其他好文   时间:2014-11-14 17:41:35    阅读次数:241
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!