摘要: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font 阅读全文
posted @ 2016-09-27 21:32 weller 阅读(827) 评论(1) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2016-09-23 09:44 weller 阅读(262) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文
posted @ 2016-09-21 15:08 weller 阅读(189) 评论(0) 推荐(0) 编辑
摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single 阅读全文
posted @ 2016-09-20 21:58 weller 阅读(217) 评论(0) 推荐(0) 编辑
摘要: Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 在这里介绍python中字符串翻转的几种方法: 1.步 阅读全文
posted @ 2016-08-21 21:46 weller 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 新建一个对象的方法有以下几种: Person.objects.create(name=name,age=age) p = Person(name="WZ", age=23) p.save() p = Person(name="TWZ") p.age = 23 p.save() Person.obje 阅读全文
posted @ 2016-07-25 15:56 weller 阅读(631) 评论(0) 推荐(0) 编辑
摘要: 一、在运行一个django程序时,无法创建自定义model相应的表。 我检查seetings.py文件,发现自定义的app,blog已经写到INSTALLED_APPS中, 执行:python manage.py syncdb,结果显示:unknown command : 'syncdb'。 查询后 阅读全文
posted @ 2016-07-19 12:34 weller 阅读(840) 评论(0) 推荐(0) 编辑
摘要: 1.打开pip的文档官网 https://pip.pypa.io/en/stable/ ,进入installation。在installation里,我们需要的是get-pip.py这个脚本。 选中后下载,我把它另存到C盘。 2.打开cmd命令行,打开C盘根目录并运行get-pip.py脚本。当然, 阅读全文
posted @ 2016-07-12 14:03 weller 阅读(736) 评论(5) 推荐(0) 编辑
摘要: 简洁既是美,程序员应尽量尝试编写简洁的表达式,争取用简单的代码来实现更多的功能,当然,这也要看情况了(有时候也得考虑程序运行的时间嘛)。 在阅读C++Prime Plus到while语句时有一个讲一个数组内容复制到另一个数组的例子: //arr1 is an array if ints int *s 阅读全文
posted @ 2016-05-27 18:58 weller 阅读(684) 评论(0) 推荐(0) 编辑
摘要: 在C++中,我们不能用数组直接初始化另一数组,而只能创建新的数组,然后显式的把原数组的元素逐个复制给新的数组。 按照C语言中的做法: 1 const size_t arry_size=6; 2 int int_arry[arry_size]={0,1,2,3,4,5}; 3 int int_arry 阅读全文
posted @ 2016-05-27 18:53 weller 阅读(8541) 评论(0) 推荐(1) 编辑