<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.harrspy.com/styles/feedsky8.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.harrspy.com" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/harryblog" type="application/rss+xml"></fs:self_link><lastBuildDate>Mon, 05 Dec 2011 13:22:14 GMT</lastBuildDate><title>harry.blog</title><link>http://blog.harrspy.com</link><language>zh-hans</language><item><title>理解Python中的  yield,  decorators和metaclasses</title><link>http://blog.harrspy.com/%E7%90%86%E8%A7%A3python%E4%B8%AD%E7%9A%84-yield-decorators%E5%92%8Cmetaclasses</link><description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;初学python的时候，很多人可能会觉得python中的 &lt;a href=&quot;http://docs.python.org/reference/simple_stmts.html#yield&quot;&gt;&lt;code&gt;yield&lt;/code&gt;&lt;/a&gt;,  &lt;a href=&quot;http://docs.python.org/reference/compound_stmts.html#function&quot;&gt;&lt;code&gt;decorators&lt;/code&gt;&lt;/a&gt; 和 &lt;code&gt;metaclasses&lt;/code&gt; 这几样东西比较难以理解。&lt;/p&gt;

&lt;p&gt;除了通过看python官方文档来学习之外，最近在&lt;a href=&quot;http://stackoverflow.com/&quot;&gt;stackoverflow&lt;/a&gt;看到了几篇相关教程，说的很详细，推荐需要的朋友看看。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/231767/the-python-yield-keyword-explained/231855#231855&quot;&gt;The Python yield keyword explained&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/739654/understanding-python-decorators/1594484#1594484&quot;&gt;Understanding Python decorators&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/100003/what-is-a-metaclass-in-python/6581949#6581949&quot;&gt;What is a metaclass in Python?&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-6 field-type-taxonomy-term-reference field-label-hidden view-mode-rss clearfix&quot;&gt;
    &lt;ul class=&quot;field-items&quot;&gt;
          &lt;li class=&quot;field-item even&quot;&gt;
        &lt;a href=&quot;/tag/python&quot;&gt;Python&lt;/a&gt;      &lt;/li&gt;
      &lt;/ul&gt;
&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/589442690/harryblog/feedsky/s.gif?r=http://blog.harrspy.com/%E7%90%86%E8%A7%A3python%E4%B8%AD%E7%9A%84-yield-decorators%E5%92%8Cmetaclasses&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 05 Dec 2011 21:22:14 +0800</pubDate><author>harry</author><comments>http://blog.harrspy.com/%E7%90%86%E8%A7%A3python%E4%B8%AD%E7%9A%84-yield-decorators%E5%92%8Cmetaclasses#comments</comments><guid isPermaLink="false">453 at http://blog.harrspy.com</guid><dc:creator>harry</dc:creator><fs:srclink>http://blog.harrspy.com/%E7%90%86%E8%A7%A3python%E4%B8%AD%E7%9A%84-yield-decorators%E5%92%8Cmetaclasses</fs:srclink><fs:srcfeed>http://blog.harrspy.com/rss.xml</fs:srcfeed><fs:itemid>feedsky/harryblog/~8381106/589442690/6095385</fs:itemid></item><item><title>利用泛域名解析使drupal开发更方便</title><link>http://blog.harrspy.com/domain-for-drupal-dev</link><description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;本文最初由&lt;a href=&quot;http://bigecko.com/node/28&quot;&gt;bigecko&lt;/a&gt;发表。&lt;/p&gt;

&lt;p&gt;之前我在本地进行drupal开发的时候，每新建一个站点的基本步骤是： 先在drupal的sites目录下建立一个 xxx.com 的目录，放上配置文件，然后在hosts文件里加一条 xxx.com 指向127.0.0.1，通过浏览器访问 xxx.com 就可以进行一系列操作了。&lt;/p&gt;

&lt;p&gt;但是在开发了比较多的drupal站点后，hosts文件里的条目就会越来越多，每新开发一个站点就要编辑一下，sites目录里的子目录名写的也比较随意，最后就会感觉比较乱。&lt;/p&gt;

&lt;p&gt;现在我换了一个办法，在本地装了个bind9，把 &amp;#42;.xxx.com解析到127.0.0.1，然后在apache里新建一个虚拟主机，&amp;#42;.xxx.com指向到drupal的目录，这样访问任何xxx.com的二级域名都会到drupal程序里了。&lt;/p&gt;

