|
Dec
10
|
|
|
Dec
07
|
|
|
Categories: WP/WP Plugins
| Tags: wordpress, WP插件
| Views: 348
|
其实我本无意在这里批评什么或者指责什么,事实上,我自己的插件也没有用上心,只是满足了自己的需求就发了出来。
wp-codebox是一个不错的插件,我不知道wp-syntax与之哪个在前哪个在后,只是我看了两者的源代码,发现惊人地相似。
wp-codebox最近更新了,我很想知道它到底更新了什么,到插件主页一看,什么介绍也没有,看了源代码才知道,原来整个源代码的组织形式都有所改进。
|
Nov
28
|
|
|
Categories: Techniques
| Tags: SQL
| Views: 307
|
题目要求是这样的,假设有如下表(MySQL):
TABLE: test
| id | a | b |
| 1 | 4 | 2 |
| 2 | 1 | 2 |
| 3 | 1 | 3 |
| 4 | 3 | 2 |
| 5 | 1 | 5 |
| 6 | 1 | 2 |
| 7 | 4 | -1 |
| 8 | 1 | 2 |
写一条SQL语句,
选择所有a=1或b=2的记录,
使得a=1且b=2的记录排在最前面,
并且a=1且b=2的记录按id降序排列。
|
Nov
25
|
|
|
Categories: WP/WP Plugins
| Tags: wordpress
| Views: 328
|
0. 前言
你想到了一个很有创意的点子?你写了一个很酷的插件?
Oh,no!wordpress官网上的发布步骤太长了,还是E文。
难道你的插件只能躺在插件包里,还是只放在你的网站里让寥寥无几的人下载?
相信这篇文章能让你的插件不再山寨。
|
Nov
23
|
|
|
Categories: WP/WP Plugins
| Tags: WP插件
| Views: 451
|
之前写了一篇 非插件防垃圾评论, 用的是简单的数学等式。但是需要对主题中comments.php以及wp-comment-post.php进行修改,不太方便。于是便动手写了一个插件,不仅可以采用数学等式验证,更可以使用图片验证码。
Add an verification code when user posting a comment to keep robots away. You can use an image verification code or a math equation instead.
Robots may post lots of spam comments into your database. You can add a verification code image or a math equation to avoid this.
Features:
- You can choose a verification code image or a math equation as you wish
- You don’t need to edit any source code of WP, you just need to active the plugin
|
Nov
16
|
|
习惯于linux下用perl来处理一些文件文件和数据, 有时候就难免会写大量的脚本, 为脚本配上好的注释, 以及统一编码风格, 这是一个好的习惯.
只是需要敲入大量的重复代码. 其中对于输入参数的处理就是这样.
例如下面这段代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | # This is a demo! if( @ARGV<1 ) { print STDERR "\n == INTRODUCTION ==\n"; print STDERR " This is a demo!\n"; print STDERR "\n == PARAMETERS ==\n"; print STDERR " -i <input> input text file\n"; print STDERR " -o <output> output file\n"; print STDERR " DEFAULT:output\n"; print STDERR "\n == USAGE ==\n"; print STDERR " $0 -i <input> \n"; print STDERR " $0 -i <input> -o output \n\n"; } my ( $temp, $input, # -i $output # -o ); while(@ARGV){ $temp = shift; if( $temp eq "-i" ){ $input = shift; } elsif( $temp eq "-o" ){ $output = shift; } else{ print STDERR "Warning: argument $temp igorned.\n"; } } if(!defined($input)){ print STDERR "Error: argument '-i' is needed.\n"; exit; } if(!defined($output)){ $output = "output" } ## End of handling parameters ## |
|
Nov
13
|
|
|
Nov
11
|
|
|
Nov
09
|
|
在德国的一个朋友给我发的一些题, 他是学机械的,C语言只是他们的公共基础课。
看看人家的要求吧。不能调试,程序运行必须通过。


