Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in th ...
分类:
其他好文 时间:
2016-06-26 21:07:47
阅读次数:
143
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. ...
分类:
其他好文 时间:
2016-06-26 21:06:33
阅读次数:
187
在使用 find 命令的 -exec 选项处理匹配到的文件时, find 命令将所有匹配到的文件一起传递给 exec 执行,但有些系统对能够传递给 exec 的命令长度有限制,这样在 find 命令运行几分钟之后,就会出现溢出错误。错误信息通常是“参数列太长” 或 “参数列溢出”。 这就是 xarg ...
分类:
系统相关 时间:
2016-06-26 18:09:09
阅读次数:
197
前面2节中对页面内容的访问都是直接通过标签访问的,这样虽然也可以达到解析页面内容的目的,但是在网页复杂,页面结构发生变化时,爬虫就失效了。为了使爬虫能够更加鲁棒的工作,我们需要学习通过属性查找标签的方法。 BeautifulSoup的find()和findAll()方法: BeautifulSoup ...
分类:
其他好文 时间:
2016-06-26 16:49:50
阅读次数:
135
find 是我们很常用的一个Linux命令,但是我们一般查找出来的额并不仅仅是看看而已,还会有进一步的操作,这个时候exec的作用就显现出来了。 exec解释: -exec 参数后面跟的是 command 命令,它的终止是以“;”为结束标志的,所以这句命令后面的分号是不可缺少的,考虑到各个系统中分号 ...
分类:
系统相关 时间:
2016-06-26 16:34:01
阅读次数:
186
linux 下 find 命令在目录结构中搜索文件,并执行指定的操作。Linux 下 find 命令提供了相当多的查找条件,功能很强大。由于 find 具有强大的功能,所以它的选项也很多,其中大部分选项都值得我们花时间来了解一下。即使系统中包含有网络文件系统(NFS),find 命令在该文件系统中同 ...
分类:
系统相关 时间:
2016-06-26 15:26:41
阅读次数:
225
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh ...
分类:
其他好文 时间:
2016-06-26 15:14:14
阅读次数:
115
Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix such that its sum is no larger than k. Example: The ...
分类:
其他好文 时间:
2016-06-26 14:03:31
阅读次数:
2171
whereis 命令只能用于程序名的搜索,而且只搜索二进制文件(参数-b)、man说明文件(参数-m)和源代码文件(参数-s)。如果省略参数,则返所有信息。 和find相比,whereis查找的速度非常快,这是因为Linux系统会将 系统内的所有文件都记录在一个数据库文件中,当使用whereis和下 ...
分类:
系统相关 时间:
2016-06-26 11:31:50
阅读次数:
170
查找边界 line_text.endswith('my_case_'): line_text.startswith('my_case_')查找子字符串 url.find('show) 文字提取 re.compile(r'\s+(\d+):.*') .sub(r'\1',line_text) # 直接 ...
分类:
其他好文 时间:
2016-06-26 10:21:29
阅读次数:
235