&lt;p&gt;接下来要新建一个drupal站点就很简单啦，在drupal的sites目录里新建一个 test.xxx.com的目录，之后就可以通过访问test.xxx.com进行所有的开发测试工作了。&lt;/p&gt;

&lt;p&gt;这样做的好处主要就是不需要总是去编辑hosts文件了，如果在局域网内进行团队开发的时候我想应该也可以在公共服务器上装个bind9做个泛解析指向公共的测试用web服务器，然后在路由器里设置dhcp，把dns服务器的ip分配给所有客户端，这样内网的开发测试也就比较方便了，不用总是让大家改hosts文件咯。&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-6 field-type-taxonomy-term-reference field-label-hidden view-mode-rss clearfix&quot;&gt;
    &lt;ul class=&quot;field-items&quot;&gt;
          &lt;li class=&quot;field-item even&quot;&gt;
        &lt;a href=&quot;/tag/drupal&quot;&gt;drupal&lt;/a&gt;      &lt;/li&gt;
          &lt;li class=&quot;field-item odd&quot;&gt;
        &lt;a href=&quot;/tag/dns&quot;&gt;dns&lt;/a&gt;      &lt;/li&gt;
          &lt;li class=&quot;field-item even&quot;&gt;
        &lt;a href=&quot;/tag/bind9&quot;&gt;bind9&lt;/a&gt;      &lt;/li&gt;
      &lt;/ul&gt;
