In Lisp or Scheme language, the anonymous function (which is called lambda-style function) is common used. These functions are special because it doesn’t have a name. So it can be only used once. Usually, these functions are very small and simple. (more…)
Posts Tagged ‘Programming’
Anonymous Function in PHP
Saturday, October 25th, 2008Sending AJAX Requests with Prototype
Saturday, October 11th, 2008Several days ago I tried to learn a little about Javascript language and AJAX. Implementing AJAX with pure Javascript is not an easy work. It is not cross-browser so that I have to detect which browser sent the AJAX request. I think some frameworks can solve the problem in a better way and finally I found a Javascript framework — Prototype. (more…)
Function Overloading in PHP 5
Tuesday, September 23rd, 2008Function overloading means using one function to do more than one kinds of work. For example, there is a class whose name is “Container”. The container class maintains an array. It has a function called “add”. You can use “add” function to add some items to the class. The argument may be a single object or an array. i.e. $c->add(35) and $c->(add(array(35)) are the same. How to do it in PHP? (more…)
Adding Python CGI support to Apache
Tuesday, September 23rd, 2008The reason I start to learn Python is to play with Google App Engine. So I think I should learn Python web programming. I need to add Python support to my Apache server. Someone recommanded me to use “mod_python”. But unfortunately I can’t install the mod_python correctly. Therefore, I have to use Python CGI. (more…)
How to Use SimpleTest
Tuesday, September 23rd, 2008SimpleTest is a unit test framework for PHP. As its name, it is simple, easy to use. You can create many test cases with its help. Since I planned to develop a PHP library for Google Chart API. I decide to use SimpleTest to test my program. (more…)
Notes about WordPress Filters
Tuesday, September 23rd, 2008Filters, as its name, is used for modifying data in WordPress. WordPress provides many filter interfaces. You can write some functions to ‘hook’ into one of them. Yes, that’s is a WordPress plugin. For example, if you want to append some text to each post, you can write a plugin file as below: (more…)