1. 首先安装samba服务。 2. 配置防火墙(要先关闭) 3.
创建samba服务器用户:smbpasswd -a username 删除samba服务器用户:smbpasswd -x username 4.
配置/etc/samba/smb.conf 需要配置valid user vi /et...
分类:
系统相关 时间:
2014-05-19 15:58:50
阅读次数:
279
1. class NewClass(parent): def .... 如果没有父类,
则默认继承object类2. 类属性访问(类似java中的静态属性和方法)直接用类名.属性名, 在python中, 如果没有创建实例,
方法不能被调用。方法必须绑定到一个实例才能直接被调用。 cla...
分类:
编程语言 时间:
2014-05-19 15:40:08
阅读次数:
258
Given a stringS, find the longest palindromic
substring inS. You may assume that the maximum length ofSis 1000, and there
exists one unique longest pa...
分类:
其他好文 时间:
2014-05-18 19:39:55
阅读次数:
355
个人认为重点写出max_heapify和parent_heapify两个函数即可,这个版本内存管理的功能显得特别简单:
#include
#include
using namespace std;
class Heap {
public:
int size, capacity;
int *ele;
void max_heapify(int i,int heap[],int len...
分类:
其他好文 时间:
2014-05-18 15:15:29
阅读次数:
220
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" are
all vali...
分类:
其他好文 时间:
2014-05-18 15:11:17
阅读次数:
249
【题目】
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not.
【题意】
判断给定的字符串是否是合法的...
分类:
其他好文 时间:
2014-05-18 10:08:11
阅读次数:
327
【题目】
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()", "()(())", "()()()"
【题意】
给定n对括号,输出所有可行的括号组合字符串。所谓合法,就是可以Valid Pare...
分类:
其他好文 时间:
2014-05-18 09:06:41
阅读次数:
266
题意:
Evaluate the value of an arithmetic expression in
Reverse Polish Notation.
Valid operators are +, -, *,
/. Each operand may be an integer or another expression.
So...
分类:
其他好文 时间:
2014-05-18 08:09:15
阅读次数:
190
【题目】
Write a function to find the longest common prefix string amongst an array of strings.
【题意】
求一组字符串的最长公共前缀
【思路】
使用归并思想求解
要求字符串[1,2,..,k,k+1,...n]的最大公共前缀,先分别求[1,2,...k]和[k+1,...,n]的公共前缀...
分类:
其他好文 时间:
2014-05-18 05:17:53
阅读次数:
232
Given an unsorted array of integers, find the
length of the longest consecutive elements sequence.For example,Given[100, 4,
200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2014-05-18 01:52:45
阅读次数:
317