常量对象与常量成员函数来防止修改对象,实现最低权限原则。可以用关键字const来指定对象是不可修改的,任何修改该对象的企图,都会导致编译错误。例如:constTimenoon(12,0,0);声明一个Time类的常量对象noon,并将它初始化为中午12点。C++不允许在常量对象上调用成员函数,除非成...
分类:
其他好文 时间:
2014-05-22 06:39:25
阅读次数:
229
class Solution {public: int maxProfit(vector
&prices) { int len = prices.size(); if (len maxv) { maxv = cur; ...
分类:
其他好文 时间:
2014-05-22 05:09:49
阅读次数:
256
常用快捷键:Debug:F8 Stop debugger:Shift + F8 Toggle
breakpoint:F5 Next line:F7 Step into:Shift + F7 Step out:Ctrl + F7Run to C...
分类:
其他好文 时间:
2014-05-22 03:29:01
阅读次数:
381
Definitions:?StressTests the server –Peak volume
over a short span of time?LoadTests the database –Largest load the database can
handle at one time?Vo...
分类:
其他好文 时间:
2014-05-22 01:29:01
阅读次数:
338
题目:We all know that Bin-Laden is a notorious
terrorist, and he has disappeared for a long time. But recently, it is reported
that he hides in Hang Zho...
分类:
其他好文 时间:
2014-05-22 01:09:55
阅读次数:
328
=> build/tools/zipalign:
out/host/linux-x86/bin/zipalign (host)=> build/tools/atree:
out/host/linux-x86/bin/atree (host)=> build/tools:=> build/to...
分类:
移动开发 时间:
2014-05-22 00:26:32
阅读次数:
2792
先来看一段代码: public static void main(String[] args) {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
System.out.println("阳光小强");
}
}, 5000);
int i = 0;
wh...
分类:
移动开发 时间:
2014-05-21 16:56:51
阅读次数:
296
public class setZero {
static void print(int [][]a){
for(int i=0;i<a.length;i++){
for(int j=0;j<a[i].length;j++){
System.out.print(a[i][j]+" ");
}
System.out.println();
}
}
/*stati...
分类:
其他好文 时间:
2014-05-21 16:16:56
阅读次数:
252
【原题】
2506: calc
Time Limit: 10 Sec Memory Limit: 256 MB
Submit: 228 Solved: 112
Description
给一个长度为n的非负整数序列A1,A2,…,An。现有m个询问,每次询问给出l,r,p,k,问满足l
Input
第一行两个正整...
分类:
其他好文 时间:
2014-05-21 10:38:18
阅读次数:
267
在项目开发中,使用SQLite一不小心就会碰到各种DB异常,网上搜了下没有这方面的资料,写出来记录下。异常信息:android.database.sqlite.SQLiteMisuseException:
library routine called out of sequence: , while...
分类:
数据库 时间:
2014-05-21 03:12:20
阅读次数:
1023