I am using WordPress 2.7. WordPress has an annoying function: revisions. If you use WordPress 2.6 or above, there may be lots of unuseful revisions in your database. Normally, a post have 5 or more revisions. They make the database larger and larger. Since there are lots of rubbish, the efficiency may become very slow. Read the rest of this entry »
How to Disable WordPress Revisions (No Plugin)
February 21st, 2009Flickr: Don't Forget to Set the Image Type
December 31st, 2008I just knew that Flickr doesn’t like people to upload screenshots or design images. But it allows you to do it. What you need to do is to set the proper content type before uploading. Read the rest of this entry »
Try Again and Again and Again…
November 30th, 2008God bless all of us… I can’t find any words to describe my mood. He is a real hero. Anyone who loves life is a real hero.
Old AdSense Code
November 16th, 2008The old AdSense code is more convenient to change its color and style. However, Google AdSense won’t provide the old-style code any more. Here are some notes about the old-style AdSense code. Read the rest of this entry »
Anonymous Function in PHP
October 25th, 2008In 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. Read the rest of this entry »
Trying reCAPTCHA Plugin
October 25th, 2008It is very strange that my post Function Overloading in PHP 5 brought many spam comments. I enabled Akismet plugin that has caught about 150 spam comments. However, somtimes Akismet can’t prevent all the spam comments and it just doesn’t allow the spam comments to show, the spams are still stored in the database.
Several days ago I read this article in Google Webmaster Central Blog. It shows some method to avoid comment spam. The first thing is using a captcha. Also, it gives a free script which is called “reCAPTCHA“. For WordPress users, reCAPTCHA provides a plugin, so that it is very easy to integrate with WordPress.
I don’t think the captcha code is a good solution to comment spam. It will make difficult to visitors who want to leave some meaningful comments. However, the comment spam is so serious, I have to do so.
What is JAVA_HOME in Ubuntu?
October 21st, 2008Some Java programs need the environment variable JAVA_HOME, such as Tomcat. In Windows operating system, JAVA_HOME is the directory that the JDK is located. However, in Ubuntu if you install JDK with “sudo apt-get install sun-java6-jdk”, the JDK’s files are extracted to many directories like /usr/bin, /usr/lib, etc. What is JAVA_HOME?
Some people thought it should be /usr because in Windows the Java compiler “javac” is in JAVA_HOMEbinjavac. So in Linux it should be JAVA_HOMEbinjavac and JAVA_HOME=/usr. I don’t think it is the best sulotion. Because I found /usr/bin/javac is not the real Java compiler, it is just a link. I used “ls -l /usr/bin/javac” to see what it links to:
/usr/bin/javac -> /etc/alternatives/javac
And /etc/alternatives/javac is also a link. It links to /usr/lib/jvm/java-6-sun/bin/javac. This is the real Java compiler. And the path is similar to that in Windows. So I think JAVA_HOME should be /usr/lib/jvm/java-6-sun in Ubuntu Linux.
The Keyboard doesn't Work in Virtualbox on Ubuntu 8.04.1
October 19th, 2008I installed Ubuntu Linux 8.04.1 yesterday and removed Windows. But sometimes I need to use Windows, so I have to install VirtualBox.
I used “sudo apt-get install virtualbox-ose virtualbox-ose-modules-generic” to install VirtualBox. Its version is 1.5.6. However, I found a serious problem. My keyboard doesn’t work in VirtualBox. If a virtual machine is running and I click the window, the mouse is captured by the virtual machine. When I press the right Ctrl key the mouse should be released. However, it doesn’t work. I have to press Ctrl+Alt+Backspace to restart X. Some people said that the problem can be solved by disabling support to complex characters. But I need the multi-language support so that this method is unuseful for me.
Finally I found a good solution. I used “sudo apt-get install scim-bridge-client-qt” to install the scim-bridge-client-qt package and reboot my computer. Then the keyboard can work in VirtualBox. Although the solution is very simple, I don’t know why. It may be a bug in Ubuntu 8.04.1.
Sending AJAX Requests with Prototype
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. Read the rest of this entry »
Working with an Old Computer
October 8th, 2008Last month my friend and I exchanged our computers. Unfortunately, her computer’s memory is 256MB, only a half of mine. The operating system is Windows XP but mine is Ubuntu Linux. I like writing some programmes for fun but with a low memory I can not install some softwares. Eclipse, NetBeans, Visual Studio (Express Edition) are not fit for me any more. So I have to learn to use some lightweight softwares. Read the rest of this entry »