<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>zeevin&#039;s blog</title>
	<atom:link href="http://www.zeevin.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.zeevin.com</link>
	<description>do the best!</description>
	<lastBuildDate>Mon, 19 Mar 2012 02:32:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>php内网代理脚本</title>
		<link>http://www.zeevin.com/201203188.html</link>
		<comments>http://www.zeevin.com/201203188.html#comments</comments>
		<pubDate>Mon, 19 Mar 2012 02:32:04 +0000</pubDate>
		<dc:creator>zeevin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.zeevin.com/?p=188</guid>
		<description><![CDATA[适用于从80端口到内网其他防火墙内端口的访问。 &#160; &#60;?php /** *@name proxy.php *@author caokang &#60;caokang@foxmail.com&#62; *@copyright Copyright &#38;copy; 2012 */ $host = '192.168.161.10'; $port = 9621; $cgi = '/webcgi?'; $str=$_SERVER&#91;'QUERY_STRING'&#93;; &#160; &#160; $ch = curl_init&#40;&#41;; $options = array&#40; CURLOPT_TIMECONDITION=&#62;30, CURLOPT_TIMEOUT=&#62;60, CURLOPT_URL=&#62;$host.':'.$port.$cgi.$str, CURLOPT_RETURNTRANSFER=&#62;true, &#41;; curl_setopt_array&#40;$ch, $options&#41;; $rs = curl_exec&#40;$ch&#41;; curl_close&#40;$ch&#41;; echo $rs;]]></description>
		<wfw:commentRss>http://www.zeevin.com/201203188.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>webpy常见问题[转载]</title>
		<link>http://www.zeevin.com/201203185.html</link>
		<comments>http://www.zeevin.com/201203185.html#comments</comments>
		<pubDate>Fri, 02 Mar 2012 04:03:24 +0000</pubDate>
		<dc:creator>zeevin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.zeevin.com/?p=185</guid>
		<description><![CDATA[webpy使用mod_wsgi运行时会遇到一些特别的错误，搜索后发现这篇文章不错，里面的问题我有碰到的也有没碰到的。 原文如下： 1.所有的模板只能共享一个HTML标签,如&#60;HTML&#62;的,在其他地方不能有任何关于HTML信息之类的东西,如头文件,&#60;HTML&#62;,&#60;BODY&#62;之类的,否则出错,其它模板文件也一样 &#160; 2.模板注释一定要写在末尾,至少要在def with后面,否则会有莫名其妙的错误!不管什么情况,def with必须在第一行! 3.用mod_wsgi运行web.py时,要指明模板路径,否则显示错误:raise AttributeError, “No template named ” + name AttributeError: No template named index 解决: template_root = os.path.join(os.path.dirname(&#8216;D:/pythonStudy/WebpyStudy/projects/blogs/&#8217;), &#8216;templates&#8217;) render = web.template.render(os.path.abspath(os.path.dirname(&#8216;D:/pythonStudy/WebpyStudy/projects/blogs&#8217;))+&#8217;/templates/&#8217;, base = &#8216;base&#8217;, globals=t_globals)#这里要标明全局变量!!! 4.在web.py用到datestr: t_globals = { &#8216;datestr&#8217;:web.datestr } 运行打开http://localhost:8080/显示Invalid format string 错误显示datestr ValueError: Invalid format string 这时需要重新建表,即要把数据库之前创建的那个表先删除,再重新建立,我用Pycharm,换了一个主题(从Default改成monokai),跟这个有关 5.t_globals = dict( datestr = web.datestr, static = [...]]]></description>
		<wfw:commentRss>http://www.zeevin.com/201203185.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>windows下apache wsgi 方式安装web.py</title>
		<link>http://www.zeevin.com/201203172.html</link>
		<comments>http://www.zeevin.com/201203172.html#comments</comments>
		<pubDate>Thu, 01 Mar 2012 08:08:28 +0000</pubDate>
		<dc:creator>zeevin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.zeevin.com/?p=172</guid>
		<description><![CDATA[首先安装好wsgi模块并启用： 1.下载地址：我本机是python2.7  http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32-ap22py27-3.3.so 2.把mod_wsgi-win32-ap22py27-3.3.so放到apache安装目录下的modules目录下 3.打开 http.conf 添加：LoadModule wsgi_module modules/mod_wsgi-win32-ap22py27-3.3.so 下载安装web.py模块： 1.下载地址： http://webpy.org/static/web.py-0.36.tar.gz 2.解压到任意目录，进入目录python setup.py install，安装完毕后打开idle编辑器测试是否安装成功： &#62;&#62;&#62; import web &#62;&#62;&#62; urls= &#40;'/','index'&#41; &#62;&#62;&#62; app = web.application&#40;urls,globals&#40;&#41;&#41; &#62;&#62;&#62; class index: def GET&#40;self&#41;: return 'hello world!' &#160; &#62;&#62;&#62; app.run&#40;&#41; 在浏览器中浏览127.0.0.1:8080,查看是否能正常显示 开始设置 比如我以后想把试用web.py的程序都放在E:\python\web目录下，并且访问连接为:127.0.0.1/web 配置如下： ScriptAlias /web/ &#34;E:/python/web/&#34; &#160; &#60;Directory &#34;E:/python/web&#34;&#62; AllowOverride all Options Indexes FollowSymLinks ExecCGI Order allow,deny SetHandler [...]]]></description>
		<wfw:commentRss>http://www.zeevin.com/201203172.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>js正则表达式表单验证</title>
		<link>http://www.zeevin.com/201202156.html</link>
		<comments>http://www.zeevin.com/201202156.html#comments</comments>
		<pubDate>Fri, 10 Feb 2012 19:48:36 +0000</pubDate>
		<dc:creator>zeevin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.zeevin.com/?p=156</guid>
		<description><![CDATA[&#60;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&#62; &#60;html xmlns=”http://www.w3.org/1999/xhtml”&#62; &#60;head&#62; &#60;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8&#8243; /&#62; &#60;title&#62;js正则表达式匹配demo&#60;/title&#62; &#60;script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js”&#62;&#60;/script&#62; &#60;script type=”application/javascript”&#62; $(document).ready(function(){ /* 设置js正则表达式匹配规则,可以随意扩展,idcard,phone,num,required,alpha是验证规则名称，通过在相应的input字段添加validator属性生效。 比如validator=&#8217;alpha&#8217;,即为验证是否是字母，多个规则用&#8217;&#124;'连接，比如：validator=”required&#124;alpha&#124;upcase” 表示该字段不能为空、必须是字母，并且首字母大写。 下面的validate对象就是相应的规则定义。 */ var validate = new Array(); validate['idcard']= new Array(/^(\d{14}&#124;\d{17})(\d&#124;[Xx])$/,&#8217;格式不正确。&#8217;);//匹配身份证号码 validate['phone']= new Array(/(^1\d{10}$)&#124;(^\d{7,8}$)/,&#8217;电话号码格式不对。&#8217;);//电话号码只能是7或者8位数字 validate['num']= new Array(/^\d+$/,&#8217;不是数字&#8217;); //匹配数字 validate['required']= new Array(/^.+$/,&#8217;不能为空&#8217;);//是否为空 validate['alpha']= new Array(/^[a-zA-Z]+$/,&#8217;只能是字母&#8217;);//必须是字母 validate['upcase']= new Array(/^[A-Z]{1}/,&#8217;第一个字母要大写&#8217;); /* 促发验证规则 */ [...]]]></description>
		<wfw:commentRss>http://www.zeevin.com/201202156.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>solaris使用opencsw安装软件包</title>
		<link>http://www.zeevin.com/201112144.html</link>
		<comments>http://www.zeevin.com/201112144.html#comments</comments>
		<pubDate>Fri, 30 Dec 2011 09:03:23 +0000</pubDate>
		<dc:creator>zeevin</dc:creator>
				<category><![CDATA[Linux技术]]></category>
		<category><![CDATA[opencsw]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://www.zeevin.com/?p=144</guid>
		<description><![CDATA[在solaris下安装或者更新软件通常有3种方法： 1.下载源代码编译安装。 2.从sunfreeware.com下载pkg包，使用pkgadd安装。 3.下载pkg-get工具（类似于redhat的yum），在线更新软件包，这种方法其实是对第二种方法的自动化封装实现。 很多时候，我们要安装的软件依赖与其他一些的包，这是我们可以综合使用上面的三种方法： ①对于一些小的或者我们不打算定制安装的包使用方法2或者3安装，更快捷。 ②对于需要定制安装或者sunfreeware.com中未提供的包采用方法1安装。不幸的是，仍然有 一些软件包无法使用SunStutio（solaris提供的gcc编辑器）进行编译。通常是因为软件包在编译时只考虑gun gcc，没考虑SunStutio。这时我们必须使用gun gcc编译，我们需要设置以下环境变量： export CPP=”/usr/sfw/bin/gcc -E” export CC=/usr/sfw/bin/gcc export CXX=/usr/sfw/bin/g++ 然后再编译。但是问题又来了，我们的依赖包也许还要依赖其他的包，我们可能需要手工编译很多包最终才能成功！ so，opencsw降临! 她致力于解决这些问题。opencsw提供pkgutil包管理工具，通过在线的方式更新软件包，同时解决软件的依赖问题。 我们只需要两步设置： ①安装opencsw： pkgadd -d http://get.opencsw.org/now ，默认安装在/opt/csw/内 ②使用pkgutil安装软件包，比如：/opt/csw/bin/pkgutil &#8211;install libmagic,默认安装到/opt/csw/lib/下，然后建立相关库到/usr/local/lib/的链接或者添加/opt/csw/lib/到动态链接库环境变量.到这里一切ok，我们可以继续编译安装软件。 不得不说opencsw提供了一种更简单、方便的方式安装某些软件。 目前支持的软件和包列表：http://www.opencsw.org/get-it/packages/ 其他的一些设置可以到官方网站查询：http://www.opencsw.org/]]></description>
		<wfw:commentRss>http://www.zeevin.com/201112144.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c语言指针学习一</title>
		<link>http://www.zeevin.com/201112141.html</link>
		<comments>http://www.zeevin.com/201112141.html#comments</comments>
		<pubDate>Mon, 26 Dec 2011 15:06:40 +0000</pubDate>
		<dc:creator>zeevin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[c]]></category>

		<guid isPermaLink="false">http://www.zeevin.com/?p=141</guid>
		<description><![CDATA[#include &#60;stdio.h&#62; void pointer1() { /* * p为int型的指针，p++只跳到数组的下一个元素，数组名a代表&#38;a[0]，即代表第一个元素的起始地址 * 统一数组在内存中的地址是连续的 */ int a[10],*p,i; for(i=0;i&#60;10;i++) { scanf(“%d”,&#38;a[i]); } for(i=1,p=a;p&#60;a+10;p++,i++) { printf(“a[%d] 的值是:%d，内存地址是：%d\n”,i,*p,p); } }]]></description>
		<wfw:commentRss>http://www.zeevin.com/201112141.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php截取字符串乱码问题</title>
		<link>http://www.zeevin.com/201112133.html</link>
		<comments>http://www.zeevin.com/201112133.html#comments</comments>
		<pubDate>Sun, 18 Dec 2011 11:40:07 +0000</pubDate>
		<dc:creator>zeevin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.zeevin.com/?p=133</guid>
		<description><![CDATA[substr()函数用来截取字符串，是按字节截取，mb_substr()是按照字符截取，并且可以指定编码（以utf-8为例）。 比如： $str = “测试A4abcd截取字符串乱码问题！”; $sub = substr($str, 0,5); var_dump ($sub); echo bin2hex($sub); 因为utf-8编码中一个汉字占三个字节，例子中截取了第一个汉字和第二个汉字的前两个字节，共5个字节。第二个字节乱码。而采用mb_substr()则不会出现乱码： 类似的还有很会出现乱码的函数。php提供了一批多字节处理函数（mb_开头），用来处理汉字等多字节编码。 比如使用mb_split()代替explode()。 &#160; &#160; 说明 string substr ( string $string , int $start [, int $length ] ) 返回字符串 string 由 start 和 length 参数指定的子字符串。]]></description>
		<wfw:commentRss>http://www.zeevin.com/201112133.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php curl获取https内容</title>
		<link>http://www.zeevin.com/201112127.html</link>
		<comments>http://www.zeevin.com/201112127.html#comments</comments>
		<pubDate>Sat, 03 Dec 2011 07:16:49 +0000</pubDate>
		<dc:creator>zeevin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.zeevin.com/?p=127</guid>
		<description><![CDATA[$url = &#8216;https://www.alipay.com&#8217;; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_FAILONERROR, 0); $data = curl_exec($ch); curl_close($ch); echo ($data);]]></description>
		<wfw:commentRss>http://www.zeevin.com/201112127.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSL negotiation failed: SSL disabled due to library version mismatch</title>
		<link>http://www.zeevin.com/201112124.html</link>
		<comments>http://www.zeevin.com/201112124.html#comments</comments>
		<pubDate>Fri, 02 Dec 2011 03:20:40 +0000</pubDate>
		<dc:creator>zeevin</dc:creator>
				<category><![CDATA[Linux技术]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.zeevin.com/?p=124</guid>
		<description><![CDATA[svn: PROPFIND of : SSL negotiation failed: SSL disabled due to library version mismatch () There were lots of threads in many forums that suggested re-emerging openssl and svn, but that didn&#8217;t do it for me. Finally I stumbled upon a thread that suggested something I wouldn&#8217;t have thought of: What I finally had to [...]]]></description>
		<wfw:commentRss>http://www.zeevin.com/201112124.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>腾讯微博oauth认证</title>
		<link>http://www.zeevin.com/201111107.html</link>
		<comments>http://www.zeevin.com/201111107.html#comments</comments>
		<pubDate>Sat, 26 Nov 2011 13:46:13 +0000</pubDate>
		<dc:creator>zeevin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.zeevin.com/?p=107</guid>
		<description><![CDATA[腾讯微博api采用OAuth 1.0a进行授权认证，除了采用官方提供的php-sdk进行开发外还可以使用php语言本身的oauth扩展。 首先下载安装oauth扩展。 windows版本下载地址：http://downloads.php.net/pierre/php_oauth-1.1.1-dev-5.3-nts-vc9-x86.zip linux版本使用pecl下载安装： pecl install oauth 我们需要三个页面：ten.php是跳转页面，跳转到授权页面，back.php是回调地址，用户授权完成后会跳，demo.php演示页面，用得到的授权信息发送一条微博。 ten.php &#60;?php $req_url = 'https://open.t.qq.com/cgi-bin/request_token'; $authurl = 'https://open.t.qq.com/cgi-bin/authorize'; $acc_url = 'https://open.t.qq.com/cgi-bin/access_token'; $api_url = 'http://open.t.qq.com/api/t/add'; $conskey = 'aaaaaae'; $conssec = 'aaaaaaa'; $oauth = new OAuth&#40;$conskey,$conssec,OAUTH_SIG_METHOD_HMACSHA1,OAUTH_AUTH_TYPE_URI&#41;; $oauth = disableSSLChecks&#40;&#41;; $oauth-&#62;setNonce&#40;&#40;rand&#40;&#41;&#41;&#41;; $oauth-&#62;setTimestamp&#40;time&#40;&#41;&#41;; $requestToken = $oauth-&#62;getRequestToken&#40;$req_url,'http://localhost/back.php'&#41;; $_SESSION&#91;'oauth_token'&#93;=$requestToken&#91;'oauth_token'&#93;; $_SESSION&#91;'oauth_token_secret'&#93;=$requestToken&#91;'oauth_token_secret'&#93;; header&#40;&#34;Location: $authurl&#34;.'?oauth_token='.$requestToken&#91;'oauth_token'&#93;&#41;; back.php &#60;?php $req_url = 'https://open.t.qq.com/cgi-bin/request_token'; $authurl = 'https://open.t.qq.com/cgi-bin/authorize'; $acc_url = [...]]]></description>
		<wfw:commentRss>http://www.zeevin.com/201111107.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

