疯子,快乐!
2007/11/30
2007/11/18
恢复更新!
主机的问题其实很久以前就搞定了,用了非主流的办法:
p.s. 和自己希望的工作失之交臂,遗憾遗憾。9月来一直奔波劳碌(似乎从05年开始了),遗弃了一些乐趣。舍得。会好起来的,加油。
- windows下常规AMP(Apache/MySQL/PHP)的设置
- 将域名monkey.za.org通过everyDNS绑定到网关,再对Router 做NAT映射到内网主机(似乎有更好的办法,router做DNS映射到内网,有熟悉的麻烦告知~谢谢谢谢)
- 安装openssh到同一windows主机,并做好NAT映射及SFTP的设置
- 在Blogger将Publish设置为SFTP
p.s. 和自己希望的工作失之交臂,遗憾遗憾。9月来一直奔波劳碌(似乎从05年开始了),遗弃了一些乐趣。舍得。会好起来的,加油。
Kid/Genshi great tips!
Tag:
Turbogears
友好的界面设计方法
因为写的模板是标准的 XHTML,所以我们可以直接用浏览器打开 Kid/Genshi 模板文件。这很重要而且很有用,可以保证你的模板在浏览器中看起来美观。
你可以从中观查你的样式表、JavaScript脚本、以及应该出现动态内容的部分,是不是同你设想的一样。
有时候,当你直接浏览模板文件或执行后的模板文件时,它们可能不能正确的链接到它们的样式表文件。要避免这个,你可以使用 href 标识要浏览的模板、使用 py:attrs 处理执行后的页面。例如:
这样再在浏览器中查看模板的话,浏览器只会去查找 href 属性,这样的话样式表就会正确的被载入了。
你犯下了交流十个错误了吗?
Tag:
lifehacker
如果想做好的话,交流是门艺术。这是个很大的论题并且有很多完善点因为它将影响你的个人生活和职业生涯。本文将会有点用处。Henrik给我 有关交流技巧的文章 以介绍常犯的错误及解决办法。
- 不去聆听
- 问太多问题
- 原则性太强以致顽固
- 讲话无风度(Poor delivery)
- 跑题(Hogging the spot-light)
- 自己必须是正确的
- 选择奇怪或消极的话题
- 言论无趣
- 无交互性
- 无建设性
不错的常归错误的总结
绝大多数的错误不会真正让人远离交流,但是“自己必须是正确的”可一定会。交流不是争胜或者定义谁是“正确”的。如果某人这样对我,那么我会将其归结为辩论模式进而坚决避免和他/她交谈。
对你来说,哪条错误是最致命的?
Do you make these 10 mistakes in a conversation? - [The Positivity Blog]
living in ipython
Tag:
python
介绍:
在命令行或者使用%logstart在interpreter。%logstate可以显示当前log的状态
%logoff可以暂停记录,%logon恢复
继续某次会话可以通过命令行使用 -logfile
对象自省
自省可以像标准python那样
?是个快捷键
例子
其他技巧
- ipython是什么?
- 为什么要用它?
- 用户可以马上输入代码看到结果
- 自省
- 尽管很有用可是在实际的使用中还是有些地方可以改进!
- 提供一个更好用的python interactive shell
- 可嵌入的interpreter
- 提供一个框架可以在不同操作系统将pythono作为一个底层语言的基本环境
- 以%开头的行认为恶事magic命令
- 一般的shell比如ls,mkdir等均为magic命令
- %alias 命令可以建新的别名
- automagic模式打开后,%都不需要。在把名利提交给python interpreter都会自动分析是否是在magic命令的list中
- %magic 看 关于magic命令的更多信息
- 命令补全
- 变量名补全
- object.
可以对象属性补全 - 一些场合可以自动补全文件或目录
- 不同session 和每个用户配置文件都有
- %hist显示最近历史
- -n 选项可以上翻n条历史
- 可以告诉%hist显示特定行
- 历史一般都存储在 In 的list里
- 输出 存储在 Out 的list里
- 最后3个命令 分别为 _i,_ii,_iii
- 最后3个输出 分别为 _, __, ___
看看例子: In [1]: True == False Out[1]: False In [2]: print "hello world" hello world In [3]: %hi %hist %history In [3]: %hist 1: True == False 2: print "hello world" In [4]: In Out[4]: ['\n', 'True == False\n', 'print "hello world"\n', 'ipmagic("%hist ")\n', 'In\n'] In [5]: Out Out[5]: {1: False, 4: ['\n', 'True == False\n', 'print "hello world"\n', 'ipmagic("%hist ")\n', 'In\n', 'Out\n'], 5:编辑} In [6]: print _i, _ii, _iii, _, __, ___ Out In ipmagic("%hist ") {1: False, 4: ['\n', 'True == False\n', 'print "hello world"\n', 'ipmagic("%hist ")\n', 'In\n', 'Out\n', 'print _i, _ii, _iii, _, __, ___\n'], 5: {...}} ['\n', 'True == False\n', 'print "hello world"\n', 'ipmagic("%hist ")\n', 'In\n', 'Out\n', 'print _i, _ii, _iii, _, __, ___\n'] False
- 支持行编辑,默认为vi键绑定。可以按 ESC 允许行被编辑
- 允许方便编辑所以代码
- %edit调出 环境变量EDITOR定义的编辑器
- %edit star stop 可以对某一区域编辑
In [4]: hist 1: class A: def __init__(self, start, end): """Some comment here.""" 2: a = 1 3: b = 2 4: c = 0%edit Will open up an empty editor %edit 2 4 Will open an editor containing lines 2 and 4 %edit 1 Will open up the class definition %edit 1:4 w Will open up the editor with lines 1, 2 and 3 会话和日志 每次使用后会话都有记录。并且可以重放会话快速恢复到上次会话的最后状态 开始记录日志可以使用 -log 或 -logfile
In [2]: sys.path? Type: list Base Class:String Form: ['', '/usr/bin', '/disk2/ag/common', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/pyt <...> 2.4/site-packages/Numeric', '/usr/lib/python2.4/site-packages/gtk-2.0', '/home/dstanek/.ipython'] Namespace: Interactive Length: 13 Docstring: list() -> new list list(sequence) -> new list initialized from sequence's items
In [1]: class C(object): ...: a = "a string" ...: def f(self, name, value): ...: """my docstring here""" ...: In [2]: C.a? Type: str Base Class: String Form: a string Namespace: Interactive Length: 8 Docstring: str(object) -> string Return a nice string representation of the object. If the argument is a string, the return value is the In [3]: ?C.f Type: instancemethod Base Class: same object. String Form: Namespace: Interactive File: /mnt/home/dstanek/ Definition: C.f(self, name, value) Docstring: my docstring here
- 集成调试器
- 集成profiler
- Python jobs can be run in the background in a thread.
- 支持配置文件
It's a good thing and is available at http://ipython.scipy.org/
A sprint to add other cool things may be a useful exercise.
To set ipython to be the default:Python honors the environment variable PYTHONSTARTUP and will execute at startup the file referenced by this variable. If you put at the end of this file the following two lines of code:
import IPython IPython.Shell.IPShell().mainloop(sys_exit=1)
订阅:
博文 (Atom)

