Strings>>> s = 'django is cool'>>> words = s.split()>>> words['django', 'is', 'cool']>>> ' '.join(words)'django is cool'>>> s.count('o')3>>> s.find('g...
分类:
编程语言 时间:
2014-09-09 11:27:48
阅读次数:
224
我们想通过Storm提供的thrift接口来获取Toplogy的性能数据,比如emiited了多少,延迟是多少之类。但在使用Python开发过程中,发现getClusterInfo这个方法,会报错,thrift版本0.7,Storm版本为0.9.0.1,错误如下:Traceback (most re...
分类:
其他好文 时间:
2014-09-09 11:22:18
阅读次数:
167
SELECT--UNION,UNION ALL,MINUS, INTERSECT返回两个查询结果的集合操作,两个查询结果集必须字段相同。UNION和UNION ALL并集操作,UNION并集后去掉重复结果,UNION ALL直接并集MINUS差集操作INTERSECT交集操作SQL> select ...
分类:
其他好文 时间:
2014-09-09 11:20:08
阅读次数:
266
//// main.cpp// map_find//// Created by PKU on 14-9-8.// Copyright (c) 2014年 PKU. All rights reserved.//#include #include #include using namespace...
分类:
其他好文 时间:
2014-09-09 11:10:28
阅读次数:
254
Python的列表就像数组一样。定义一个空列表:a=[]a=list()生成列表可以用列表推导式来生成一个列表:ls1=[1,2,3,4]ls2=[x*x for x in lst1]# ls2=[1,4,9,16] 列表的一些方法:定义一个列表lsls.append(x)在列表尾部追加一个元素,等...
分类:
编程语言 时间:
2014-09-09 11:02:18
阅读次数:
311
ListList中的内容并不一定只有一种类型,一个List中可能既有number,又有string,还可能有子ListList用[]表示List的基本方法有:append,sort等要从一个List中删除某元素,可以使用del函数(它不是List的方法)#!/usr/bin/pythonmylist...
分类:
编程语言 时间:
2014-09-09 10:58:18
阅读次数:
290
//// main.cpp// setcmp//// Created by IDM-PKU on 14-9-6.// Copyright (c) 2014年 PKU. All rights reserved.//#include #include #include "print.hpp"us...
分类:
其他好文 时间:
2014-09-09 10:54:38
阅读次数:
378
Combination SumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thes...
分类:
其他好文 时间:
2014-09-09 10:54:08
阅读次数:
190
简单地实现一个下拉滚动时加载更多数据的效果。这种效果经常在手机端、瀑布流时看到 1 KISSY.add('load',function(S,Core,IO,XTemplate){ 2 var $ = S.all, D = S.DOM, E = S.Event; 3 var API =...
分类:
其他好文 时间:
2014-09-09 10:50:48
阅读次数:
316
1.publish2.update print_lolPS:for Step 1.write the code in to a py file. put the py file into a folder named nester. new a py file named 'setup' and t...
分类:
编程语言 时间:
2014-09-09 10:44:28
阅读次数:
309