Showing posts with label www. Show all posts
Showing posts with label www. Show all posts

Friday, December 08, 2006

Free Advertising for Your Blog

Here is some suggestion for advertising your blog. First you can register your blog to some blog directories:
Second, you can reply posts in some popular newsgroups and forums. Include your blog's info in the signature of your replies.
Third, ask your friends to add the link of your blog in their homepage or blog.
The more web pages pointing to your blog, the higher ranking you can get in Google's search engine. To know the ranking of your homepage for some specific keywords in search engines, you can visit http://www.googlerankings.com/index.php. Now, it supports Google, MSN Search, Yahoo and Ask Search.

Friday, November 18, 2005

Obfuscate the Spammer's Robot

Most email users should have experience of receiving junk email. For me, my HongKong.com account, it receives around 100 junk email each day. This wastes our time to filter the email and makes us feel annoying.

Do you know how a spammer get your email addresses? Actually, your email addresses may already be put on the Web which can be accessed by the public. For example, in web-sites of many companies, they put contact lists containing email addresses of its staff. spammers use a program, called robot, to automatically retrieve email addresses on the Web. The spammers' robots move on the Web and try to get the email addresses. So, don't put your email addresses publicly.

However, sometimes you can't avoid it. So, it is suggested to post your email addresses on the Web in a obfuscated form. For example:

john [at] google [dot] com
The robot is a very simple program which can only recognize the email addresses in the form of "xxx@xxxx.xxx". Once the email address is transformed, the robot can't recognize it, but human can. However, it is not user-friendly. I suggest to use JavaScript to transform the the obfuscated email addresses back when mouse is over the email addresses. Here is a real example in my homepage: Contact. Such that, someone can copy and past the email address directly.

Monday, November 14, 2005

Comments Submission

I continued to my Blog development. In the comments text area of comments submission, my original implementation did NOT allow any HTML tag. It was mainly due to security reasons. However, this made the text of comments looks dull. I think it is better to allow some simple formatting tag e.g. <p>, <b>, <i>....

After did some survey on the web, I found the most popular technology is BBCode. BBCode defines a set of tags in form of "[xxx]" which will be converted to HTML tags. For example, "[b]bold text[/b]" is converted to "<b>bold text</b>". There are several free BBCode parsers available. It is convenient to deploy this technology.

One disadvantage of BBCode is not user-friendly. Users need to learn a new set of code. I thinks it is better to have a WYSIWYG editor. Unfortunately, I cannot find any web-based WYSIWYG editor for BBCode.

On the other hand, I found some open source web-based WYSIWYG HTML editors. It is great! I have tried the Cross-Browser Rich Text Editor and it works well in both Firefox and IE.

However, it is not secure to accept all HTML tags. On server side, it should filter out some dangerous tags, e.g. , .... There already exist some HTML filters. One of them is safehtml. Finally, I decided to use the WYSIWYG HTML editor plus HTML filter.


Saturday, October 29, 2005

GIF vs PNG

Today, I test my homepage with IE. IE cannot display transparent PNG graphics properly, and the background becomes grey in color.

Fortunately, I find a workaround on the Web -- http://homepage.ntlworld.com/bobosola/. It has details about the problem and how to solve it. In short, it uses javascript to patch all <img> tag of PNG graphic's CSS using the "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" of IE.

Actually, PNG has some advantages over GIF.

  1. Max color depth of PNG is 24-bit but that of GIF is 8-bit.
  2. PNG has higher compression rate than GIF.
  3. PNG support alpha channel transparency but GIF only support binary transparency.
However, GIF supports animation but PNG not. This is a weak point of PNG.

Related Links:
AlphaImageLoader Filter
PNG Offical Site

Monday, October 24, 2005

Designing My Homepage

I want to host my homepage in my NLSU2-Linux box. Today, it's the time to think about it. Since the NLSU2-Linux box is not a powerful machine, it is not appropriate to use Java technology. To put less load on the CPU, it should avoid using too much dynamic pages.

In my past experience, using static HTML, there are many duplication parts among different pages, for example, the page header, page footer, menus.... This make the web-site difficult to maintain. If I need to changes the page header, I need to edit nearly all HTML pages repeatedly. In programming, we avoid code duplication by using functions. How about make web pages? I think template is a solution.

In my homepage, I decided to use PHP as the template language. (To avoid confusion with PHP scripts for dynamic pages, the extension of template files is ".tpl") The following shows a typical page contains header and footer in PHP:

<? include 'header.tpl' ?>

.... the contents here .....

<? include 'footer.tpl' ?>


The "header.tpl" and "footer.tpl" are PHP scripts which generate the header and footer HTML fragments respectively. In PHP, the "include" function embedded the contents of the specific file in current pages, similar to the "include" directive in C/C++. In the homepage, every pages contains header and footer will be like the above example. If we want to change the header, we only need to change the "header.tpl" file once.

However, we need to convert the PHP file to HTML. For example, we have an "index.tpl" file which is a PHP script for generating "index.html". We can issue the following commands:

php index.tpl > index.html

For a complete homepage, there should be many ".tpl" files. I think nobody want to type the above command line again and again. GNU Make is a good utility to do this task.

Since I only have some experience to create a simple "Makefile", it is not enough for handling a complete homepage. I spent some hours to study the GNU Make and hope I can create a generic Makefile tomorrow.

Related links:
PHP
GNU Make