Archive for the ‘wordpress’ Category

降低选择的数量

Saturday, September 6th, 2008 | 14 views

如果我们要设计一个系统(或者框架,或者程序设计语言),我们是让它对实现一个功能有一种解决方案好,还是有20种解决方案好(对系统的使用者而言)?这个问题似乎很容易回答,显然是有20种方案更好些。20种不同的方案显然都有着不同的优缺点,可以使得方案的效果更加的可控,挑选的余地更大。一般情况下是是这样的,不过我最近看书的时候常常想一个问题:假使从20个方案挑选一个需要的难度和花费,比直接使用第一种方案要高很多,那么有着更多的解决办法还是一件好事么?

我的观点是否定的。我从程序设计语言的角度来举个例子。假如有一天我设计了一种新的程序设计语言,名字叫SuperPERL(我不是要讽刺Perl),其最大的特点就是自由。实现每个功能都可以有无数的写法,使得不同背景的程序员都能够轻松过渡到SuperPERL。比如,打开文件这样的操作,有如下几种写法:

//方法1:
File file=new file("path");
InputStream is=new FileInputStream(file);
Scanner s=new Scanner(is);
 
//方法2:%%表示调用shell命令
StringBuffer fb=new StringBuffer();
StringBuffer.addContent("%%echo $myfile>$fb");
 
//方法3:
 
File *file=open_file("myfile")
//方法4:
.....

看着其实很不错,SuperPERL能把各种语言都能融会贯通,程序员能够随心所欲的写出正确的代码,一个C程序或者一个Java程序员,或者Basic程序员都能顺利的使用这种语言。但是如果我们面对的是一位初学者呢?他买了A书,然后学到SuperPERL打开文件是按方法1做的,买了B书,然后学到打开文件是按方法4作的,然后他的老师告诉他应该按方法2做,他同学,一位大牛告诉他SuprePERL中最具效率的打开文件的方法应该是第二种,其他方法都是土鳖做法……如果在学习SuperPERL中的每一个功能都要发生以上的故事,我想他肯定会放弃这种编程语言的。
其次是沟通的困难,一个C转过来的程序员,很快乐的编写着SuperPERL程序:用着自己熟悉的语法,写出非常时尚的代码。但是他同事可能以前是一位Pascal程序员,不难想象这两位用着同一种编程语言共同开发项目时会产生的困境——互相之间看不懂对方的代码。

功能不是越多越方便,选择不是越多越好,对于程序设计语言,对于各种应用框架而言,尤其如此。如果我是某个语言或者框架的设计师,我的设计准则肯定会有一条是:公开的概念(也就是使用者需要学习的概念)越少越好,拥有的选择越少越好。少的概念有利于初学者的学习,也有利于开发者之间的沟通。

想想Java世界无数需要理解与学习的概念吧,Java世界正朝着相反的方向前进。

wordpress Plugin:Automatic Tag to Link

Tuesday, August 19th, 2008 | 708 views

Introduction:

This plugin will automatic add links to technorati tags or your blog’s tags where the words in your post match the tags of that post.

The most greatest things is that the plugin will not actually change your posts’ content in order to add links, so it will not hurt your posts. If you don’t want to use this plugin, just deactive it, and all links the plugin generated will automatic disapper just like they automatic come out, then your blog will return to its original status.

Go to Settings->Tag to Link for more information.

Match Rules

Here are some rules when and how the convert take actions. These rules are *only effective* after version 0.5

  1. If you tagged a post ‘hello world’ ‘hello’ ‘world’ and the content of your post is ‘hello world, I’m coming’, then this plugin will add link to ‘hello’, ‘world’, but not ‘hello world’, because there are links already. The rule can be simplily called *Short Tag First*.
  2. If you tagged a post ‘hello world’ ‘hello’ ‘world’ and the content of your post is ‘bigworld, hellod, world’, then this plugin will add link to the last ‘world’, and no links will be added to ‘world’ of ‘bigworld’, or ‘hello’ of ‘hellod’.

System Requirment:

wordpress 2.5+

It hasnot been tested in old wordpress versions, so I don’t know whether it works just right with them.  I suggest you update your wordpress, not because of this plugin, believe me, wordpress2.5+ is really great.

Installtion:

  1. Download the plugin
  2. Unachinve it
  3. Upload to wp-content/plugin/
  4. Login to plugin page and activate it
  5. Go to Settings->Tag to Link to change the default settings.  :)

Download latest:

Automatic Tag to Link

Donate for this plugin (Paypal)


Thanks for your supporting!  :)

无良bot

Saturday, August 16th, 2008 | 21 views

最近给自己blog做一个东西,要记录和分析来访的IP,访问的页面等等。发现收集到的来访ip,有价值的不到10%。也就是说只有这10%是用户通过浏览器访问的,而其他90%+来访则都是机器人程序

这些耗费我绝大多数流量的bot包括一些老实或者变态的搜索引擎spider,一些发垃圾评论的bot,一些来盗取我页面内容的bot,还有一些莫名其妙整天不断来访的bot,我不知道这些bot想干什么。

常常有个bot来访问http://www.kylogs.com/blog/showtb.asp?id=number,number的值不固定。我这个blog是worpdress,不知道这位bot同志老来访问showtb.asp干什么。showtb.asp可能是某个asp blog程序的一个页面。sigh,这个脑残bot每天来访问1000多次。来访的ip还常常不是一个区段的,比如119.120.232.157,123.151.31.45,118.112.116.176。

为了排除这些bot的干扰,我这个统计程序ban掉了许多这种ip,新的ip还源源不断的出现。

wordpress Plugin:Most Recent Visitors

Wednesday, August 13th, 2008 | 319 views

