在日常的脚本编写过程中,通常会获取配置文件中的配置项,以执行相应的业务逻辑。小二上码。。。若有不足之处,敬请大神指正,不胜感激!获取配置项值的源码如下所示: 1 /** 2 * Get value from properties by key. Return null when t...
分类:
编程语言 时间:
2015-06-29 19:27:25
阅读次数:
143
A subroutine of merge sort. 1 class Solution { 2 public: 3 /** 4 * @param A and B: sorted integer array A and B. 5 * @return: A new sort...
分类:
编程语言 时间:
2015-06-29 19:23:28
阅读次数:
403
问题描述:Given two binary strings, return their sum (also a binary string).For example,
a = “11”
b = “1”
Return “100”.
解决方案:class Solution {
public:
string addBinary(string a, string b) {
i...
分类:
其他好文 时间:
2015-06-29 17:06:23
阅读次数:
101
1 class Solution { 2 public: 3 /** 4 * @param strs: A list of strings 5 * @return: The longest common prefix 6 */ 7 string...
分类:
其他好文 时间:
2015-06-29 16:36:19
阅读次数:
197
/** * 测试当前摄像头能否被使用 * * @return */ public static boolean isCameraCanUse() { boolean canUse = true; Camera mCamera ...
分类:
移动开发 时间:
2015-06-29 16:23:31
阅读次数:
158
classProgram{staticvoidMain(string[]args){Console.Write(Gender.男.ToInt());}} publicstaticclassEnumExtend{publicstaticintToInt(thisEnummember){return(i...
分类:
其他好文 时间:
2015-06-29 16:18:08
阅读次数:
77
回调函数的定义为:传递一个函数A到另一个函数B中,由B调用A,我们就说函数A叫做回调函数。如果没有名称,就叫做匿名回调函数。 例1:Javascript中的回调函数function invoke_and_add(a,b){ return a()+b();}function one(){ retu.....
分类:
其他好文 时间:
2015-06-29 16:12:07
阅读次数:
104
原题如下:
Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).我的算法:
1. 首先获得树的高度
2. 层序递归遍历二叉树实现如下:package leet...
分类:
其他好文 时间:
2015-06-29 15:02:29
阅读次数:
130
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly...
分类:
其他好文 时间:
2015-06-29 13:24:20
阅读次数:
105
递归:若函数包含了对其自身的调用,该函数为递归的。>>> #递归 《Python核心编程》P305>>> def factorial(n):if n==0 or n==1:#0!=1!=1return 1else:return n*factorial(n-1)>>> factorial(3)6>>>...
分类:
编程语言 时间:
2015-06-29 13:16:05
阅读次数:
110