字符串:String都是用String来表示,都是值类型,在传递过程中都会进行拷贝。计算字符数量As3:str.lengthSwift:countElements(str)数组:ArrayAs3:存数任意数据var arr:Array=new Array();var vec:Vector.=new ...
分类:
其他好文 时间:
2014-06-19 06:47:35
阅读次数:
281
客户提交一个dump文件,WinDbg加载时出现大量WARNING,加载对应版本的SOS后执行相应命令提示"SOS does not support the current target architecture"。原因在于使用了64位的任务管理器导出了32位进程的dump文件,下面是两个解决方法:...
分类:
其他好文 时间:
2014-06-15 20:04:30
阅读次数:
463
LRU CacheDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get...
分类:
其他好文 时间:
2014-06-14 23:54:37
阅读次数:
352
水题#include #include #include using namespace std;int main(){ vector a(4); cin >> a[0] >> a[1]>>a[2]>>a[3]; string str; cin >> str; int res = 0; for(in...
分类:
其他好文 时间:
2014-06-14 23:00:14
阅读次数:
249
模拟即可#include #include #include using namespace std;int main(){ vector a(5); for(int i = 0; i > g[i][j]; } } int maxHappiness = 0; ...
分类:
其他好文 时间:
2014-06-14 22:57:10
阅读次数:
207
题目描述:输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字class Solution {public: vector spiralOrder(vector > &matrix) { vector result; int nRows = matrix.s...
分类:
其他好文 时间:
2014-06-14 21:27:53
阅读次数:
156
暴利搜索即可#include #include #include using namespace std;int main(){ int n,k,x; cin >> n >> k >> x; vector c(n); for(int i = 0 ; i > c[i]; ...
分类:
其他好文 时间:
2014-06-14 18:47:42
阅读次数:
206
1. Fragment基本用法
为了管理Activity中的fragments,需要调用Activity中的getFragmentManager()方法。因为FragmentManager的API是在Android 3.0,也即API level 11开始引入的,所以对于之前的版本,需要使用support library v4中的FragmentActivity,并且使用getSupportFr...
分类:
其他好文 时间:
2014-06-14 13:38:42
阅读次数:
188
首先对于vector而言,添加和删除操作可能使容器的部分或者全部迭代器失效。那为什么迭代器会失效呢?vector元素在内存中是顺序存储,试想:如果当前容器中已经存在了10个元素,现在又要添加一个元素到容器中,但是内存中紧跟在这10个元素后面没有一个空闲空间,而vector的元素必须顺序存储一边索引访问,所以我们不能在内存中随便找个地方存储这个元素。于是vector必须重新分配存储空间,用来存放原来...
分类:
编程语言 时间:
2014-06-14 13:04:47
阅读次数:
338
void dfs(int k,int target,vector& candidates,vector& sol,vector >& res){ if(target==0){ vector temp(sol); res.push_back(temp); return; }else if(tar...
分类:
其他好文 时间:
2014-06-14 10:31:07
阅读次数:
196