摘要: Python2中的urllib模块,在Python3中被修改为20.5. urllib.request — Extensible library for opening URLs20.6. urllib.response — Response classes used by urllib20.7. urllib.parse — Parse URLs into components20.8. urllib.error — Exception classes raised by urllib.request20.9. urllib.robotparser — Parser for robots.t 阅读全文
posted @ 2012-07-19 00:59 呆头鱼 阅读(4650) 评论(0) 推荐(0) 编辑
摘要: 实数包括有理数和无理数。 其中无理数就是 无限不循环小数 ,有理数就包括无限循环小数、有限小数、 整数 。 阅读全文
posted @ 2012-07-09 23:21 呆头鱼 阅读(718) 评论(0) 推荐(0) 编辑
摘要: 获得session的sid<?phpsession_start();$sid = session_id();?>客户端在传输过程中,传输$sid服务器端代码设置接收到的$sid<?phpsession_id($sid);session_start();?>参考链接: http://www.phpiask.com/?p=336/ 阅读全文
posted @ 2012-06-28 17:16 呆头鱼 阅读(138) 评论(0) 推荐(0) 编辑
摘要: echo sprintf("%03d", 1); //output: 001 阅读全文
posted @ 2012-06-26 09:44 呆头鱼 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 通过yum 安装好apr的相关包后,编译安装httpd,报apr相关的错误,把yum安装的apr包卸载,从http://apr.apache.org/ 上下载APR和APR-util两个包,先编译安装APR,然后在编译APR-util加上--with-apr=path(安装apr的路径)项,再编译httpd,加入-with-apr=path(apr的安装路径)和-with-apr-util=path(apr-util的安装路径),不再报错。 阅读全文
posted @ 2012-06-25 19:57 呆头鱼 阅读(829) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head><meta charset="UTF-8"><title>Insert title here</title><script type="text/javascript">window.onload = function () { var date = new Date(); var month = date.getMonth()+1; if(month<10) month = "0"+mont 阅读全文
posted @ 2012-06-05 13:13 呆头鱼 阅读(1613) 评论(0) 推荐(0) 编辑
摘要: 最近项目中用到oracle,但对oracle不熟,平时工作用的fedora安装oracle也一直无法正常使用,在oracle官网上发现有instantclient的oracle客户端,一共安装了三个文件: oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.i386.rpm oracle-instantclient11.2-devel-11.2.0.3.0-1.i386.rpm oracle-instantclient11.2-basic-11.2.0.3.0-1.i386.rpm在运行sqlplus时,会报找不到libsqlplus.so的错误,运行l 阅读全文
posted @ 2012-06-04 13:33 呆头鱼 阅读(2454) 评论(0) 推荐(0) 编辑
摘要: 查看表的索引show keys from tablename为表添加索引create index indexname on tablename ( column1, column2)删除表的索引drop index indexname on tablename添加主键索引alter table tablename add primary key ( column1 ) 阅读全文
posted @ 2012-04-09 14:02 呆头鱼 阅读(191) 评论(0) 推荐(0) 编辑
摘要: filename: conmysql.ccompile command: gcc -o connection -g conmysql.c -lz /home/wangwei/workspace/tcpl/lib/libmysql.so.16.0.0 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include "include/mysql.h" 4 int errorno; 5 int main(int argc, char *argv[]) { 6 MYSQL *conn_ptr; 7 conn_ptr 阅读全文
posted @ 2011-12-01 01:00 呆头鱼 阅读(242) 评论(0) 推荐(0) 编辑
摘要: $test_string = 'this is a "test as" string juventus vs "napoli" is b a bing match';echo convertQuotToChinese($test_string); function convertQuotToChinese($string) { $flag = false; //false显示开始的中文引号,true时显示结束的中文引号 while(false !== ($i = strpos($string, '"'))) { 阅读全文
posted @ 2011-11-30 18:23 呆头鱼 阅读(1628) 评论(1) 推荐(0) 编辑