(一)关于模板,Template ????可以在项目根目录下的settings.py 配置文件中,声明 import?os
BASE_DIR?=?os.path.dirname(os.path.dirname(__file__))
TEMPLATE_DIRS?=?os.path.join(BASE_DIR,?‘temp...
分类:
编程语言 时间:
2014-08-09 00:22:37
阅读次数:
265
yasnippet可以把我们常用的代码段或文本储存起来,到使用的时候只需键入几个字母就会自动带出。比如我们在写python代码时,常常会在文件的第一行写下: #!/usr/bin/env python,经常这么手工键入是不是很没有效率,用yasnippet来帮你!方法:一、新建snippet 使用命...
分类:
其他好文 时间:
2014-08-09 00:04:06
阅读次数:
368
//// ViewController.m// JapaneseDictionary//// Created by apple on 14-8-7.// Copyright (c) 2014年 苹果IOS软件开发者. All rights reserved.//#import "ViewContro...
分类:
其他好文 时间:
2014-08-09 00:01:26
阅读次数:
406
Jedi 是个很棒的python的自动补全插件,可以显示docstring, function arguments and code location.安装步骤:一、安装python的虚拟环境sudo apt-get install python-virtualenv或sudo apt-get in...
分类:
其他好文 时间:
2014-08-08 23:56:46
阅读次数:
1234
提供了两种生成方法,一个是自己编程实现,比较灵活;另一个是调用系统的checkerboard函数,似乎只能生成8*8网格。至于用途,也许可以用来下国际象棋。自己函数生成:系统函数生成:代码如下:clear all;close all;clch=256;w=256;n=8;img=zeros(h,w)...
分类:
其他好文 时间:
2014-08-08 23:56:36
阅读次数:
396
Python中函数是一个对象, 和整数,字符串等对象有很多相似之处,例如可以作为其他函数的参数或返回对象, Python中的函数还可以携带自由变量, 两者无疑极大增进了Python的表达力.但是Python函数自由变量的内部机制和列表解析或for循环结合使用时却暗藏杀机:#---CASE 1fs =...
分类:
编程语言 时间:
2014-08-08 23:54:16
阅读次数:
330
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat...
分类:
其他好文 时间:
2014-08-08 23:52:12
阅读次数:
238
Encoded Barcodes
Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld
& %llu
Submit Status Practice UVALive
5029
Description
All the big malls need a powerful system f...
分类:
其他好文 时间:
2014-08-08 21:25:16
阅读次数:
302
Problem Description:
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())",...
分类:
其他好文 时间:
2014-08-08 21:20:46
阅读次数:
327
OperationResultlen(a) the number of items ina 得到字典中元素的个数a[k]the item ofawith keyk 取得键K所对应的值a[k] =vseta[k]tov 设定键k所对应的值成为vdela[k]removea[k]froma 从字典中删除...
分类:
编程语言 时间:
2014-08-08 20:55:36
阅读次数:
342