8/17/2007

Function tips, calltip in scite

让SciTE能够和IDE一样进行成员提示


今天发现SciTE可以和IDE一样在输入"."之后显示系统API的成员.本文最后的英文介绍了怎样生成供SciTE使用的API文件.当然你也可以下载别人生成的API.我一般用SciTE编写Python代码,那么我就用怎么使用python.api为例来介绍.首先下载下面的生成python API的脚本,双击运行,运行完成之后会生成一个python.api的文件,将python.api拷贝到scite的目录中,然后在SciTE的选项菜单中选择User Options,将打开一个用户个人设置文件,然后将下面的代码拷贝到里面
api.*.py=$(SciteDefaultHome)/python.api
api.*.pyw=$(SciteDefaultHome)/python.api
autocomplete.choose.single=1
autocomplete.python.ignorecase=1
autocomplete.python.start.characters=.
autocomplete.python.fillups=(
#autocompleteword.automatic
calltip.python.ignorecase=1
calltip.python.word.characters=._$(chars.alpha)$(chars.numeric)

保存后重新打开SciTE就行了,另外这个用户配置文件一般在你个人主目录里面.可以看看我的效果.在这里可以下载C/C++ Windows API,Opengl API, java的API,以及其他很多语言的API文件.

The .api files can be generated by hand or by using a program. There are also downloadable ready-to-use .api files.

For C/C++ headers, an API file can be generated using ctags and then the tags2api Python script (which assumes C/C++ source) on the tags file to grab complete multiple line function prototypes. Some common headers surround parameter lists with a __P macro and may have comments. The cleanapi utility may be used on these files.

To generate an API file for Python modules, there is a gen_python script.

To generate an API file for Java classes, there is a ApiBuilder.java program.

7/26/2007

Gunbuntu tips and tricks

http://ubuntuguide.org/wiki/Ubuntu:Feisty

Display Icons on the desktop Linux Ubuntu

In Ubuntu Dapper Drake, there’s no trash icon in the Desktop, it’s in the bottom panel right side. In this article I’m going to explain how to show the Trash icon in the Desktop. Type the following:

gconf-editor &

a window will pop up, with the gnome registry:

There will be a panel in the left side.

Go to apps->nautilus->desktop and click on the variable trash_icon_visible and you’ll get the Trash in your desktop. See the screenshot below:

7/23/2007

Django Chapter 4 Environment variable DJANGO_SETTINGS_MODULE is undefined

Try:
import django.conf
django.conf.settings.configure()
from django.template import Template

7/16/2007

Datetime in Python

from datetime import date, timedelta
print date.today()
print date.today() - timedelta(1)

7/14/2007

DATETIME and TIMESTAMP in MySQL database

They have the same format (YYYY-MM-DD HH:MM:SS).
TIMESTAMP has the autoupdate function. When you update a row in a table, the timestamp will be updated automatically. DATETIME won't get updated until you specify the value.