ITeye博客

waveeee的博客

waveeee · 共 46 篇文章

mysql freebsd my.cnf 设置

The Weblog of Titus Barik Let the love of learning rule humanity. my.cnf on FreeBSD 7 Uncategorized — @ Monday, May 26, 2008 FreeBSD does not automatically include a default my.cnf for MySQL . Instead, a set of sample configuration files can be found under /usr/local/share/mysql . These configurati…

2011-10-01 21:29 · db · Priv · 评论(0)

flask 备忘

写道 # -*- coding: utf-8 -*- """ Flaskr flaskr.py ~~~~~~ A microblog example application written as Flask tutorial with Flask and sqlite3. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import with_statement from sqlite3 import dbapi2 as sqlit…

2011-09-29 18:32 · Priv · 评论(0)

python 生成器 yield

def __xlsx2tuples(self, path): '''ganerator tuples from xlsx file ''' wb = load_workbook(path) sheets = wb.get_sheet_names() for sheet in sheets: ws = wb.get_sheet_by_name(sheet) for row in ws.rows: row_list = [] for cell in row: row_list.append(cell.value) yield tuple(row_list)

2011-08-04 15:25 · Priv · 评论(0)

流行的jQuery信息提示插件(jQuery Tooltip Plugin)

http://www.cnblogs.com/ywqu/archive/2010/01/31/1660597.html 流行的jQuery信息提示插件(jQuery Tooltip Plugin)

2011-06-16 15:34 · web-tech · 评论(0)

sqlrelay 文档

问题由来 Update 9/2008 Submitted by Joe (not verified) on Sat, 09/27/2008 - 19:47. You can always query multiple db's on the same server. To query multiple db's on different servers with a single query you need to either; combine the tables using federated tables, replication or temporary tables In thi…

2011-06-02 16:06 · 评论(0)

django 模板 深度变量的查找

一点提示: Python的列表是从0开始索引。 第一项的索引是0,第二项的是1,依此类推。 句点查找规则可概括为: 当模板系统在变量名中遇到点时,按照以下顺序尝试进行查找: 字典类型查找 (比如 foo["bar"] ) 属性查找 (比如 foo.bar ) 方法调用 (比如 foo.bar() ) 列表类型索引查找 (比如 foo[bar] )

2011-05-23 21:33 · Priv · 评论(0)

自省的威力

apihelper.py 程序和它的输出现在应该非常清晰了。 def info(object, spacing=10, collapse=1): """Print methods and doc strings. Takes module, class, list, dictionary, or string.""" methodList = [method for method in dir(object) if callable(getattr(object, method))] processFunc = collapse and (lambda s: " ".join(s.split…

2011-05-23 16:26 · Priv · 评论(0)

Pylons笔记(二)

第一天(继续) hellowold 1, 创建项目 paster create --template=pylons HelloWorld 使用默认选项即可 如果你想查看参数: paster -h paster create -h 2, 查看、修改配置 我把配置development.ini 改成 了base.ini方便输入。 修改一下base.ini [server:main] use = egg:Paste#http host = 0.0.0.0 port = 5000 3, 启动项目 paster serve --reload base.ini 访问一下 http://127.0.0.1…

2011-05-19 17:10 · Priv · 评论(1)

Pylons笔记(一)

工作上使用pylons有几个星期了,零零散散的,在这里整理一下。 第一天 环境 freebsd 8.1 python2.6.6 首先安装自己的环境运行环境。 一台机可以同时运行多个不同的环境,这样可以保证你的运行环境所包含的包,同时多个环境可以独立运行。 1,下载创建脚本 wget http://pylonsbook.com/virtualenv.py 2, 创建虚拟环境到指定目录env python virtualenv.py --no-site-packages /home/lign/env 3,安装pylons到你的env /home/lign/env/bin/easy_install…

2011-05-19 15:01 · Priv · 评论(0)

[转]FreeBSD的软件管理工具ports详解

[转]FreeBSD的软件管理工具ports详解 一、ports套件的安装 ①安装ports,我的FreeBSD8.0-release是最小化安装,所以没有ports,即也没用/usr/ports目录;选择启用ports的话,那么需要在root下输入"sysinstall"来安装它: 输入sysinstall --> 选择Configure --> Distributions --> ports,然后安装即可。 ②ports路径 ports的默认路径是/usr/ports,这个ports的根目录,下面有很多的文件夹及子文件夹,组成一个树状目录,包含大量ports下的软件: 这些即是套件的软件…

2011-05-13 17:51 · web-tech · 评论(0)

http://hi.baidu.com/24cool/blog/item/32f4e9f81c40c80dd9f9fddb.html

[转]10步完成freebsd下 python+django+fastcgi+lighttpd+sqlite3 源码安装与配置. 2007年07月31日 02:55 本文章作者寒玉轩,可任意转载。 转载时请注明:来自: htdocs.org 作者:寒玉轩 今日将vm虚拟服务器重新搞了一遍~系统换成了freebsd6.2 WEB服务器换成了lighttpd 感觉apache实在是太重的东西了。 python2.5+django0.96 全是最新的。 由于是lighttpd,当然选择fastcgi与django通讯咯~~ 数据库是sqlite-3.3.13, 本想用3.4.0的。但不知道为什么 …

2011-05-13 16:56 · web-tech · 评论(0)

egg

可爱的 Python: 使用 setuptools 孵化 Python egg http://www.ibm.com/developerworks/cn/linux/l-cppeak3.html

2011-05-08 22:17 · 评论(0)

Django新手需要注意的10个要点

http://shinyzhu.iteye.com/blog/593427 Django新手需要注意的10个要点 文章分类: Python编程 接触django是从上个月开始,学习python时间也不长,但我经常在社区看看别人发表的文章,早上看到一篇不错的博客,却一直不能访问,最终从bing的缓存里找到,因为害怕丢失和忘掉,所以顺便翻译过来,放到这里,同时也分享给大家,贡献给各位django初学的朋友们,希望能有一些帮助:) 原文地址是: http://zeroandone.posterous.com/top-10-tips-to-a-new-django-developer 1,不要将项目…

2011-04-16 16:15 · web-tech · 评论(0)

eclipse django === Pydev unresolved import errors

Pydev unresolved import errors June 12, 2009...... at 3:21 pm | Posted in geek | 16 Comments For those seeing a lot of Pydev unresolved import errors the problem is related to the fact that pydev doesn’t seem to register nested modules. So if your package contains a package which contains a module,…

2011-04-15 23:48 · 评论(0)

Python yield 用法

Python yield 用法 http://www.pythonclub.org/python-basic/yield yield 用法说明 yield 简单说来就是一个 生成器 , 生成器 是这样一个函数,它记住上一次返回时在函数体中的位置。对生成器函数的第二次(或第 n 次)调用跳转至该函数中间,而上次调用的所有局部变量都保持不变。 生成器 是 一个函数 函数的所有参数都会保留 第二次调用 此函数 时 使用的参数是前一次保留下的. 生成器还“记住”了它在流控制构造 生成器不仅“记住”了它数据状态。 生成器还“记住”了它在流控制构造(在命令式编程中,这种构造不只是数据值)中的位置。由于连…

2011-04-09 21:11 · Priv · 评论(0)