Java String类中有个方法叫:replaceAll,从表面上看,他的意思是把所有的regex替换成replacement。1 public String replaceAll(String regex, String replacement) {2 return Pa...
分类:
编程语言 时间:
2015-07-24 20:09:21
阅读次数:
142
Product of Array Except Self问题:Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of a...
分类:
其他好文 时间:
2015-07-24 20:08:53
阅读次数:
100
Remove all elements from a linked list of integers that have value val.
Example
Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6
Return: 1 --> 2 --> 3 --> 4 --> 5
Credits:
Special thanks...
分类:
其他好文 时间:
2015-07-24 18:38:10
阅读次数:
234
Product of Array Except Self
Given an array of n integers where n > 1, nums,
return an array output such that output[i] is
equal to the product of all the elements of nums except nums[i].
...
分类:
其他好文 时间:
2015-07-24 18:30:41
阅读次数:
95
Effective Go(官方文档)笔记
自动局部变量提升(编译期完成?):return &...;内置函数:
new/makecopy, appenddeleterange(这是关键字吧?因为后面没有())
array是值对象slice:引用array
2维切片(略)
map
if seconds, ok := timezone[tz]; ok {...
分类:
其他好文 时间:
2015-07-24 18:23:47
阅读次数:
144
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.题意: 实现除法,但不允许用乘、除、以及取模运算。思路: 一下一下减必然显得.....
分类:
其他好文 时间:
2015-07-24 18:12:44
阅读次数:
109
1.创建数据库// 声明数据库static sqlite3 *db = nil;#pragma mark 打开数据库- (void)openDataBase{ if (db != nil) { return; } // 创建数据库 // 1.保存数据库...
分类:
数据库 时间:
2015-07-24 18:00:27
阅读次数:
140
刚接触angularjs在使用的过程中遇到这个问题首先我们的图片地址是根据ID来获取的,所以用了指令来完成图片的绑定.directive("cImg", ['appUrl', function (appUrl) { return { restrict: 'A', l...
分类:
Web程序 时间:
2015-07-24 17:35:13
阅读次数:
135
double CTest::jia( double &a, double b){ double c; a = 30; b = 30; c = a + b; return c;} double a = 10; double b = 20; double c=CTest::jia(a, b); a...
分类:
其他好文 时间:
2015-07-24 17:31:25
阅读次数:
101
今天想用python的装饰器做一个运算,代码如下 >>>?def?mu(x):
def?_mu(*args,**kwargs):
return?x*x
return?_mu
>>>?@mu
def?test(x,y):
print?‘%s,%s‘?%(x,y)
>>>?test(3,5)
Traceback?(mo...
分类:
编程语言 时间:
2015-07-24 16:18:39
阅读次数:
144