Title:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:(1) The left subtree of a node conta...
分类:
其他好文 时间:
2015-05-12 11:01:30
阅读次数:
96
有效的括弧匹配注意事项:1 使用stack遇到'(' '[' '{'就push,遇到')' ']' '}'匹配进行pop等操作class Solution {public: bool isValid(string s) { stack mystack; char tmp; for(char c:s....
分类:
其他好文 时间:
2015-05-11 23:43:31
阅读次数:
159
快速通道:https://oj.leetcode.com/problems/restore-ip-addresses/Given a string containing only digits, restore it by returning all possible valid IP addres...
分类:
其他好文 时间:
2015-05-11 23:42:13
阅读次数:
219
防盗链分为两种:一种是url防盗链,一种是模块防盗链1、url配置:valid_referersnoneblockedserver_names
location~*\.(jpg|png)${
valid_referersnoneblocked192.168.1.7;
if($invalid_referer){
rewrite^/http://www.baidu.com;
#return403;
}
}2、模块配置:location/downloa..
分类:
其他好文 时间:
2015-05-11 20:14:53
阅读次数:
170
1、防盗链有两种实现方式第一种采用了URL重写模块location~.*\.(jpg|gif|png)${valid_referersnoneblocked*.demo.comdemo.com192.168.1.175;if($invalid_referer){#rewrite^/错误跳转链接;return403;}}解析:判断文件是jpg,gif,png格式的(自己可以随意设置一些文件的后缀),..
分类:
其他好文 时间:
2015-05-11 18:10:32
阅读次数:
119
shellcode学习第一个例子。以下有一段c语言编写的命令行程序,检验用户输入的数字,并判断是否合法。这里用户的输入被放在了函数的缓冲区里,但程序没有对缓冲区长度做检查,留下了漏洞。这里可以利用该漏洞绕过数字检察,使得任意输入都会被判定为正确。
在 validate_serial 中,do_valid_stuff 的地址溢出到函数的返回值上,就可实现。源程序#include ...
分类:
系统相关 时间:
2015-05-11 17:57:39
阅读次数:
150
E:\website\jquery-plugins>grunt
A valid Gruntfile could not be found. Please see the getting started guide for
more information on how to configure grunt: http://gruntjs.com/getting-started
Fatal error...
分类:
其他好文 时间:
2015-05-11 13:06:24
阅读次数:
175
题目大意:给出一个字符串,要求只考虑字符串中的字母和数字,判断该字符串是否是回文。注意:空串是回文。
算法思想:首先将字符串中的大写字母全部转化为小写字母,然后分别设置两个游标Left ,right。开始扫描字符串如果当前字符不是字母或数字则跳过,若是则比较,左右游标指向的字符是否相同,如果不想同则返回FALSE,当扫描完整个字符串的时候返回TRUE。
代码如下:
class Solutio...
分类:
其他好文 时间:
2015-05-11 12:58:19
阅读次数:
116
我的错误代码: 1 #include 2 3 using namespace std; 4 5 int longestValidParentheses(string s) 6 { 7 int i = 0; 8 int L = s.length(); 9 int j;10 ...
分类:
其他好文 时间:
2015-05-11 12:54:52
阅读次数:
96
题目:Validate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the problem s...
分类:
其他好文 时间:
2015-05-11 12:51:36
阅读次数:
214