小楼一夜---听春雨
百度空间 | 百度首页 
               
 
文章列表
 
2009-07-11 16:36
先安装 python-memcached   
easy _install python-memcached  


# -*- coding: utf-8 -*-

import time
from beaker.cache import CacheManager

mem_manager = CacheManager(type="memory")
mem_cache = mem_manager.get_cache("test")

mc_manager = CacheManager( type="ext:memcached",url="127.0.0.1:11211", lock_dir="./mcd_lock")
mc_cache = mc_manager.get_cache("test")
 
2009-07-08 10:22
http://pylonsbook.com/en/1.0/index.html
 
2009-07-07 19:00


from pyPgSQL import PgSQL

#host:port:database:user:password:options:tty

src_db_conn_str = "ip:5432:dbname:username:password"

dst_db_conn_str = "ip:5432:dbname:username:password"



src_db = PgSQL.connect(src_db_conn_str)

dst_db = PgSQL.connect(dst_db_conn_str)

src_cursor = src_db.cursor()

dst_cursor = dst_db.cursor()

src_cursor.execute("select tablename from pg_table
 
2009-07-07 18:55

2.9 Selecting Random Elements from a List Without Repetition
不用循环从一个list中选择随机的元素

Credit: Iuri Wickert, Duncan Grisby, Steve Holden, Alex Martelli

2.9.1 Problem
问题

You need to consume, in random order, the items of a rather long list, and the most direct approach is painfully slow.
你需要按随机顺序处理一个相当长的list的条目并且多数直接的方法是慢的令人痛苦。

2.9.2 Solution
解决

While it's a common mistak
 
2009-06-29 09:08

You dont need anything special with pylons (0.9.7), it all works out of the box:

from pylons import request, response

#set a cookie
response
.set_cookie
 
2009-06-27 17:14
  1. db_tst=# begin;  
  2. BEGIN  
  3. adchap_tst=# ALTER SEQUENCE fb_fy_user_id_seq RESTART WITH 7876;  
  4. ALTER SEQUENCE  
  5. db_tst=# select nextval('fb_fy_user_id_seq');  
  6. nextv
 
2009-06-23 18:25

来自Tiny ERP 中文知识库

系统要安装在windows2000/xp 上,不能安装在win98/me上因为postgerSQL8在其上有问题。整个安装过程需要一定的时间给点耐性。那么开始。

 
2009-06-23 17:57


pyGtk的界面:


Python除了默认的Tk图形界面库以外,还有许多其他的选择,比如基于GTK的Python实现pyGTK,还有基于Qt的Python实现pyQt,两者分别能够运行在GNOME和KDE环境中,不需要安装额外的运行环境。
 
2009-06-19 14:02
在A和B都安装rsync :
A为数据服务器,B为备份服务器。
修改A机器上 vi /usr/local/etc/rsyncd.conf

pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
uid = nobody
gid = nobody
use chroot = no
max connections = 4
log file = /var/log/rsyncd.log
[test]
comment = web server backup
#path = /usr/local/www/ligdata/test
path = /usr/local/www/test
auth users = tonny
read only = true
list =no
hosts allow =192.168.0.58,127.0.
 
2009-06-12 12:05
晚上下班后路上突然冒出一个想法 ,想吃鱼,很久没有做陈氏招牌鱼了,不过今天去想做个清蒸鱼,回想当年为了一个爱吃鱼的姑娘学了17种不同的做鱼手法,如今虽然伊人离去,但是做鱼的本事还是保存下来了。顺路(回家不用经过的,特地去饶一下)去菜场买了一条活杀白水鱼(12元/斤,14元),再买了一袋姜和一小袋蒜。然后就回家了,到家已是18:40了。

      做饭跟做项目一样,当然是需要统筹规划的,从小是长在鱼米之乡,对做鱼是信手捏来的,何况当年还特训过。

1、简单洗一下鱼,冲刷去血
 
     
 
 
个人档案
 
terry8124

上海 浦东新区 
上次登录:
3天前
加为好友
 
   
 
文章分类
 
 
 
 
 
 
 
 
 
Python(81)
 
 
Apache(11)
 
Linux(16)
 
 
 
 
Lvs(2)
 
 
 
Pgsql(13)
 
Bsd(39)
 
 
 
 
     
 
最新评论
 
文章评论|照片评论

 

哇!好深奥,不懂!
 

高手!厉害~
 
 

有贷款就说明有房子了啊,也不错。。
 
     
 
好友最新文章
 
     
 
最近访客
 
 

一条龙一个人

lizhongwen0129

upc_chen

孤独E叶舟

爱听音乐木奇丁

wschao2005

南溪云

suyupin
     
 
其它
 
已有人次访问本空间
 
订阅RSS  什么是RSS?

您也想拥有这样的空间?请点此申请。
     


©2009 Baidu