&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/589442691/harryblog/feedsky/s.gif?r=http://blog.harrspy.com/domain-for-drupal-dev&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Sat, 27 Aug 2011 13:30:31 +0800</pubDate><author>harry</author><comments>http://blog.harrspy.com/domain-for-drupal-dev#comments</comments><guid isPermaLink="false">452 at http://blog.harrspy.com</guid><dc:creator>harry</dc:creator><fs:srclink>http://blog.harrspy.com/domain-for-drupal-dev</fs:srclink><fs:srcfeed>http://blog.harrspy.com/rss.xml</fs:srcfeed><fs:itemid>feedsky/harryblog/~8381106/589442691/6095385</fs:itemid></item><item><title>git里面管理空目录的方法</title><link>http://blog.harrspy.com/node/451</link><description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;git本身不会管理一个空的目录，不知道大家通用的方法是什么，我以前都是在这空目录下加一个文件比如 .dir 然后在.gitignore里加入
&lt;pre&gt;
/目录/*
!/目录/.dir
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;今天又想到了一个方法好像更方便一点，就是另外准备一个 .gitignore 文件，里面内容为：
&lt;pre&gt;
/*
!/.gitignore
&lt;/pre&gt;
然后把这个文件复制到那些需要忽略所有文件，但又要把本身加入到版本库中的目录里就行了。&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-6 field-type-taxonomy-term-reference field-label-hidden view-mode-rss clearfix&quot;&gt;
    &lt;ul class=&quot;field-items&quot;&gt;
          &lt;li class=&quot;field-item even&quot;&gt;
        &lt;a href=&quot;/tag/git&quot;&gt;git&lt;/a&gt;      &lt;/li&gt;
      &lt;/ul&gt;
&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/589442692/harryblog/feedsky/s.gif?r=http://blog.harrspy.com/node/451&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Sun, 31 Jul 2011 11:49:29 +0800</pubDate><author>harry</author><comments>http://blog.harrspy.com/node/451#comments</comments><guid isPermaLink="false">451 at http://blog.harrspy.com</guid><dc:creator>harry</dc:creator><fs:srclink>http://blog.harrspy.com/node/451</fs:srclink><fs:srcfeed>http://blog.harrspy.com/rss.xml</fs:srcfeed><fs:itemid>feedsky/harryblog/~8381106/589442692/6095385</fs:itemid></item><item><title>随便？</title><link>http://blog.harrspy.com/fkwhatever</link><description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;请问，您这个网站的这个功能具体需求是怎样的呢？要做成什么样的？&lt;/p&gt;
&lt;p&gt;随便。&lt;/p&gt;
&lt;p&gt;做好了，您看下。&lt;/p&gt;
&lt;p&gt;怎么是这样的？你们到底怎么做的？我要的不是这样子的！！！！ 我当初说的很清楚，你们现在怎么给我这样一个东西？&lt;/p&gt;
&lt;p&gt;哦，对不起，请问具体是想要做成怎样的呢？&lt;/p&gt;
&lt;p&gt;随便。。。。&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/589442693/harryblog/feedsky/s.gif?r=http://blog.harrspy.com/fkwhatever&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Wed, 01 Jun 2011 16:34:35 +0800</pubDate><author>harry</author><comments>http://blog.harrspy.com/fkwhatever#comments</comments><guid isPermaLink="false">450 at http://blog.harrspy.com</guid><dc:creator>harry</dc:creator><fs:srclink>http://blog.harrspy.com/fkwhatever</fs:srclink><fs:srcfeed>http://blog.harrspy.com/rss.xml</fs:srcfeed><fs:itemid>feedsky/harryblog/~8381106/589442693/6095385</fs:itemid></item><item><title>drupal概览</title><link>http://blog.harrspy.com/drupal-overview</link><description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;最近半年多时间都在用drupal开发各类网站，对drupal算是有一定程度的熟悉了，感触也颇多，抽空做一些记录也算是对这一阶段学习的一些总结吧，如果有朋友一起来交流那就更好了。&lt;/p&gt;

&lt;p&gt;不过俺这写的可不是教程啊，没什么具体代码分析，主要是还没那水平，而且教程的话网上真的很多，drupal官方的就很详细了。&lt;/p&gt;

&lt;h1&gt;drupal适合谁？&lt;/h1&gt;

&lt;p&gt;话说如果你只是想找个程序写写blog啥的，或者要推荐给一个不是太熟悉web开发的朋友一套建站系统用的话，那可千万别选drupal，至少不要选&lt;a href=&quot;http://drupal.org/project/drupal&quot;&gt;drupal core&lt;/a&gt;（drupal也有许多&lt;a href=&quot;http://drupal.org/node/1085574&quot;&gt;发行版&lt;/a&gt;），drupal安装完后的默认使用方式在我看来比较不太适合没有什么开发经验的人来用，至少在中国是这样，甚至有些开发者上手的时候也感觉很迷茫（包括我- -）？&lt;/p&gt;

&lt;p&gt;我觉得选用drupal的首先应该是开发者，需要有一个基础的系统，在这个系统上根据自己的需求进行扩展开发。&lt;/p&gt;

&lt;p&gt;其次即使不是熟悉web开发的人，也应该是对网站相关知识有所了解的人，那样即使不是自己写代码，也能通过drupal网站上数量众多的模块来完成各种类型的网站。&lt;/p&gt;

&lt;p&gt;既然drupal是用来做基础系统开发网站的话，为啥不直接用一个php框架呢。&lt;/p&gt;

&lt;p&gt;我感觉其实drupal就是一个php框架了，只不过它自带了一部分常规网站的基本功能，使得安装好后基本就能开始用了，用来开发网站的好处就是速度很快，初始的完成度要比一般的php框架高很多，再根据需求安装一些现有模块，普通网站的大部分功能等于都有了，接着需要自己定制的基本就是：开发设计一套自己的网站主题，对一些细节进行调整，对某些比较特殊的业务需求当然要自己开发功能模块。&lt;/p&gt;

&lt;h1&gt;drupal的开发风格&lt;/h1&gt;

&lt;p&gt;与一般常见的php mvc框架不同的是，drupal没有完全使用php里的oo语法，说白点就是没有那么多class，主要是基于函数的命名约定来实现hook机制，这点做过wordpress开发的朋友应该比较好理解。&lt;/p&gt;

&lt;p&gt;对drupal进行扩展开发，基本就是开发module，drupal基本就是通过module机制建立起来的，除了一些启动文件和常用函数库外，其他基本就都是module，包括核心的一些功能也都是module，一个module可以是独立的，也可以依赖其他module，一个个module就像一快快积木一样，根据需要搭出自己想要的网站。&lt;/p&gt;

&lt;p&gt;而module中的php代码，很大一部分都是hook函数，只要根据命名约定定义函数即可，然后在函数中进行需要的操作，在系统运行的时候hook函数会在适当的时机被调用。在自己写的模块中也可以调用自定义的hook，让其他模块可以实现hook，进行扩展操作。&lt;/p&gt;

&lt;p&gt;这样的机制使得系统开发起来非常的灵活，在任何地方都可以捕获到某个操作，比如我要在自己的模块中实现新用户建立的时候发一封邮件给网站管理员：
那只需写一个&lt;a href=&quot;http://api.drupal.org/api/drupal/modules--user--user.api.php/function/hook_user_insert/7&quot;&gt;hook_user_insert&lt;/a&gt;函数，当新用户建立的时候，系统就会调用我定义的这个函数，然后把用户对象传进来，所以我只要在这个函数内执行发送邮件的代码即可。&lt;/p&gt;

&lt;h1&gt;在开始开发之前要做的&lt;/h1&gt;

&lt;p&gt;如果你准备开始接触drupal开发了，一些心里准备还是要有的- -&lt;/p&gt;

&lt;p&gt;首先我觉得drupal是一个非常庞大并且复杂的系统，不像有些web框架，照着快速入门一上来基本就能开始写代码了。如果你报着一上来就想写个啥功能的想法钻进drupal里，你可能会觉得完全无从下手，玩了一段时间可能就没兴趣了。&lt;/p&gt;

&lt;p&gt;刚开始接触drupal的时候最好先要理解它里面的一些重要的概念，比如什么content type、node、field、taxonomy、block等，要理解这些东西比较快的方法当然就是装个drupal然后登陆到后台开始使用了，然后再结合看文档，全面的了解下druapl的&lt;a href=&quot;http://drupal.org/documentation/develop&quot;&gt;基本结构&lt;/a&gt;。&lt;/p&gt;

&lt;p&gt;话说，象我这种智商不太高的人，理解这些东西确实还是花了些时间的，当初坚信drupal是因为得知白宫都开始用这玩意了，然后花了点时间把&lt;a href=&quot;http://drupal.org/documentation/develop&quot;&gt;开发文档&lt;/a&gt;基本都看了一遍，才渐渐的有了云开雾散的感觉。&lt;/p&gt;

&lt;p&gt;当然了，也不用太担心学drupal会很费时间，只是相对一般的php mvc框架会稍微多花一点时间去入门，基本上看英语文档如果没什么大障碍的话，用1-2天了解drupal基本结构后就能开始照着文档自己 写模块了。这点时间对于以后高速的开发效率还是值得的，而且drupal虽然没有大量的使用OOP语法，但是它的开发流程都是相当有规律可循的，只要了解了基本的编码规则，之后再深入学习的时候，就会觉得非常的快。&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-6 field-type-taxonomy-term-reference field-label-hidden view-mode-rss clearfix&quot;&gt;
    &lt;ul class=&quot;field-items&quot;&gt;
          &lt;li class=&quot;field-item even&quot;&gt;
        &lt;a href=&quot;/tag/drupal&quot;&gt;drupal&lt;/a&gt;      &lt;/li&gt;
      &lt;/ul&gt;
&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/589442694/harryblog/feedsky/s.gif?r=http://blog.harrspy.com/drupal-overview&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Wed, 13 Apr 2011 00:25:34 +0800</pubDate><author>harry</author><comments>http://blog.harrspy.com/drupal-overview#comments</comments><guid isPermaLink="false">448 at http://blog.harrspy.com</guid><dc:creator>harry</dc:creator><fs:srclink>http://blog.harrspy.com/drupal-overview</fs:srclink><fs:srcfeed>http://blog.harrspy.com/rss.xml</fs:srcfeed><fs:itemid>feedsky/harryblog/~8381106/589442694/6095385</fs:itemid></item><item><title>浏览器里搜索引擎设置的一些发现</title><link>http://blog.harrspy.com/browser-search-engine-settings</link><description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;chrome地址栏里的搜索建议功能是个非常方便的功能，无需打开google页面就可以补全关键字。&lt;/p&gt;

&lt;p&gt;因为chrome里内建的google搜索设置打开的是香港的地址，不过我比较喜欢用google.com的页面打开搜索结果。&lt;/p&gt;

&lt;p&gt;然后我就加了一个设置，URL里填的是 &lt;code&gt;http://www.google.com/search?q=%s&lt;/code&gt;，把新添加的设置成默认搜索引擎后虽然输入关键字后回车会打开.com的页面，但是地址栏就再也不出现搜索建议了。&lt;/p&gt;

&lt;p&gt;我今天突然发现个地址  &lt;a href=&quot;http://mycroft.mozdev.org/google-search-plugins.html&quot;&gt;http://mycroft.mozdev.org/google-search-plugins.html&lt;/a&gt; ，点这里面的链接添加搜索引擎，然后设置为默认后发现搜索建议又出来了。我看了它给浏览器加的搜索设置，URL和我之前自己加的一摸一样啊。&lt;/p&gt;

&lt;p&gt;然后就去看那个页面的代码，发现它是通过使用一个 &lt;code&gt;window.external.AddSearchProvider&lt;/code&gt; 的方法给浏览器添加搜索引擎，这个方法要给他传一个xml地址的参数，xml里是对搜索引擎设置的描述。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://mycroft.mozdev.org/installos.php.html/14909/google.xml&quot;&gt;http://mycroft.mozdev.org/installos.php.html/14909/google.xml&lt;/a&gt; 这个地址就是google.com的设置。里面的 &amp;lt;Url type=&quot;application/x-suggestions+json&quot; ... 应该就是对搜索建议的设置了。&lt;/p&gt;

&lt;p&gt;然后查了下，这个xml是一个OpenSearch的格式，貌似是一种标准？
有兴趣可以看下 &lt;a href=&quot;http://www.opensearch.org&quot;&gt;http://www.opensearch.org&lt;/a&gt; 这个地址里面有详细的说明，如果以后自己的网站也有搜索建议的功能，那也能给浏览器加个带提示自己网站内容的搜索啦。&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-6 field-type-taxonomy-term-reference field-label-hidden view-mode-rss clearfix&quot;&gt;
    &lt;ul class=&quot;field-items&quot;&gt;
          &lt;li class=&quot;field-item even&quot;&gt;
        &lt;a href=&quot;/tag/chrome&quot;&gt;chrome&lt;/a&gt;      &lt;/li&gt;
          &lt;li class=&quot;field-item odd&quot;&gt;
        &lt;a href=&quot;/tag/opensearch&quot;&gt;opensearch&lt;/a&gt;      &lt;/li&gt;
          &lt;li class=&quot;field-item even&quot;&gt;
        &lt;a href=&quot;/tag/searchengine&quot;&gt;searchengine&lt;/a&gt;      &lt;/li&gt;
      &lt;/ul&gt;
&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/589442695/harryblog/feedsky/s.gif?r=http://blog.harrspy.com/browser-search-engine-settings&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Thu, 27 Jan 2011 00:31:54 +0800</pubDate><author>harry</author><comments>http://blog.harrspy.com/browser-search-engine-settings#comments</comments><guid isPermaLink="false">447 at http://blog.harrspy.com</guid><dc:creator>harry</dc:creator><fs:srclink>http://blog.harrspy.com/browser-search-engine-settings</fs:srclink><fs:srcfeed>http://blog.harrspy.com/rss.xml</fs:srcfeed><fs:itemid>feedsky/harryblog/~8381106/589442695/6095385</fs:itemid></item><item><title>把blog升级到Drupal7了</title><link>http://blog.harrspy.com/blog-update-to-drupal7</link><description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;以后俺搞网站估计很多都会基于Drupal7拉，blog里用的大部分模块都有drupal7的版本，感觉不错，似乎性能有所提高。&lt;br /&gt;
随着drupal的不断强大，我估计要越来越懒了...&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-6 field-type-taxonomy-term-reference field-label-hidden view-mode-rss clearfix&quot;&gt;
    &lt;ul class=&quot;field-items&quot;&gt;
          &lt;li class=&quot;field-item even&quot;&gt;
        &lt;a href=&quot;/tag/drupal&quot;&gt;drupal&lt;/a&gt;      &lt;/li&gt;
      &lt;/ul&gt;
&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/589442696/harryblog/feedsky/s.gif?r=http://blog.harrspy.com/blog-update-to-drupal7&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Thu, 20 Jan 2011 00:35:41 +0800</pubDate><author>harry</author><comments>http://blog.harrspy.com/blog-update-to-drupal7#comments</comments><guid isPermaLink="false">445 at http://blog.harrspy.com</guid><dc:creator>harry</dc:creator><fs:srclink>http://blog.harrspy.com/blog-update-to-drupal7</fs:srclink><fs:srcfeed>http://blog.harrspy.com/rss.xml</fs:srcfeed><fs:itemid>feedsky/harryblog/~8381106/589442696/6095385</fs:itemid></item><item><title>在django程序中运行gitweb</title><link>http://blog.harrspy.com/gitweb-in-django</link><description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;&lt;a href=&quot;https://git.wiki.kernel.org/articles/g/i/t/Gitweb.html&quot;&gt;gitweb&lt;/a&gt;本身是一个perl写的cgi脚本，我把他嵌入到django中的主要目的就是可以实现一些定制，比如可以在views里做到权限控制，定制输出等。&lt;/p&gt;

&lt;p&gt;主要是用python的subprocess去调用执行这个cgi，然后得到输出后，处理一下后用django的HttpResponse输出网页内容。哈哈 说起来一开始还不怎么会调用，然后居然去看了python的CGIHTTPServer的源代码，照着抄了一些才搞成功。
&lt;!--break--&gt;
&lt;script src=&quot;https://gist.github.com/738588.js&quot;&gt; &lt;/script&gt;&lt;/p&gt;

&lt;p&gt;我把这个用到了之前写的&lt;a href=&quot;http://blog.harrspy.com/gitube-first-meet&quot;&gt;gitube&lt;/a&gt;程序中，效果还不错。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/harryxu/gitube/blob/master/gitube/apps/gitweb/views.py&quot;&gt;https://github.com/harryxu/gitube/blob/master/gitube/apps/gitweb/views.py&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-6 field-type-taxonomy-term-reference field-label-hidden view-mode-rss clearfix&quot;&gt;
    &lt;ul class=&quot;field-items&quot;&gt;
          &lt;li class=&quot;field-item even&quot;&gt;
        &lt;a href=&quot;/tag/django&quot;&gt;django&lt;/a&gt;      &lt;/li&gt;
          &lt;li class=&quot;field-item odd&quot;&gt;
        &lt;a href=&quot;/tag/git&quot;&gt;git&lt;/a&gt;      &lt;/li&gt;
          &lt;li class=&quot;field-item even&quot;&gt;
        &lt;a href=&quot;/tag/python&quot;&gt;Python&lt;/a&gt;      &lt;/li&gt;
          &lt;li class=&quot;field-item odd&quot;&gt;
        &lt;a href=&quot;/tag/gitweb&quot;&gt;gitweb&lt;/a&gt;      &lt;/li&gt;
      &lt;/ul&gt;
&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/589442697/harryblog/feedsky/s.gif?r=http://blog.harrspy.com/gitweb-in-django&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 13 Dec 2010 10:45:30 +0800</pubDate><author>harry</author><comments>http://blog.harrspy.com/gitweb-in-django#comments</comments><guid isPermaLink="false">443 at http://blog.harrspy.com</guid><dc:creator>harry</dc:creator><fs:srclink>http://blog.harrspy.com/gitweb-in-django</fs:srclink><fs:srcfeed>http://blog.harrspy.com/rss.xml</fs:srcfeed><fs:itemid>feedsky/harryblog/~8381106/589442697/6095385</fs:itemid></item><item><title>切换gvim guioptions的函数</title><link>http://blog.harrspy.com/%E5%88%87%E6%8D%A2gvim-guioptions%E7%9A%84%E5%87%BD%E6%95%B0</link><description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;gvim里可以通过设置 &lt;code&gt;guioptions&lt;/code&gt; 来达到显示或隐藏某些gui组件。&lt;/p&gt;

&lt;p&gt;比如 &lt;code&gt;:set guioptions-=m&lt;/code&gt; 可以隐藏菜单栏。&lt;/p&gt;

&lt;p&gt;我搞了个函数，让切换方便些。&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
&quot; toggle guioption
function! ToggleGO(flag)
    if &amp;amp;go =~# a:flag
        call feedkeys(&quot;:set go-=&quot;.a:flag.&quot;\&lt;CR&gt;&quot;)
    else
        call feedkeys(&quot;:set go+=&quot;.a:flag.&quot;\&lt;CR&gt;&quot;)
    endif
endfunction
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;加到vimrc之后要切换某个选项只要把&lt;code&gt;guioptions&lt;/code&gt;的标记传到这个函数里就行了。
比如 &lt;code&gt;:call ToggleGO('m')&lt;/code&gt; 可以切换菜单的显示。&lt;/p&gt;

&lt;p&gt;在vimrc里映射一些快捷键就行了
&lt;pre&gt;
&quot;切换菜单栏
nmap ,m :call ToggleGO('m')&lt;CR&gt;&lt;/p&gt;

&lt;p&gt;&quot;切换工具栏
nmap ,t :call ToggleGO('m')&lt;CR&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-6 field-type-taxonomy-term-reference field-label-hidden view-mode-rss clearfix&quot;&gt;
    &lt;ul class=&quot;field-items&quot;&gt;
          &lt;li class=&quot;field-item even&quot;&gt;
        &lt;a href=&quot;/tag/gvim&quot;&gt;gvim&lt;/a&gt;      &lt;/li&gt;
          &lt;li class=&quot;field-item odd&quot;&gt;
        &lt;a href=&quot;/tag/vim&quot;&gt;vim&lt;/a&gt;      &lt;/li&gt;
      &lt;/ul&gt;
&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/589442698/harryblog/feedsky/s.gif?r=http://blog.harrspy.com/%E5%88%87%E6%8D%A2gvim-guioptions%E7%9A%84%E5%87%BD%E6%95%B0&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Wed, 08 Dec 2010 17:18:03 +0800</pubDate><author>harry</author><comments>http://blog.harrspy.com/%E5%88%87%E6%8D%A2gvim-guioptions%E7%9A%84%E5%87%BD%E6%95%B0#comments</comments><guid isPermaLink="false">442 at http://blog.harrspy.com</guid><dc:creator>harry</dc:creator><fs:srclink>http://blog.harrspy.com/%E5%88%87%E6%8D%A2gvim-guioptions%E7%9A%84%E5%87%BD%E6%95%B0</fs:srclink><fs:srcfeed>http://blog.harrspy.com/rss.xml</fs:srcfeed><fs:itemid>feedsky/harryblog/~8381106/589442698/6095385</fs:itemid></item><item><title>看了《The Social Network》</title><link>http://blog.harrspy.com/%E7%9C%8B%E4%BA%86%E3%80%8A-social-network%E3%80%8B</link><description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;geek们的思维太快，电影的节奏也很快，我这种反应比较慢的人看了一边感觉很多地方都稀里糊涂的 - -&lt;/p&gt;
&lt;p&gt;感觉mark是个天才，只是按电影中的情节，似乎有点遗憾，天才有时候太自私，与支持自己的朋友争斗不休，我总觉得很费解。。。。。   或许只有这样的人才能成为天才吧。&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-6 field-type-taxonomy-term-reference field-label-hidden view-mode-rss clearfix&quot;&gt;
    &lt;ul class=&quot;field-items&quot;&gt;
          &lt;li class=&quot;field-item even&quot;&gt;
        &lt;a href=&quot;/tag/facebook&quot;&gt;facebook&lt;/a&gt;      &lt;/li&gt;
      &lt;/ul&gt;
&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/589442699/harryblog/feedsky/s.gif?r=http://blog.harrspy.com/%E7%9C%8B%E4%BA%86%E3%80%8A-social-network%E3%80%8B&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 15 Nov 2010 00:55:15 +0800</pubDate><author>harry</author><comments>http://blog.harrspy.com/%E7%9C%8B%E4%BA%86%E3%80%8A-social-network%E3%80%8B#comments</comments><guid isPermaLink="false">441 at http://blog.harrspy.com</guid><dc:creator>harry</dc:creator><fs:srclink>http://blog.harrspy.com/%E7%9C%8B%E4%BA%86%E3%80%8A-social-network%E3%80%8B</fs:srclink><fs:srcfeed>http://blog.harrspy.com/rss.xml</fs:srcfeed><fs:itemid>feedsky/harryblog/~8381106/589442699/6095385</fs:itemid></item></channel></rss>
