码迷,mamicode.com
首页 >  
搜索关键字:python long string    ( 244880个结果)
LeetCode: Combinations [077]
【题目】 Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = "ADOBECODEBANC" T = "ABC" Minimum window is "BANC". Note: If there is no such window in S that covers ...
分类:其他好文   时间:2014-06-05 11:14:26    阅读次数:255
python无私有成员变量
python解释器将__init__函数里的__z变量转成 _classname__z了,明白规则后外部依然可以通过实力对象来访问。 In [1]: class aa: ...: def __init__(self): ...: self.x = 10 ...: self.y = 11 ...: self.__z =...
分类:编程语言   时间:2014-06-05 10:25:10    阅读次数:346
LeetCode: Minimum Window Substring [076]
【题目】 Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = "ADOBECODEBANC" T = "ABC" Minimum window is "BANC". Note: If there is no such window in S that covers ...
分类:Windows程序   时间:2014-06-05 10:03:07    阅读次数:473
字符串的分割操作(strtok,split)
一:strtok C/C++:char *strtok(char s[], const char *delim); s 代表需要分割的字符串,delim代表分割的标志,参数都为比选!返回指向分割部分的指针,如果没有分割成功就返回NULL. 一个简单的例子:...
分类:其他好文   时间:2014-06-05 10:01:51    阅读次数:139
Python中strip方法的妙用
【开胃小菜】 当提到python中strip方法,想必凡接触过python的同行都知道它主要用来切除空格。有以下两种方法来实现。 方法一:用内置函数 # if __name__ == '__main__':     str = ' Hello world '     print '[%s]' %str.strip() # 方法二:调用string模块中方法 # import s...
分类:编程语言   时间:2014-06-05 09:27:48    阅读次数:330
神经网络python 实现
感知器学习算法步骤如下: 1.对权系数w置初值 对权系数w=(W1 .W2 ,…,Wn ,Wn+1 )的各个分量置一个较小的零随机值,但Wn+1 = —g。并记为Wl (0),W2 (0),…,Wn (0),同时有Wn+1(0)=-θ 。这里Wi (t)为t时刻从第i个 输入上的权系数,i=1,2,…,n。Wn+1 (t)为t时刻时的阀值。 图1-10 感知器的分类例...
分类:编程语言   时间:2014-06-05 08:55:11    阅读次数:448
重构摘要3_代码的坏味道
如果尿布臭了,就换掉它。 1.Duplicated Code 重复代码 Extract MethodPull Up MethodForm Template Method --》 Template Method 模式Substitute Algorithm --》 函数算法替代 2.Long Method 过长的函数 “间接层”所带来的全部利益--解释能力、共享能...
分类:其他好文   时间:2014-06-05 08:45:40    阅读次数:291
C# FolderBrowserDialog 的用法
string defaultPath = ""; FolderBrowserDialog dialog = new FolderBrowserDialog(); //打开的文件夹浏览对话框上的描述 dialog.Description = "请选择一个文件夹"; //是否显示对话框左下角 新建文件夹 按钮,默认为 true dialog.ShowNewFolderButton = false; /...
分类:其他好文   时间:2014-06-05 08:23:34    阅读次数:224
python中lxml的应用
首先下载lxml, http://www.lfd.uci.edu/~gohlke/pythonlibs/ ,然后添加引用 from lxml import _elementpath as DONTUSE from lxml import etree 具体示例: 1.添加命名空间 #set namespace nsmap = {"xsi": "h...
分类:编程语言   时间:2014-06-05 07:54:48    阅读次数:441
C++ Primer 学习笔记_89_用于大型程序的工具 --异常处理[续2]
用于大型程序的工具--异常处理[续2]八、自动资源释放 考虑下面函数:void f() { vector v; string s; while (cin >> s) { v.push_back(s); } string *p = new string[v.size()]; //... delete p; } 在正...
分类:编程语言   时间:2014-06-05 06:07:27    阅读次数:393
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!