呵呵,有点搓,又犯个小错误

This item was filled under [ 一步一步学习中 ]

对于类的调用:后面要加()
class A:
pass

a=A() #才ok,要不然会报出个,不好找的异常

Bookmark and Share

cpedialog的login.py中的小问题

This item was filled under [ 一步一步学习中 ]

在本地调试时发现
类LostPassword 的一个bug
恩在重置密码时,发邮件的 message.body 的参数有问题

将urllib.urlencode改为 urllib.urlencode({‘email’:user.email})[6:]
urllib.urlencode的参数格式要求是要map的。。。


不过不知道要求的具体参数是要什么格式的,我在本地调试的时候,没有一封邮件有发送到邮箱的,还是因为是在本地调试有这个问题呢。。。

我的邮箱是ljy080829 在 gmail.com上的 把“在换成@
有知道的告诉我一下谢谢

Bookmark and Share
Tagged with: [ , , ]

google app engine 中import yaml问题的解决

This item was filled under [ 一步一步学习中 ]

转自:http://bluedusk.javaeye.com/blog/341832

通过代理上传Google App Engine 应用

这个是Google app engine的一个issue:

Seems to be no support for proxy in appcfg.py

http://code.google.com/p/googleappengine/issues/detail?id=126

解决方案:[Windows]

1、在命令行中Set evironment variables:

set http_proxy=http://proxy.blah.com.au:3128

set https_proxy=https://proxy.blah.com.au:31

C:\PROGRA~1\Google\GOOGLE~3>set https_proxy=https://proxy.blah.com.au:3128/

http_proxy=http://proxy.blah.com.au:3128/

2、下载Change the appcfg.py file:

http://googleappengine.googlecode.com/issues/attachment?aid=-622907771208491476&name=appcfg.py

替换掉:

C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py

appcfg.py

59.6 KB Download

3、如果替换后出现如下错误:

I replaced the appcfg.py file and now i get this error…

Traceback :

File “C:\Program Files\Google\google_appengine\appcfg.py”, line 53, in

from google.appengine.api import appinfo

File “C:\Program Files\Google\google_appengine\google\appengine\api\appinfo.py”,

line 31, in

from google.appengine.api import validation

File “C:\Program Files\Google\google_appengine\google\appengine\api\validation.py”,

line 44, in

import yaml

ImportError: No module named yaml

就要安装yaml:

C:\Program Files\Google\google_appengine\lib\yaml>python setup.py install

[To solve the yaml trouble you have to install yaml, as described in

\lib\yaml\README]

4、如果还有认证的问题:

Then to solve the authenticated proxy trouble, I used the arthurfreeman’s appcfg.py

and I’ve tried to modify it according to elspoono suggestion, but I still had

troubles with my corporate NTLM authenticated proxy, then I’ve installed and

configured ntlmaps proxy and finally solved! (using the original arthurfreeman’s

appcfg.py)

http://ntlmaps.sourceforge.net/

This Python proxy hides every issue about authenticated NTLM proxy, before running it

you have to input some infos in server.cfg file:

- port for ntlmaps listener

- your real proxy address

- your real proxy authentication domain/account/password

- your machine’s nt_hostname

- friendly ips (in this case your machine ip)

Then , running the ntlmaps proxy on port 5865, I’ve configured the environment

variables in this way:

set https_proxy=https://localhost:5865

set http_proxy=http://localhost:5865

and finally succeed in uploading my first application in google app engine!

5、这下该可以了吧!!:)

Bookmark and Share

ubuntu下tty的zhcon配置

This item was filled under [ 一步一步学习中 ]

原文章地址:http://www.casparant.com/tty-configuration-under-ubuntu.html

解决了的问题:1.tty下显示中文,2.支持中文输入,3.合适的分辨率,4.关闭终端响铃
第一步:打开FrameBuffer模块
参考网址:http://blog.chinaunix.net/u/12679/showart_513111.html
编辑文件:

sudo vi /etc/initramfs-tools/modules

加入三行内容:
fbcon
vesafb
vga16fb
编辑文件:

sudo vi /etc/modprobe.d/blacklist-framebuffer

把以下两行给注释掉:
blacklist vesafb
blacklist vga16fb
编辑文件:

sudo vi /boot/grub/menu.lst

在启动条目的内核项后面加入vga=xxx参数
xxx所代表的值可以用下面的方法来查看:

sudo hwinfo –framebuffer | grep ‘1280 ‘

这是我机子上的结果: Mode 0×0307: 1280×1024 (+1280), 8 bits
Mode 0×031a: 1280×1024 (+2560), 16 bits
Mode 0×031b: 1280×1024 (+5120), 24 bits
Mode 0×0379: 1280×768 (+1280), 8 bits
Mode 0×037a: 1280×768 (+2560), 16 bits
Mode 0×037b: 1280×768 (+5120), 24 bits

选择1280×1024的分辨率,16位色,所以应该在vga=后面加上0×031a
恩,你要用时要去网上查下自己显示器的最佳分辨率
在选择
第二步,安装支持中文的控制台zhcon并启动