Introduction:

Most-Recenet-Visitors is a very simple wordpress plugin, which display latest visitors’s basic information(ip, referer url, target url, and the time) in sidebar widget. You can customize the widget’s title, and the number of visitors to show. Though the plugin will record the visitors’ information in your database, it uses very very little database space, so don’t worry about it.

Ye, it’s just a small toy.

System Requirment:

wordpress 2.5+

Your theme should support widgets.

It hasnot been tested in old wordpress versions, so I don’t know whether it works just right with them.  I suggest you update your wordpress, not because of this plugin, believe me, wordpress2.5+ is really great.

Installtion:

  1. Download the plugin
  2. Unachinve it
  3. Upload to wp-content/plugin/
  4. Login to plugin page and activate it
  5. Go to Design->Widgets. Most Recent Visitors is already there :)

Download latest:

Most-Recent-Visitors
Donate for this plugin (Paypal)


Thanks for your supporting!  :)

WordPress插件:欢迎新用户

Sunday, August 3rd, 2008 | 36 views

插件主页的中文版本

WordPress插件:欢迎新用户   英文版本主页

介绍

插件的功能非常简单,但有访问者从别的站点连接到自己blog上时,页面会有一个小提示,欢迎用户的到来,并且问他是否愿意订阅本blog。

可以在WordPress管理后台->Settings(选项)处自定义feed地址,自定义欢迎语的内容和欢迎界面的外观。

WordPress版本要求:

WordPress2.5以上能正常运行,2.5以下的版本不做保证。

安装方法:

  1. 下载本插件
  2. 解压缩
  3. 将目录welcome-visitors拷贝到 /wp-content/plugins 下面
  4. 在后台激活即可
  5. 在Settings菜单下的Welcome Visitor子菜单可以对插件进行一些个性化

更多使用方法:

如果需要改变欢迎语言的显示位置,可以编辑文件welcome_visitor.php 将以下代码注释掉:

 //add_action('wp_head','say_it');

然后将以下代码拷贝到要显示的位置即可。

 < ?php  say_it();  ?>

1.00以后的版本,还可以自定义欢迎语言,比如:

欢迎来自于 <strong> <a href="[REFERER_URL]">[RE_SITENAME]</a></strong>的朋友,如果您喜欢这个站点,你可以订阅 <strong> <a href="[RSS_ADDRESS]">[IMG]subscribe</a></strong>它。

下面介绍下各个标记的意思,如果有人从googlev.com搜索到我的blog,http://www.kylogs.com/blog, 那么 [REFERER_URL] 就是 ‘www.google.com’, [RE_SITENAME] 就是 ‘Google’. [RSS_ADDRESS] blog的 rss 地址. [IMG] 显示一个feed小图标.

下载地址:

您可以在这里下载到最近版本的插件,在这里下载到中文提示语的插件。其实两者的差别就在于欢迎语言的分别,但是由于欢迎语言可以在后台自定义,所以推荐您去这里下载能够获得最新的版本。由于最近在实验室任务繁重,我并没有很多时间去维护,也没有时间去将其国际化,由此带来的不便很抱歉。

WP-Plugin: Welcome Visitors

Monday, July 28th, 2008 | 1,166 views

Project Homepage

Welcome Visitors Projects
Chinese Version homepage
Introduciton

Welcome-visitor is a wordpress plugin, which will welcome visitors ( which come from others sites, eg:google search, yahoo! serach or your friends’ links), and ask them to bookmark your site or to subscribe your rss feed. It will help you to get more readers and more attentions!

System requirements

  1. wordpress2.3+

Installation

  1. Download the plugin
  2. Unachinve it
  3. Upload to wp-content/plugin/
  4. Login to plugin page and activate it
  5. Maybe you wanna change the default settings, then go to settings page, choose menu Welcome Visitor.

Usage

If you need to change the default display location, you can edit the welcome_visitor.php file, comment off the code

 //add_action('wp_head','say_it');

and copy the code

 < ?php  say_it(); ?>

to anywhere you want to insert. For example,  you can insert the preview code after <body> tag in your  theme’s index.php.

If you are using version1.00+, you can customize the welcome words. Here is the example.

Welcome friend from <strong> <a href="[REFERER_URL]">[RE_SITENAME]</a></strong>, if you are new here,
 you may want to <strong> <a href="[RSS_ADDRESS]">[IMG]subscribe</a></strong> this site.

If someone search “semantic web notes” in Google, some of the results google return are about my blog, he/she click one of them, and visits my blog:http://www.kylogs.com/blog,  then [REFERER_URL] is ‘www.google.com’, [RE_SITENAME] is ‘Google’, and [RSS_ADDRESS] is your blog’s rss address. label [IMG] display a small feed icon.
download latest

Donate for this plugin (Paypal)

Thanks for your supporting!  :)

change log

  • 0.9        2008/7/27    first version
  • 0.91      2008/7/28    0.9version will cause an error in Dashboard->incoming links area. It was fixed in 0.91
  • 0.92      2008/7/30 fix some bugs
  • 0.93      2008/7/31 fix a serious bug, add a small feed img
  • 1.00      2008/8/1 now you can custome your own welcome words. :)

关于

我叫陈炬,正在天津大学计算机学院->知识工程与科学研究所攻读硕士研究生。今年应届。您可以在我的自我介绍获得更多关于我的信息

订阅我的Blog


本站RSS地址| [这是什么?]
订阅到Google Reader | 订阅到 抓虾 阅读器 | 订阅到 鲜果 阅读器

其他blog

我还有一个英文blog,非常的无聊,琐碎,许多的语法错误。请谨慎访问。
Find entries :