
Python/Ruby
文章平均质量分 53
iteye_9339
这个作者很懒,什么都没留下…
展开
-
php当作shell脚本使用
将PHP作为Shell脚本语言使用 本文出自:http://phpuser.com 作者: y10k翻译 (2002-10-15 06:02:00) --英文原著:Darrell Brogdon,发表于 http://www.phpbuilder.com/columns/darrell20000319.php3 可能很多人都想过使用PHP编写一些定时发信之类的程序,但是却没有办法定时执行P...2007-04-05 10:37:39 · 119 阅读 · 0 评论 -
python中处理中文编码问题
今天在尝试Python的CGI模块时遇到中文字符不能正确显示的问题,很郁闷.在网上仔细找了找,终于解决了这个问题,现在将解决方法陈述如下,以防下次失误. 页面源代码如下#-*- coding: utf8 -*-import cgitb , cgicgitb.enable()form = cgi.FieldStorage()if (form.has_key("...原创 2010-07-29 02:47:47 · 230 阅读 · 0 评论 -
file 'lib' not found when installing rails 3.1 on Mac OS X Lion
使用gem install rails安装rails时,一直出现file 'lib' not found的错误,经搜索采用以下步骤即解决了问题。$ rvm gemset install railsinstalling rails ...rails installed.$ rails -vRails 3.0.9 ...原创 2011-08-24 23:48:55 · 176 阅读 · 0 评论 -
使用rvm管理ruby版本
$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) # 安裝 rvmrvm list # 查看目前安裝的 ruby 版本rvm info # 查看目前使用的環境訊息rvm list known # 列出可以安裝的版本rvm install ruby-1.9.2-hea...原创 2011-08-24 23:43:05 · 182 阅读 · 0 评论 -
Heyes Template Class php模板引擎
程序名称:Heyes Template Class php模板引擎开发者/组织名称:Richard Heyes 运行环境:php官方网站:http://www.phpguru.org下载地址:http://www.phpguru.org/downloads/template/文章来源:http://www.osphp.com.cn程序介绍:一个非常容易使用,但功...原创 2010-09-11 19:08:37 · 606 阅读 · 0 评论 -
用python爬虫抓站的一些技巧总结
这些脚本有一个共性,都是和web相关的,总要用到获取链接的一些方法,再加上simplecd这 个半爬虫半网站的项目,累积不少爬虫抓站的经验,在此总结一下,那么以后做东西也就不用重复劳动了。 -1.最基本的抓站import urllib2content = urllib2.urlopen('http://XXXX').read()-2.使用代理服务器这在某些情况下...原创 2010-08-28 17:49:29 · 111 阅读 · 0 评论 -
一个通用的php正则表达式匹配或检测或提取特定字符类
在php开发时,日常不可或缺地会用到正则表达式,可每次都要重新写,有时忘记了某一函数还要翻查手册,所以,抽空写了一个关于日常所用到的正则表达式区配类,便于随便移置调用.(^_^有点偷懒). /*///////////////////////////////////////////////////////////// * 类MatchAll功能:主要用于php日常...2007-07-29 13:09:21 · 134 阅读 · 0 评论 -
php5的抽象方法和抽象类的理解
前两天去一公司面试,他们给了一份试卷来考核php的知识.整份试卷大至不是太难,就是最后有一题是"任意写一抽象类并写出调用过程",由于,平常对抽象类的概念不很清楚,所以,也不敢乱写...唉,没pass.. 这两天有点时间,看了看抽象类的资料,写一些对抽象方法和抽象类的理解,也算是亡羊补牢吧 :( 一. 面向对象程序通过类的分层结构构建起来. 在单重继承语言如PHP中, 类的继承是树...2007-07-11 23:18:25 · 158 阅读 · 0 评论 -
php初学者注意的问题(转)
【1】页面之间无法传递变量 get,post,session在最新的php版本中自动全局变量是关闭的,所以要从上一页面取得提交过来得变量要使用$_GET['foo'],$_POST['foo'],$_SESSION['foo']来得到 当然也可以修改自动全局变量为开(php.ini改为register_globals = On);考虑到兼容性,还是强迫自己熟悉新的写法比较好。 【2】Win32...2007-07-08 19:25:21 · 102 阅读 · 0 评论 -
在PHP5中类(CLASS)的新特征(转)
在PHP5中类(CLASS)的新特征/******************************/author:大龄青年 E_mail:wenadmin@sina.com/*****************************/ 字串1 php5新添加了好多的新函数和特征,但是在目前最新的chm的手册中都没有体现,要到在线的手册中查找,烦啊!!! 废话不多说了,来看看php5...2007-07-07 11:17:59 · 111 阅读 · 0 评论 -
windows 2000/xp/2003下安裝apache2.2.3 mysql 5.0.22 php 5.2.0(转)
先从网站上下载APACHE2.2.3 Mysql 5.0.22 PHP 5.2.0假设:系统盘为 c:/假设:安装好后目录状态会是这样子:apache--> C:\Program Files\Apache Software Foundation\Apache2.2mysql-->C:\Program Files\MySQL\MySQL Server 5.0php-...2007-07-07 01:19:56 · 152 阅读 · 0 评论 -
python fnmatch实现shell风格匹配模式来匹配特定的字符
今天看《Programming Python 3nd Edition》时,偶然看到fnmatch模块,于是查看了它的用法记录在此^_^Python 的fnmatch说明: fnmatch 实现shell patterns表匹配字符串或文件名 1,fnmatch.fnmatch(name, pattern)方法:测试name是否匹配pattern,返回true/false eg:...2007-07-05 15:57:39 · 276 阅读 · 0 评论 -
python 执行系统命令比较
在此比较一下两种方法执行系统命令的方法,以方便于日后运用:(1. os.system() system(command) -> exit_status Execute the command (a string) in a subshell. # 仅仅在一个子终端运行系统命令,而不能获取命令执行后的...2007-07-05 12:12:40 · 150 阅读 · 0 评论 -
python递归层次的RuntimeError
File "build/bdist.freebsd-6.2-RELEASE-i386/egg/MySQLdb/connections.py", line 163, in __init__RuntimeError: maximum recursion depth exceeded in cmppython..sys.setrecursionlimit(1500)未完待续......2007-05-23 10:15:28 · 144 阅读 · 0 评论 -
用mencoder进行任意视频格式转换成flv
在命令行下输入此行代码:mencoder file_of_input -o file_of_output -of lavf -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbit...2007-05-07 23:12:28 · 167 阅读 · 0 评论 -
学习资源
==============FastCGI的资源 ==============FastCGI技术官方网站: http://www.fastcgi.com FastCGI中文讨论组: http://www.ilcatperl.org 中国Perl组织: http://www.perlchina.org FastCGI技术案例: http://www.hotmail.com ht...2007-04-05 11:49:09 · 155 阅读 · 0 评论 -
Installing Phusion Passenger and nginx on Mac OS X
I was trying to install Phusion Passenger and nginx on Mac OS X 10.8.2, using the Passenger installer for nginx, and kept running into this error: $ passenger-install-nginx-module ... Und...原创 2013-03-08 18:04:52 · 292 阅读 · 0 评论