11 2015 档案

摘要: 阅读全文
posted @ 2015-11-29 23:48 hao.ma 阅读(122) 评论(0) 推荐(0)
摘要:#kmp class Solution(object): def strStr(self, haystack, needle): """ :type haystack: str :type needle: str :rtype: int ... 阅读全文
posted @ 2015-11-29 21:05 hao.ma 阅读(158) 评论(0) 推荐(0)
摘要:class Solution(object): def removeElement(self, nums, val): """ :type nums: List[int] :type val: int :rtype: int ... 阅读全文
posted @ 2015-11-29 20:05 hao.ma 阅读(140) 评论(0) 推荐(0)
摘要:class Solution(object): def removeDuplicates(self,nums): if len(nums) <= 0: return 0 j=0 for i in range(0,len(nums)): if... 阅读全文
posted @ 2015-11-29 18:06 hao.ma 阅读(137) 评论(0) 推荐(0)
摘要:# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solutio... 阅读全文
posted @ 2015-11-27 09:21 hao.ma 阅读(136) 评论(0) 推荐(0)
摘要:# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solutio... 阅读全文
posted @ 2015-11-25 23:08 hao.ma 阅读(133) 评论(0) 推荐(0)
摘要:upstream proxy_1 { server 127.0.0.1:8080; #连接到上游服务器的最大并发空闲keepalive长连接数(默认是未设置,建议与Tomcat Connector中的maxKeepAliveRequests值一样) #当这个... 阅读全文
posted @ 2015-11-25 20:07 hao.ma 阅读(143) 评论(0) 推荐(0)
摘要:参数说明示例$remote_addr客户端地址211.28.65.253$remote_user客户端用户名称--$time_local访问时间和时区18/Jul/2012:17:00:01 +0800$request请求的URI和HTTP协议"GET /article-10000.html HTT... 阅读全文
posted @ 2015-11-25 15:55 hao.ma 阅读(464) 评论(0) 推荐(0)
摘要:http keepalive 减少tcp 连接 (三次握手的消耗)tcp keepalive 检测死链接的session 在tcp连接中, src_ip + src_port + dest_ip + dest_port generate a unique session id 阅读全文
posted @ 2015-11-25 12:28 hao.ma 阅读(128) 评论(0) 推荐(0)
摘要:# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solutio... 阅读全文
posted @ 2015-11-24 23:13 hao.ma 阅读(110) 评论(0) 推荐(0)
摘要:这个模块(build-in)实现了一个堆的数据结构,完美的解决了Top-K问题,以后解决Top-K问题的时候,直接把这个模块拿来用就可以了注意,默认的heap是一个小顶堆! heapq模块提供了如下几个函数:heapq.heappush(heap, item) 把item添加到heap中(heap是... 阅读全文
posted @ 2015-11-24 23:11 hao.ma 阅读(622) 评论(0) 推荐(0)
摘要:# 解题思路:列举出所有合法的括号匹配,使用dfs。如果左括号的数量大于右括号的数量的话,就不能产生合法的括号匹配class Solution(object): def generateParenthesis(self, n): """ :type n: int ... 阅读全文
posted @ 2015-11-24 22:48 hao.ma 阅读(168) 评论(0) 推荐(0)
摘要:curl -H "Content-Type: application/json" http://127.0.0.1:8000 -X POST -d 'xxxx'php$strParam = $GLOBALS['HTTP_RAW_POST_DATA']; 阅读全文
posted @ 2015-11-24 20:41 hao.ma 阅读(641) 评论(0) 推荐(0)
摘要:# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solutio... 阅读全文
posted @ 2015-11-22 07:18 hao.ma 阅读(159) 评论(0) 推荐(0)
摘要:# 解题思路: # 创建一个字典映射关系 dicts# 使用一个栈stk 遍历字符串s 得到一个新的字符串curItem 如果lastItem在dicts中的value和它相等 不做任何操作# 如果不等 入栈 有lastItem的 先append lastItem 然后是curItem ## 最后判... 阅读全文
posted @ 2015-11-21 23:51 hao.ma 阅读(166) 评论(0) 推荐(0)
摘要:# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solutio... 阅读全文
posted @ 2015-11-21 22:35 hao.ma 阅读(113) 评论(0) 推荐(0)
摘要:class Solution(object): def fourSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[List[... 阅读全文
posted @ 2015-11-21 16:53 hao.ma 阅读(162) 评论(0) 推荐(0)
摘要:class Solution(object): def letterCombinations(self, digits): """ :type digits: str :rtype: List[str] """ if len... 阅读全文
posted @ 2015-11-21 00:00 hao.ma 阅读(119) 评论(0) 推荐(0)
摘要:class Solution(object): def threeSumClosest(self, nums, target): """ :type nums: List[int] :type target: int :rtype: in... 阅读全文
posted @ 2015-11-20 20:36 hao.ma 阅读(158) 评论(0) 推荐(0)
摘要:upstream.confupstream grey_1 ... 阅读全文
posted @ 2015-11-20 15:04 hao.ma 阅读(4100) 评论(0) 推荐(0)
摘要:http request parameter addhtmlspecialcharshost?vendor_id=1000000&q=Some%20children%20wish%20to%20be%20writers&loc=103.844915%2C36.014027&lang=zh-CN&s=... 阅读全文
posted @ 2015-11-20 12:43 hao.ma 阅读(325) 评论(0) 推荐(0)
摘要:# sort the array# loop from i = 0 # then left=i+1 right=len(nums)-1# try nums[i] - ( nums[left]+nums[right]) = 0 # class Solution(object): def thre... 阅读全文
posted @ 2015-11-19 23:19 hao.ma 阅读(214) 评论(0) 推荐(0)
摘要:class Solution(object): def longestCommonPrefix(self, strs): """ :type strs: List[str] :rtype: str """ if len(st... 阅读全文
posted @ 2015-11-19 20:17 hao.ma 阅读(182) 评论(0) 推荐(0)
摘要:class Solution(object): def romanToInt(self, s): """ :type s: str :rtype: int """ numerals = { "M": 1000, "D": 5... 阅读全文
posted @ 2015-11-18 22:49 hao.ma 阅读(130) 评论(0) 推荐(0)
摘要:class Solution(object): def intToRoman(self, num): """ :type num: int :rtype: str """ if num > 3999 or num = val... 阅读全文
posted @ 2015-11-18 22:35 hao.ma 阅读(136) 评论(0) 推荐(0)
摘要:# add / location /app/ { proxy_pass http://$backend/;}#location /app/ { proxy_pass http://$backend; }1 加斜杠:请求 http://domain/app/demo.ph... 阅读全文
posted @ 2015-11-18 12:44 hao.ma 阅读(714) 评论(0) 推荐(0)
摘要:$args$content_length$content_type$document_root$document_uri$host$http_user_agent$http_cookie$limit_rate$request_body_file$request_method$remote_addr$... 阅读全文
posted @ 2015-11-16 20:16 hao.ma 阅读(722) 评论(0) 推荐(0)
摘要:class Solution(object): def maxArea(self, height): """ :type height: List[int] :rtype: int """ intSum = ... 阅读全文
posted @ 2015-11-15 23:08 hao.ma 阅读(144) 评论(0) 推荐(0)
摘要:# 查看静态态依赖库ldd ./nginx #查看安装了哪些模块./nginx -V 阅读全文
posted @ 2015-11-13 21:50 hao.ma 阅读(237) 评论(0) 推荐(0)
摘要:./configure --prefix=/home/admin/local/tengine --with-http_stub_status_module --with-http_ssl_module --with-http_upstream_check_module --with-http_con... 阅读全文
posted @ 2015-11-13 21:29 hao.ma 阅读(187) 评论(0) 推荐(0)
摘要:class Solution(object): def isPalindrome(self, x): """ :type x: int :rtype: bool """ if x < 0: return... 阅读全文
posted @ 2015-11-11 19:29 hao.ma 阅读(138) 评论(0) 推荐(0)
摘要:#php proxytotal sent request num: 507total handle read times: 506506 fetches, 2 max parallel, 2.7129e+06 bytes, in 20 seconds5361.45 mean bytes/fetche... 阅读全文
posted @ 2015-11-11 14:15 hao.ma 阅读(335) 评论(0) 推荐(0)
摘要:class Solution(object): def myAtoi(self, str): """ :type str: str :rtype: int """ intMax=2147483647 intMi... 阅读全文
posted @ 2015-11-10 21:12 hao.ma 阅读(189) 评论(0) 推荐(0)
摘要:class Solution(object): def reverse(self, x): """ :type x: int :rtype: int """ answer = 0 sign = ... 阅读全文
posted @ 2015-11-09 23:20 hao.ma 阅读(103) 评论(0) 推荐(0)
摘要:class Solution(object): def longestPalindrome(self, s): """ :type s: str :rtype: str """ lenStr = len(s) ... 阅读全文
posted @ 2015-11-08 20:48 hao.ma 阅读(177) 评论(0) 推荐(0)
摘要:# @link http://www.cnblogs.com/zuoyuan/p/3759682.htmlclass Solution(object): def findMedianSortedArrays(self, nums1, nums2): """ :typ... 阅读全文
posted @ 2015-11-08 02:11 hao.ma 阅读(409) 评论(0) 推荐(0)
摘要:class Solution(object): def lengthOfLongestSubstring(self, s): """ :type s: str :rtype: int """ if len(s) maxLe... 阅读全文
posted @ 2015-11-06 20:47 hao.ma 阅读(154) 评论(0) 推荐(0)
摘要:class Solution(object): def climbStairs(self, n): """ :type n: int :rtype: int """ if n <= 2: return ... 阅读全文
posted @ 2015-11-04 08:45 hao.ma 阅读(119) 评论(0) 推荐(0)
摘要:# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solutio... 阅读全文
posted @ 2015-11-03 21:12 hao.ma 阅读(123) 评论(0) 推荐(0)