function sumStrings(a,b){ var res='', c=0; a = a.split(''); b = b.split(''); while (a.length || b.length || c){ c += ~~a.pop() + ~~b.pop(); res = c % ...
分类:
Web程序 时间:
2017-06-20 19:12:17
阅读次数:
208
通过网查得出,使用json中的dumps方式可以解决问题。一般在需要输出得上一步使用,这样可以便于其他错误得产生 import json # result = json.dumps(b, encoding='UTF-8', ensure_ascii=False)# list1 = ["陈","湖北" ...
分类:
编程语言 时间:
2017-06-20 17:52:13
阅读次数:
276
内置函数补充: # print(divmod(73,23))## total_count=73# per_count=23## res=divmod(total_count,per_count)# if res[1] > 0:# page_count=res[0]+1## print(page_co ...
分类:
其他好文 时间:
2017-06-20 16:24:55
阅读次数:
167
Assume you have a method isSubstring which checks if one word is a substring of another. Given two strings, s1 and s2, write code to check if s2 is a ...
分类:
其他好文 时间:
2017-06-20 13:36:52
阅读次数:
139
要求:统计一个字符串中 各字符串出现的次数。比如 "a1a35b5" 统计出来应该是 a-2, 1-1, 3-1, b-1, 5-2。 思想一:用split方法将key字符切除,比较源字符串长度和新字符串长度,得出key字符个数。 图例: 代码: 思想二:选出key值,在字符串中匹配与key相等的字 ...
分类:
其他好文 时间:
2017-06-19 23:27:24
阅读次数:
155
1;"abcde".find("b") >>>1 2;abcde".find("bc") >>>1 [其中把bc看做是一个整体,第一个是把b单独看做是一个整体】 3; 4;split分割复符 5;replace替代符 替换sub与subn的区别 sub中. 表示一个字符其中2表示可随意定义替换几次1 ...
分类:
其他好文 时间:
2017-06-19 19:42:31
阅读次数:
254
private string OrderBonds(string bonds) { string[] lists = bonds.Split(','); List<string> newList = new List<string>(lists); newList.Sort(); lists = n ...
分类:
编程语言 时间:
2017-06-19 14:20:17
阅读次数:
128
应用场景: 依据keyword查询与此keyword相似的信息,当中一些keyword要排除掉比如:“有限公司”、“有限责任公司”、“股份有限公司”等,须要创建一个排除词库表; 第一步:词库表 第二部:创建函数p_split_keyword 第三部:keyword处理 第四部:測试 select * ...
分类:
数据库 时间:
2017-06-19 14:18:28
阅读次数:
196
随机数可以用于项目中的随机生成的订单号之类,蛮实用的小功能。 如图,生成一串17位的随机数,规则是:A代表用户+4个随机数字+4个随机字母+当前年月日 ...
分类:
其他好文 时间:
2017-06-18 22:42:03
阅读次数:
159
还没有处理lambda、上下文等。有待完好。 main { for putsl(eval(getsl)) } rstr eval(rstr s) { return eval(tokenize(s).split(' ')) } rstr eval(rbuf<rstr>& v) { if v.get(0 ...
分类:
其他好文 时间:
2017-06-18 21:51:31
阅读次数:
160