关于学习 《深入应用c++11》的代码笔记:c++11之前是这么实现的templateclass Singleton{public: static T* Instance(){ if (m_pInstance == nullptr) m_pInstance = new T(); return...
分类:
编程语言 时间:
2015-06-29 00:17:03
阅读次数:
245
在ECMAScript语言中,函数名字只不过是一个指针(可以认为是引用),下面的代码:
"use strict";
function sum(a,b){
return a+b;
}
console.log(sum(1,2));
var sum2 = sum;
sum = null;
console.log(sum2(3,3));
输出:3,6;
...
分类:
编程语言 时间:
2015-06-28 23:06:52
阅读次数:
295
public class Environment { /** * Return root of the "system" partition holding the core Android OS. * Always present and mounted read-only....
分类:
其他好文 时间:
2015-06-28 23:04:41
阅读次数:
146
至少有两种情况下finally语句是不会被执行的:(1)try语句没有被执行到,如在try语句之前就返回了,这样finally语句就不会执行,这也说明了finally语句被执行的必要而非充分条件是:相应的try语句一定被执行到。(2)在try块中有System.exit(0);这样的语句,Syste...
分类:
编程语言 时间:
2015-06-28 23:00:55
阅读次数:
224
public class User: private string _User; public string User1 { get { return _User; } set { ...
原文 I have just moved to a house in Bridge Street. Yesterday a beggar knocked at my door. He asked me for a meal and a glass of beer. In return for this, the beggar stood on his head and sang song...
分类:
其他好文 时间:
2015-06-28 20:18:54
阅读次数:
158
Array.delRepeat=function(arr){
var_arr=arr.slice(0),retArr=[];
for(vari=0,len=_arr.length;i<len;i++){
for(varj=i+1;j<len;j++){
if(_arr[i]==_arr[j]){
break;
}
}
if(j==len){
retArr.push(_arr[i]);
}
}
returnretArr;
}
var_Array=[];
for(vari=0;i&l..
分类:
编程语言 时间:
2015-06-28 20:15:40
阅读次数:
245
Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a...
分类:
其他好文 时间:
2015-06-28 18:43:59
阅读次数:
97
1 class Solution { 2 public: 3 /** 4 * @param grid: a list of lists of integers. 5 * @return: An integer, minimizes the sum of all numb...
分类:
其他好文 时间:
2015-06-28 17:30:04
阅读次数:
369
1 class Solution { 2 public: 3 /** 4 * @param A, B: Two strings. 5 * @return: The length of longest common subsequence of A and B. 6 ...
分类:
其他好文 时间:
2015-06-28 17:04:49
阅读次数:
107