sudo apt-get install zhcon

引用
chenjihua说:这里缺少了一步:

sudo update-initramfs -u

如果不做这一步,重启后会无法正常显示控制台。

重启后,
在tty状态下输入命令

zhcon –utf8 –drv=fb

在很多网页上提到使用–drv=vga参数来启动zhcon,这样做在我的机子上显示的分辨率是640×480,我希望有一个我看着比较舒服的大分辨率,所以我使用–drv=fb参数来启动zhcon
第三步,优化
化简zhcon启动的参数:
在~/.bashrc中增加一行,

alias zhcon=’zhcon –utf8 –drv=fb’

这样在启动zhcon时只需要输入zhcon即可。
设置zhcon开机自动启动:
在~/.bashrc中增加一行,

[[ $(tty) == /dev/tty[0-9]* ]] && zhcon

不过这个方法只针对当前用户,即对tty登入时的帐户下的~/.bashrc设置这行才有效。
第四步,中文输入法支持
zhcon中可以输入中文。Ctrl+Space即可。
第五步,关闭终端响铃
因为有时候电脑要在课上用,所以关闭system bell还是很有必要的。
网上找了半天,找到一个softbeep的软件,摆弄半天还是没成功。
狗狗告诉我,把pcspeaker这个模块给-r掉,我找了一下,Ubuntu没这个模块。
继续google,发现Ubuntu这个模块名字叫pcspkr,给它blacklist了算了。

sudo vi /etc/modprobe.d/blacklist

添加一行

blacklist pcspkr

搞定。

Bookmark and Share

ubuntu 更换软件主程序

This item was filled under [ 一步一步学习中 ]

sudo update-alternatives –config 程序名

更换主程序

Bookmark and Share

python socket.error: (98, 'Address already in use')

This item was filled under [ 一步一步学习中 ]

Traceback (most recent call last):
File “google_appengine/dev_appserver.py”, line 60, in <module>
run_file(__file__, globals())
File “google_appengine/dev_appserver.py”, line 57, in run_file
execfile(script_path, globals_)
File “/home/a/google_appengine/google/appengine/tools/dev_appserver_main.py”, line 474, in <module>
sys.exit(main(sys.argv))
File “/home/a/google_appengine/google/appengine/tools/dev_appserver_main.py”, line 453, in main
static_caching=static_caching)
File “/home/a/google_appengine/google/appengine/tools/dev_appserver.py”, line 3209, in CreateServer
return BaseHTTPServer.HTTPServer((serve_address, port), handler_class)
File “/usr/lib/python2.5/SocketServer.py”, line 330, in __init__
self.server_bind()
File “/usr/lib/python2.5/BaseHTTPServer.py”, line 101, in server_bind
SocketServer.TCPServer.server_bind(self)
File “/usr/lib/python2.5/SocketServer.py”, line 341, in server_bind
self.socket.bind(self.server_address)
File “<string>”, line 1, in bind
socket.error: (98, ‘Address already in use’)

这个问题,主要是没把上一个项目关闭

解决方法,把终端关了,再开,或者把用户注销下下

Bookmark and Share
Tagged with: [ , ]

被GAE的yaml电到。。。

This item was filled under [ 一步一步学习中 ]

额额,配yaml的时候发现要位置匹配正确才ok,连空格都是必须的。。。

Bookmark and Share

imagetoolbar

This item was filled under [ 一步一步学习中 ]

在HEAD中加入
<META   HTTP-EQUIV=”imagetoolbar”   CONTENT=”no”>

可以使用户浏览网页图片时不出现复制的按钮

Bookmark and Share

cscope 常用命令

This item was filled under [ 一步一步学习中 ]

cscope的主要功能是通过同的子命令”find”来实现的
“cscope find”的用法:
cs find c|d|e|f|g|i|s|t name

0 或 s 查找本 C 符号(可以跳过注释)
1 或 g 查找本定义
2 或 d 查找本函数调用的函数
3 或 c 查找调用本函数的函数
4 或 t 查找本字符串
6 或 e 查找本 egrep 模式
7 或 f 查找本文件
8 或 i 查找包含本文件的文件
Bookmark and Share
Tagged with: [ , ]

vim,Tlist使用要点

This item was filled under [ 一步一步学习中 ]

1、在查看源码前,需使用ctags生成函数和变量信息文件tags
#cd test
#ctags -R
#ls tags
tags
#vim test.c
2、在Vim下使用TlistToggle 或者说Tlist命令切换耿函数列表开关,按住ctrl键不放同时再按两下w键(^WW),在编辑区与tags区切换,在tags区使用方向键选择函数,再回车键就会在编辑区找到函数定义。
如果有tags区选择了不是打开程序中函数,可以用ctrl+]查看,按ctrl+O返回到原文件。

Bookmark and Share
Tagged with: [ , , ]
Page 1 of 612345»...Last »