摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文
摘要:
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 阅读全文
摘要:
Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 在这里介绍python中字符串翻转的几种方法: 1.步 阅读全文
摘要:
新建一个对象的方法有以下几种: 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 阅读全文
摘要:
一、在运行一个django程序时,无法创建自定义model相应的表。 我检查seetings.py文件,发现自定义的app,blog已经写到INSTALLED_APPS中, 执行:python manage.py syncdb,结果显示:unknown command : 'syncdb'。 查询后 阅读全文
摘要:
1.打开pip的文档官网 https://pip.pypa.io/en/stable/ ,进入installation。在installation里,我们需要的是get-pip.py这个脚本。 选中后下载,我把它另存到C盘。 2.打开cmd命令行,打开C盘根目录并运行get-pip.py脚本。当然, 阅读全文
摘要:
简洁既是美,程序员应尽量尝试编写简洁的表达式,争取用简单的代码来实现更多的功能,当然,这也要看情况了(有时候也得考虑程序运行的时间嘛)。 在阅读C++Prime Plus到while语句时有一个讲一个数组内容复制到另一个数组的例子: //arr1 is an array if ints int *s 阅读全文
摘要:
在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 阅读全文