- 博客(93)
- 收藏
- 关注
原创 fiddler重定向本地服务器URL到线上URL
参考:http://docs.telerik.com/fiddler/KnowledgeBase/FiddlerScript/ModifyRequestOrResponse关键代码 var origin_host="172.16.11.21";//原始地址 var origin_port="8080";//原端口 var r
2016-04-08 10:39:57
6247
原创 requests上传文件
def test_upload_not_exist_app_and_one_version(self): util.login(self) files = { 'file': ('fuckfuckthefuck-1.apk', open(self.post_path, 'rb')) } first_agen
2016-03-28 15:12:58
671
原创 django-debug-tool配置
1.环境debug=True2.INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django
2016-03-16 11:50:44
890
原创 创建测试用例的代码
文件runtests.py 代码如下:# coding:utf-8import loggingimport osimport sysimport djangofrom django.test.runner import DiscoverRunner__author__ = 'root'EXAMPLE = 'example' in sys.argvif EXAMPLE: os.e
2015-11-27 17:41:47
1075
原创 初试2048
# coding:utf-8import osimport randomimport refrom selenium import webdriverimport copyfrom selenium.webdriver.common.keys import Keysimport time__author__ = 'Administrator'direction_action_
2015-11-27 13:59:20
842
原创 初试supervisor
发现自己好像没有用过supervisor哎。所以就来用一用咯。正好想重学下Bash。在/etc/supervisor/conf.d/文件夹下面添加一个新的配置文件叫做chshmod.conf 内容如下:[program:chshmod]command=/data/cronpy/changemod.py /data/shcode/然后重启supervisord 使用命令/etc/init.d/s
2015-11-25 21:26:19
14561
原创 欢迎使用优快云-markdown编辑器
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl
2015-08-12 09:23:59
359
原创 bottle在request.GET.getunicode(in_str)的时候的问题
bottle在request.GET.getunicode(in_str)会吧in_str里的“+”去掉比如:
2014-10-22 11:47:26
585
原创 改写sys.stdout导致pycharm不能调试
class MergedStreamReadWriter(StreamReaderWriter): def __init__(self,*instreams): self._streams=instreams def write(self, data): for stream in self._streams: strea
2014-10-14 11:08:21
2186
原创 python2 description不起作用
python2.7代码为:class Integer: def __init__(self,name): self.name=name def __get__(self,instance,cls): if instance is None: return self else: r
2014-10-13 18:01:46
869
原创 Twisted:exceptions.AssertionError:
出处:http://blog.sina.com.cn/s/blog_704b6af70100py9n.html 13.使用Deferred新功能实现新客户端代码为:#coding:utf-8import deferimport optparsefrom twisted.internet import reactorfrom twisted.internet.protoc
2014-09-27 15:43:15
1284
原创 python2编码。。感觉很奇怪的问题。。
def format_AbsolutePathFile(file_name): temp_file=tempfile.TemporaryFile() with codecs.open(file_name,'r',encoding='utf-8') as source_file: source_content=source_file.read() p
2014-09-18 19:26:09
510
原创 jqvalidator不起作用
源代码: Email address <input type="email" class="form-control" data-validation-email-message="请输入合格的EMIAL 啊" required aria-invalid="false" data-val
2014-09-17 11:30:56
796
原创 pycharm 在写django时,一些很奇怪的东西
1.在创建新对象,也就是CreateView的时候,在urls.py里加断点,好像没有作用。。不知道是怎么回事
2014-09-13 16:39:33
587
原创 lightbird json not JSON serializable
网址:http://lightbird.net/dbe2/bombquiz.html#newplayer-view源网址django 1.5我的代码
2014-08-25 12:49:42
609
原创 用JS实现了一个加法器。。
<!--To change this license header, choose License Headers in Project Properties.To change this template file, choose Tools | Templatesand open the template in the editor.--> TODO sup
2014-06-19 11:19:38
3162
原创 NO——47:最长递增子序列
题目:求一个数组的最长递减子序列 比如{9,4,3,2,5,4,3,2}的最长递减子序列为{9,5,4,3,2}2.参考博客:
2014-05-29 13:05:49
691
原创 NO_32(数组、规划)
题目博客:http://blog.youkuaiyun.com/v_JULY_v/article/details/6057286题目:有两个序列a,b,大小都为n,序列元素的值任意整数,无序;要求:通过交换a,b中的元素,使[序列a元素的和]与[序列b元素的和]之间的差最小。例如: var a=[100,99,98,1,2, 3];var b=[1, 2, 3, 4,5,40
2014-05-28 09:05:00
584
原创 No29栈的push、pop序列(栈)
题目博客:http://blog.youkuaiyun.com/v_JULY_v/article/details/6057286
2014-05-25 15:20:51
561
原创 16题:输入一颗二元树,从上往下按层打印树的每个结点,同一层中按照从左往右的顺序打印。
题目博客:http://blog.youkuaiyun.com/v_JULY_v/article/details/6057286题目(微软):输入一颗二元树,从上往下按层打印树的每个结点,同一层中按照从左往右的顺序打印。 例如输入 8 / / 6 10/ / / /5 7 9 11输出8 6 10 5 7 9 11。代码为:
2014-05-24 17:17:57
533
原创 No15_输入一颗二元查找树,将该树转换为它的镜像,
题目博客:http://blog.youkuaiyun.com/v_JULY_v/article/details/6057286题目:
2014-05-24 17:04:34
477
原创 No_14输入一个已经按升序排序过的数组和一个数字
题目博客:http://blog.youkuaiyun.com/v_JULY_v/article/details/6057286题目:在数组中查找两个数,使得它们的和正好是输入的那个数字。要求时间复杂度是O(n)。如果有多对数字的和等于输入的数字,输出任意一对即可。例如输入数组1、2、4、7、11、15和数字15。由于4+11=15,因此输出4和11代码为:#coding=
2014-05-24 16:47:23
724
原创 NO_10 翻转句子中单词的顺序。
题目博客:题目:输入一个英文句子,翻转句子中单词的顺序,但单词内字符的顺序不变。句子中单词以空格符隔开。为简单起见,标点符号和普通字母一样处理。例如输入“I am a student.”,则输出“student. a am I”。代码为:#coding=utf-8'''Created on 2014年5月24日@author: Administrator
2014-05-24 16:28:27
516
原创 NO_9判断整数序列是不是二元查找树的后序遍历结果
题目博客:http://blog.youkuaiyun.com/v_JULY_v/article/details/6057286题目:题目:输入一个整数数组,判断该数组是不是某二元查找树的后序遍历的结果。如果是返回true,否则返回false。例如输入5、7、6、9、11、10、8,由于这一整数序列是如下树的后序遍历结果: 8 / /
2014-05-24 15:55:21
899
原创 NO_4在二元树中找出和为某一值的所有路径
题目博客:http://blog.youkuaiyun.com/v_JULY_v/article/details/6057286
2014-05-24 14:28:39
530
原创 求子数组的最大和(数组)
题目博客:http://blog.youkuaiyun.com/v_JULY_v/article/details/6057286题目:输入一个整形数组,数组里有正数也有负数。数组中连续的一个或多个整数组成一个子数组,每个子数组都有一个和。求所有子数组的和的最大值。要求时间复杂度为O(n)。例如输入的数组为1, -2, 3, 10, -4, 7, 2, -5,和最大的子数
2014-05-24 13:49:29
541
原创 第二题:设计包含min函数的栈
题目博客:http://blog.youkuaiyun.com/v_july_v/article/details/6870251题目:
2014-05-24 13:11:09
476
原创 第一题:把二元查找树转变成排序的双向链表
题目博客:http://blog.youkuaiyun.com/v_JULY_v/article/details/6057286题目:
2014-05-24 11:23:27
527
原创 NO_Goldbach's other conjecture
题目:It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square.9 = 7 + 21215 = 7 + 22221 = 3 + 23225 = 7 + 23227 = 19 +
2014-05-23 09:42:23
584
原创 No_45_Triangular, pentagonal, and hexagonal
题目:Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:Triangle Tn=n(n+1)/2 1, 3, 6, 10, 15, ...Pentagonal Pn=n(3n1)/2 1, 5, 12, 22, 3
2014-05-18 21:41:10
621
原创 44Pentagon numbers Problem 44
题目:Pentagonal numbers are generated by the formula, Pn=n(3n1)/2. The first ten pentagonal numbers are:1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...It can be seen that P4 + P7 = 22 + 70 = 92 =
2014-05-15 17:19:02
674
原创 No_43Sub-string divisibility
题目:The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property.L
2014-05-14 16:29:09
759
原创 No42_Coded triangle numbers
题目:The nth term of the sequence of triangle numbers is given by, tn = ½n(n+1); so the first ten triangle numbers are:1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...By converting each letter in a word
2014-05-14 14:27:05
522
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人